Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp527673lqh; Thu, 28 Mar 2024 08:41:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXE+GpF6Y6rBswHTJX6i5o8coCqRpro5HsPwx5rFQongqokhoe04zxmqRCkUiVrN1fTOJ8CXuzi5eaynpSlLV7HgDWb9omgzAkhQ7KENQ== X-Google-Smtp-Source: AGHT+IEpA6+bXJrWACRb4GmDrAynEXDYEHLEI5Q9AvkkHIg0swH1MYJJqif6X4ZniL8gxITNZFlU X-Received: by 2002:a05:6808:11c9:b0:3c3:8a48:b7eb with SMTP id p9-20020a05680811c900b003c38a48b7ebmr3507740oiv.42.1711640472739; Thu, 28 Mar 2024 08:41:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711640472; cv=pass; d=google.com; s=arc-20160816; b=B7BxQ9pgfhzPrNVLc1OmfZM4vTQePxBrQzw966RT9BiQSjmChU1zOUimhkF/+RpUf+ 2ROkWwVKEjeRdZfrX7kbNYN/rYN4loEfSsE5bmzjrdEtMTxuU7rHxNrZWBc6qYxDdKLx tUBCm3kD0lZtWlgczTEiBcicWgO/O/vpzmHHC3bEb1YfaZBz90jEa2krnISTiuqIsvCX 8yKGvb7cK/Avju6diwFkI/f/drzkg5W5Tk4W/VvUegm6Ei2KKdBPuD+9GM7h7SK0kTHf ARLU64W+0Z59CJi/tbxF3QjBD/0VJR8B3VDdZUlNx+/zAoUg6yD82s+TB+6+eMaeueKj ki7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=fE2Ue1n6xT8KvHvEyXR0BFtu+bwR24zQaRCqxY7YOoU=; fh=5g1ykxCv7ojYBYHK3aM7cpTkEd6dkeVMOJWUsjMgiIo=; b=EO2BYQJnd9FDHLRCQO/5uGHu+juQeavYCRAyonMUQ/0hfiuFTIFlamIheejD9XDE5E sgyqnYjmJdXfMZUHxp12popnyHfjAKcZvsCZT9z3iQHoWrv3hPGWScx9hoE4iAH7jdzm /dDPgucHKKmBg+xviWK00JKb/XBm6/MWUDDVOzqtDrzpSbUAadkwDZ7OxqA0sCt+HEJT OAHywkMb/BPqkacdnr2Y+sQidGxkn3TqbEPMCaCrkx4CYiO/v1g+J8mndLaFUVryjhl9 xFew7j2+d+g+8HfHTaJHo6dW4haAJxTadSvhzi7jdR2fEBnd4Juxc+Zb+RbprTGuk8OG GhCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nwoB0QZV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-2516-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2516-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d21-20020ac85ad5000000b004313ac9c0c0si1700149qtd.576.2024.03.28.08.41.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 08:41:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2516-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nwoB0QZV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-2516-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2516-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 67FCA1C2D2FF for ; Thu, 28 Mar 2024 15:41:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C88EC131734; Thu, 28 Mar 2024 15:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nwoB0QZV" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C97F1304BF; Thu, 28 Mar 2024 15:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711640440; cv=none; b=f5gCWPre52hlj4LMzMRpihsfNSy/xEB+q6l5mQ6p2OJBVcYn8YSqY+t7cfo/jU0oEOPwQZDgNCekBpI9+CfLBvO5SoTxHWnXQ9hGDZS9AcOeNpaqLQyjeSM1lyfhl0GK/8sjuQPYB4fMNAYx8SaZakKRDLvUR2zQISki9tbwU/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711640440; c=relaxed/simple; bh=nUlKXcXbpiwl4TjgmWHkIBUZInnNECY1Y38Or1u8KAo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hDFN1VhJuaRMYan8ZIZ2D/MSxvFeiUKoNXXK01X/zjrEpwo+sUam4ZiHAK4F3A3G3nnthY6oCsMtytgZ1NX+yxkji19ZRPK+UxgFtqXQqxxlFgcMo1e7mEBuk0U4v4uzi6xOOPLzJztbg0HGaxiQ+6mH9e7MLdWfoKQiAhbWRz0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nwoB0QZV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id C6DD8C3277D; Thu, 28 Mar 2024 15:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711640439; bh=nUlKXcXbpiwl4TjgmWHkIBUZInnNECY1Y38Or1u8KAo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=nwoB0QZVzndis7CIHjOjgiOMQ0rBSAbcs/dBPN3eXrR9+dj68TxMLnyT9OicpOwCS D8J4ihPNkKNi2xLgLv6Xbf1D3Ab07/3rhSayK/+hMe0uXFHk7rP3EwHSeYkv0Tlczh 4Z5H3CLrnTqoi+DAw3PVtnWFG6TPcnE8pdY4XO25hoDBaidK7Bv2z7z0NkoclD7d+u wupshjNEp+vup4NMdIq1TqFm5YocmObuT+0SHqLD6fufKcH4tHUOWID1BofpoVzFSz r2+tWVj2gMt6jcXwYQ5jvWUNi0KzFblQh9lN8vRHfe/bje5R0dqIcO3eeFX6/o3BkR oSSFy+625lEfw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9CB2C54E67; Thu, 28 Mar 2024 15:40:39 +0000 (UTC) From: Joel Granados via B4 Relay Date: Thu, 28 Mar 2024 16:40:05 +0100 Subject: [PATCH v2 4/4] ax.25: Remove the now superfluous sentinel elements from ctl_table array Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240328-jag-sysctl_remset_net-v2-4-52c9fad9a1af@samsung.com> References: <20240328-jag-sysctl_remset_net-v2-0-52c9fad9a1af@samsung.com> In-Reply-To: <20240328-jag-sysctl_remset_net-v2-0-52c9fad9a1af@samsung.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexander Aring , Stefan Schmidt , Miquel Raynal , David Ahern , Steffen Klassert , Herbert Xu , Matthieu Baerts , Mat Martineau , Geliang Tang , Ralf Baechle , Remi Denis-Courmont , Allison Henderson , David Howells , Marc Dionne , Marcelo Ricardo Leitner , Xin Long , Wenjia Zhang , Jan Karcher , "D. Wythe" , Tony Lu , Wen Gu , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Jon Maloy , Ying Xue , Martin Schiller , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Roopa Prabhu , Nikolay Aleksandrov , Simon Horman , Julian Anastasov , Joerg Reuter , Luis Chamberlain , Kees Cook Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dccp@vger.kernel.org, linux-wpan@vger.kernel.org, mptcp@lists.linux.dev, linux-hams@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-afs@lists.infradead.org, linux-sctp@vger.kernel.org, linux-s390@vger.kernel.org, linux-nfs@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-x25@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux.dev, lvs-devel@vger.kernel.org, Joel Granados X-Mailer: b4 0.13-dev-2d940 X-Developer-Signature: v=1; a=openpgp-sha256; l=1638; i=j.granados@samsung.com; h=from:subject:message-id; bh=8B/rrWAL/Wpety1Z6TfAfT8YMsH+ZTrcc2Fe5CJkM6Q=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGYFj3UWFMJwECpzMsKOabEHFZ29RUM3Lbkr1 /uDHBI3u+wM6IkBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmBY91AAoJELqXzVK3 lkFPxUEL/R/Sp5cRTbTCRDejAzJFEfyWjCXt59NTj6GRoOzv6BqOQTUEgIe4qnlu3vvL3yhgl+F tyoQn8JAI5uQEcMzt1QuuaMx9u6qR/ar3Ghya5nYFICCPkeJhZs9dJuJ5nGByrsj8xNl6YIrnf3 WoPtg1nYm6EKFljogLHRRkvXFybbFNkim3DUIuTNXLOeATFcI7GTWLUqz/pxI23k+ME7VuwikEh FU3SdZNXOhrM7WgN9TsQjZZBHmYd2fuJ3w3Seut5m4oLliJSW2SQ9vadfExyGai2tLDv0Ez7n/9 w0z+nxH7ARBPeLJ9gn7WzG3NOHeGQxiJXJUo+xvxSJWuE48bkhBjQXEUxretS+xVh5CQ7dtYaM+ mTZhjJUyqjIjJF1XXAZEgRApfuW3gS6oTTgQiRs404iWNxpTXUlnyz62wrhOGTs65xC0WpXfTtZ 4xxHauzePSibHy4AEKRf5i2gsSWP8y7s6PZfzt3QkicmxXlwhR3Vs9DstbypRLUMVTnFRydkHi6 Io= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com From: Joel Granados This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) When we remove the sentinel from ax25_param_table a buffer overflow shows its ugly head. The sentinel's data element used to be changed when CONFIG_AX25_DAMA_SLAVE was not defined. This did not have any adverse effects as we still stopped on the sentinel because of its null procname. But now that we do not have the sentinel element, we are careful to check ax25_param_table's size. Signed-off-by: Joel Granados --- net/ax25/sysctl_net_ax25.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c index db66e11e7fe8..e55be8817a1e 100644 --- a/net/ax25/sysctl_net_ax25.c +++ b/net/ax25/sysctl_net_ax25.c @@ -141,8 +141,6 @@ static const struct ctl_table ax25_param_table[] = { .extra2 = &max_ds_timeout }, #endif - - { } /* that's all, folks! */ }; int ax25_register_dev_sysctl(ax25_dev *ax25_dev) @@ -155,7 +153,7 @@ int ax25_register_dev_sysctl(ax25_dev *ax25_dev) if (!table) return -ENOMEM; - for (k = 0; k < AX25_MAX_VALUES; k++) + for (k = 0; k < AX25_MAX_VALUES && k < ARRAY_SIZE(ax25_param_table); k++) table[k].data = &ax25_dev->values[k]; snprintf(path, sizeof(path), "net/ax25/%s", ax25_dev->dev->name); -- 2.43.0