lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230621131552.pqsordxcjmiopciq@localhost>
Date:   Wed, 21 Jun 2023 15:15:52 +0200
From:   Joel Granados <j.granados@...sung.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:     <mcgrof@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, <x86@...nel.org>,
        Theodore Ts'o <tytso@....edu>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        Jiri Slaby <jirislaby@...nel.org>,
        Juergen Gross <jgross@...e.com>,
        Stefano Stabellini <sstabellini@...nel.org>,
        Benjamin LaHaise <bcrl@...ck.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <brauner@...nel.org>,
        Jeff Layton <jlayton@...nel.org>,
        Chuck Lever <chuck.lever@...cle.com>, Jan Kara <jack@...e.cz>,
        Kees Cook <keescook@...omium.org>,
        Iurii Zaikin <yzaikin@...gle.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Balbir Singh <bsingharora@...il.com>,
        Eric Biederman <ebiederm@...ssion.com>,
        "Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
        Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
        "David S. Miller" <davem@...emloft.net>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Will Deacon <will@...nel.org>, Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Muchun Song <muchun.song@...ux.dev>,
        Naoya Horiguchi <naoya.horiguchi@....com>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        David Howells <dhowells@...hat.com>,
        Jarkko Sakkinen <jarkko@...nel.org>,
        Paul Moore <paul@...l-moore.com>,
        James Morris <jmorris@...ei.org>,
        "Serge E. Hallyn" <serge@...lyn.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
        Amir Goldstein <amir73il@...il.com>,
        John Fastabend <john.fastabend@...il.com>,
        Martin KaFai Lau <martin.lau@...ux.dev>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
        KP Singh <kpsingh@...nel.org>,
        Stanislav Fomichev <sdf@...gle.com>,
        Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
        Waiman Long <longman@...hat.com>,
        Boqun Feng <boqun.feng@...il.com>,
        John Ogness <john.ogness@...utronix.de>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Valentin Schneider <vschneid@...hat.com>,
        Andy Lutomirski <luto@...capital.net>,
        Will Drewry <wad@...omium.org>,
        Mark Rutland <mark.rutland@....com>,
        Miaohe Lin <linmiaohe@...wei.com>,
        <linux-kernel@...r.kernel.org>, <xen-devel@...ts.xenproject.org>,
        <linux-aio@...ck.org>, <linux-fsdevel@...r.kernel.org>,
        <linux-mm@...ck.org>, <bpf@...r.kernel.org>,
        <kexec@...ts.infradead.org>, <linux-trace-kernel@...r.kernel.org>,
        <keyrings@...r.kernel.org>, <linux-security-module@...r.kernel.org>
Subject: Re: [PATCH 08/11] sysctl: Add size to register_sysctl_init

On Wed, Jun 21, 2023 at 12:47:58PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 21, 2023 at 11:09:57AM +0200, Joel Granados wrote:
> >  static int __init random_sysctls_init(void)
> >  {
> > -	register_sysctl_init("kernel/random", random_table);
> > +	register_sysctl_init("kernel/random", random_table,
> > +			     ARRAY_SIZE(random_table));
> 
> As mentioned before, why not just do:
> 
> #define register_sysctl_init(string, table)	\
> 	__register_sysctl_init(string, table, ARRAY_SIZE(table);
Answered you in the original mail where you suggested it.

Best
> 
> or something like that?
> 
> That way no callers need to change AND you prevent the size from ever
> being incorrect?
> 
> thanks,
> 
> greg k-h

-- 

Joel Granados

Download attachment "signature.asc" of type "application/pgp-signature" (660 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ