From patchwork Fri Feb 3 14:50:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Starke" X-Patchwork-Id: 52548 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp884075wrn; Fri, 3 Feb 2023 07:00:21 -0800 (PST) X-Google-Smtp-Source: AK7set/6b3Rl0YRObj3OH2FIGlkGuH+KaOQgxiTtd+1Xr1gAf0yq0G9LG/A97GjDUcd6wRpTW7yf X-Received: by 2002:a05:6a20:6904:b0:bf:58d1:ce87 with SMTP id q4-20020a056a20690400b000bf58d1ce87mr5745773pzj.6.1675436421174; Fri, 03 Feb 2023 07:00:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675436421; cv=none; d=google.com; s=arc-20160816; b=i1GB4llJZwpwutyCi+0K41z5+iO4NnoCF3MPExWNDed3SrKt7RiMbUQCdyQg+epiJq O/6zCk8LAmsbBesFDIvmZi95InLQb6LJL2vMzma802o+tKpoXasddfH5w8ix4e7pV6fr Gm1fqcuf47IHz9rWSy4uGhLRVVLd1fLtfkNaWQ6qzAFo6lGYuOCyhaCwoOzuZq9H+yct euNlGI9BwyOxySuRl73hDQHIq/Ma9yHmo8ncmnETMsHybFd/BV/hwf+CkPX9jiBSCAQ2 wIyoRBP3Lsm0rJlDUE0aGrzCI9sXZWvHSTuepecXnsKITNDE5qQ2fnJCmcq6BO6NlPd0 nnYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=2NyostHau00yFANqCpLq5nifgI6rwhrmtoY/jfHx2Is=; b=PpdS8QymNNtWN/QqRZdR9FnQaTx37uWUkLdEJ3JNcijoqx7JM55DGsok1gIDZ2Cq2O +cCssgB1mHuF3nvo18rCsqgHqi/uLi6INjmAn45e6jnmJMG4VUdiodIF9ItVnMRyKFFX ZxLIZBJJTseEOD6FaMcMgeuUmyFVvL7TN9qSGp9l9FvsHrvEKBYdBgVjZ0X1u64FmScJ 7vcpZhQp9E+sttP5GrBmoBy0WjXV7yg/lV3FybvQ1SHOKk5Ng+s/v07TMmtHnmpKLQnE Z4Cmh24GlJnp+pIiZIZoLmabfuqg9xuYHJiPKjF8EdvZIzWROU/OeD/bgRG6mTYHzW9f Pp9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=CJBGn6O5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 123-20020a630181000000b004790f4d9ad2si3038771pgb.636.2023.02.03.07.00.08; Fri, 03 Feb 2023 07:00:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=CJBGn6O5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232774AbjBCOwA (ORCPT + 99 others); Fri, 3 Feb 2023 09:52:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233652AbjBCOvs (ORCPT ); Fri, 3 Feb 2023 09:51:48 -0500 X-Greylist: delayed 61 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 03 Feb 2023 06:51:47 PST Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A26F9EE14 for ; Fri, 3 Feb 2023 06:51:46 -0800 (PST) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20230203145042fb6f5c09fa4e60e438 for ; Fri, 03 Feb 2023 15:50:42 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=daniel.starke@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=2NyostHau00yFANqCpLq5nifgI6rwhrmtoY/jfHx2Is=; b=CJBGn6O5tt+YtviI7Rqvp915HSd/PvX58OE1ttGShpokhNS4cP2PVb4h+VmzX8aoU49BxQ xj/mpKUdVwkhDxpAZesf4Ci8fcGZYn9wBk0KMrFjyGqTysO8pDQRVR/BKTrDs9BeOoLWAg7t 41VN7coSQdsxCGiw01BIdq6ZaNsfg=; From: "D. Starke" To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH v3 1/4] tty: n_gsm: mark unusable ioctl structure fields accordingly Date: Fri, 3 Feb 2023 15:50:20 +0100 Message-Id: <20230203145023.6012-1-daniel.starke@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044:519-21489:flowmailer X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756822420916592559?= X-GMAIL-MSGID: =?utf-8?q?1756822420916592559?= From: Daniel Starke gsm_config and gsm_netconfig includes unused fields that have been included to allow future extension without changing the structure size. Unfortunately, no checks have been included for these field. The actual value set by old user space code remains undefined. This means that future extensions can not use these fields without breaking old user space code which may set unexpected values. Mark these fields accordingly to avoid breaking code changes. Signed-off-by: Daniel Starke --- include/uapi/linux/gsmmux.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) v2 -> v3: Split previous patch 1/3 into two commits as recommended in the review. No other changes. Link: https://lore.kernel.org/all/Y9vYxgGd6kC+ZIgR@kroah.com/ diff --git a/include/uapi/linux/gsmmux.h b/include/uapi/linux/gsmmux.h index cb8693b39cb7..785d6b253f6d 100644 --- a/include/uapi/linux/gsmmux.h +++ b/include/uapi/linux/gsmmux.h @@ -19,8 +19,7 @@ struct gsm_config unsigned int mtu; unsigned int k; unsigned int i; - unsigned int unused[8]; /* Padding for expansion without - breaking stuff */ + unsigned int unused[8]; /* Can not be used */ }; #define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config) @@ -29,9 +28,9 @@ struct gsm_config struct gsm_netconfig { unsigned int adaption; /* Adaption to use in network mode */ unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */ - unsigned short unused2; + unsigned short unused2; /* Can not be used */ char if_name[IFNAMSIZ]; /* interface name format string */ - __u8 unused[28]; /* For future use */ + __u8 unused[28]; /* Can not be used */ }; #define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)