Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp862298rdb; Wed, 6 Dec 2023 01:56:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFitxhdJLqq4U84JlPeK/WgAe/zvyj2c8LS3Ymi27i33MKcogMK6dyM7CfwDgrw0xSIDlO X-Received: by 2002:a05:6870:5494:b0:1fb:75b:999a with SMTP id f20-20020a056870549400b001fb075b999amr605233oan.73.1701856582183; Wed, 06 Dec 2023 01:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701856582; cv=none; d=google.com; s=arc-20160816; b=xPGz/tPIT7Jmvi8GCanMYb1LkGRCwr5Yj3b3yAa4TpSPqgY124fHJg4XjBnNK+cb/3 XiWbCxYD8J0KM2/E9erv0OyNmLCgDh6+wUbZd8KdWLZmZWsEr3DzIWL7R4pzQH01miR9 l38uKdvE0E7S39F21Ik0TV+Yegt4G5N26MsUTfKPQX0T6SV92q/ysSKCgUlIgSL8X4eV aC2EJyZrHNkip4Pp78ZEG9QbYH7L5GGvMU98hBvN40oYDPIoQUG4/jcACSp5BSjKgA2P ha04mOsxMRwZzJZGlhg/QNLJMqg0crqNyl71CEJ1bdvhMWQVh765HgtZUH5tFgDcjb3d 7wbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=38oqPwid60kS6euzFAYt5HgeBK7Z4xKSWiLADq6sPMY=; fh=wHpzEdBYSb8OHQB38CZJ29sOV61Cr9S/tnNjxnBTsZE=; b=cxZCMjvUlmNiFZcCjriqK5cNtKwbkrXlPHTJxv6SeAsGWJHtH6CWJPpCcDhaEQfcXY Om2siG8X59J5FDPfqLjwffp1GN0yqOx987OEFN5DHJLbRMuFa9fTCczxibmrEV/AAD6v CHapHbRPvWCuIOMepJnBDFUb3z6wle6F16QpG6D73Quv+rqg6MFBurfjcipdBb5hDMiF nggO4tzF0ps96cM5yRCMswX71RvvpFtbqOPezVyfH7M963EpRXQarSuA1Xv/cXS7afpq DUDdIu9LVZ5f0aKjTPQrLLi45OacQHroI5gJrGRMgWnn3QIunL8loqcvaZGdbB2j1YtL MIOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FKeU3LMZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id a23-20020a63e417000000b005b96c2ab110si11146401pgi.131.2023.12.06.01.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 01:56:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FKeU3LMZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8339E80BCF4A; Wed, 6 Dec 2023 01:56:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377300AbjLFJ4C (ORCPT + 99 others); Wed, 6 Dec 2023 04:56:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjLFJz5 (ORCPT ); Wed, 6 Dec 2023 04:55:57 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3C24109; Wed, 6 Dec 2023 01:56:03 -0800 (PST) Received: from relay2.suse.de (unknown [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 42E7E21F3E; Wed, 6 Dec 2023 09:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1701856557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=38oqPwid60kS6euzFAYt5HgeBK7Z4xKSWiLADq6sPMY=; b=FKeU3LMZDT6YmQll0fLvK+UGD/SN8T7VGmFqsMDJZ9gc7NNDpRzn0VjFzbOasPnTTTwXm8 xPVqFHyCbTZoR93GW8VwteHKafJJLTvb8OSsW9IsNoI+X0Eqqx1X8Q9Bl9H/XbIz9boQoX ZDeYZXSjELH22O3pRsNY1WMUbqC3LoU= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 2839E2C153; Wed, 6 Dec 2023 09:55:51 +0000 (UTC) Date: Wed, 6 Dec 2023 10:55:51 +0100 From: Petr Mladek To: Joel Granados Cc: Luis Chamberlain , willy@infradead.org, josh@joshtriplett.org, Kees Cook , Eric Biederman , Iurii Zaikin , Steven Rostedt , Masami Hiramatsu , Mark Rutland , Thomas Gleixner , John Stultz , Stephen Boyd , Andy Lutomirski , Will Drewry , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , John Ogness , Sergey Senozhatsky , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Balbir Singh , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH 07/10] printk: Remove the now superfluous sentinel elements from ctl_table array Message-ID: References: <20231107-jag-sysctl_remove_empty_elem_kernel-v1-0-e4ce1388dfa0@samsung.com> <20231107-jag-sysctl_remove_empty_elem_kernel-v1-7-e4ce1388dfa0@samsung.com> <20231204085628.pf7yxppacf4pm2cv@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231204085628.pf7yxppacf4pm2cv@localhost> X-Spam-Score: 22.12 X-Spamd-Result: default: False [22.12 / 50.00]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[149.44.160.134:from]; RDNS_NONE(1.00)[]; TO_DN_SOME(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[149.44.160.134:from]; HFILTER_HELO_IP_A(1.00)[relay2.suse.de]; HFILTER_HELO_NORES_A_OR_MX(0.30)[relay2.suse.de]; MX_GOOD(-0.01)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FORGED_RECIPIENTS(2.00)[m:mgorman@suse.de,s:mgorman@imap.suse.de]; BAYES_HAM(-3.00)[100.00%]; RDNS_DNSFAIL(0.00)[]; ARC_NA(0.00)[]; R_SPF_FAIL(1.00)[-all]; FROM_HAS_DN(0.00)[]; DMARC_POLICY_QUARANTINE(1.50)[suse.com : No valid SPF, No valid DKIM,quarantine]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; NEURAL_SPAM_SHORT(2.12)[0.707]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_SPAM_LONG(3.50)[1.000]; RCPT_COUNT_TWELVE(0.00)[46]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[kernel.org,infradead.org,joshtriplett.org,chromium.org,xmission.com,google.com,goodmis.org,arm.com,linutronix.de,amacapital.net,redhat.com,linaro.org,suse.de,linux.ibm.com,intel.com,davemloft.net,gmail.com,iogearbox.net,linux.dev,vger.kernel.org,lists.infradead.org]; HFILTER_HOSTNAME_UNKNOWN(2.50)[]; SUSPICIOUS_RECIPS(1.50)[]; RCVD_COUNT_TWO(0.00)[2] X-Spamd-Bar: ++++++++++++++++++++++ X-Rspamd-Server: rspamd1 Authentication-Results: smtp-out1.suse.de; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=suse.com (policy=quarantine); spf=fail (smtp-out1.suse.de: domain of pmladek@suse.com does not designate 149.44.160.134 as permitted sender) smtp.mailfrom=pmladek@suse.com X-Rspamd-Queue-Id: 42E7E21F3E X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 06 Dec 2023 01:56:18 -0800 (PST) On Mon 2023-12-04 09:56:28, Joel Granados wrote: > Hey Petr > > I missed this message somehow.... > > On Tue, Nov 28, 2023 at 03:07:43PM +0100, Petr Mladek wrote: > > On Tue 2023-11-07 14:45:07, Joel Granados via B4 Relay wrote: > > > 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/) > > > > > > rm sentinel element from printk_sysctls > > > > > > Signed-off-by: Joel Granados > > > > I am a bit sceptical if the size and time reduction is worth the > > effort. I feel that this change makes the access a bit less secure. > In what way "less secure"? Can you expand on that? > > Notice that if you pass a pointer to the register functions, you will > get a warning/error on compilation. I have vague memories that some arrays were not static or the length has been somehow manipulated. But I might be wrong. You are right that it should be safe with the static arrays. And the NULL sentinel might be more error-prone after all. Let's forget my mumbles. Best Regards, Petr