From: Joel Granados <j.granados@samsung.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>, <willy@infradead.org>,
<josh@joshtriplett.org>, Kees Cook <keescook@chromium.org>,
David Howells <dhowells@redhat.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
Benjamin LaHaise <bcrl@kvack.org>,
Eric Biederman <ebiederm@xmission.com>,
Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna@kernel.org>,
Chuck Lever <chuck.lever@oracle.com>,
Jeff Layton <jlayton@kernel.org>, Neil Brown <neilb@suse.de>,
Olga Kornievskaia <kolga@netapp.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Jan Kara <jack@suse.cz>, Amir Goldstein <amir73il@gmail.com>,
Matthew Bobrowski <repnop@google.com>,
Anton Altaparmakov <anton@tuxera.com>,
Namjae Jeon <linkinjeon@kernel.org>,
Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
Joseph Qi <joseph.qi@linux.alibaba.com>,
Iurii Zaikin <yzaikin@google.com>,
"Theodore Y. Ts'o" <tytso@mit.edu>,
Chandan Babu R <chandan.babu@oracle.com>,
"Darrick J. Wong" <djwong@kernel.org>,
Jan Harkes <jaharkes@cs.cmu.edu>, <coda@cs.cmu.edu>,
<linux-cachefs@redhat.com>, <linux-kernel@vger.kernel.org>,
<linux-fsdevel@vger.kernel.org>, <linux-aio@kvack.org>,
<linux-mm@kvack.org>, <linux-nfs@vger.kernel.org>,
<linux-ntfs-dev@lists.sourceforge.net>,
<ocfs2-devel@lists.linux.dev>, <fsverity@lists.linux.dev>,
<linux-xfs@vger.kernel.org>, <codalist@telemann.coda.cs.cmu.edu>
Subject: Re: [PATCH 2/4] aio: Remove the now superfluous sentinel elements from ctl_table array
Date: Thu, 9 Nov 2023 17:00:40 +0100 [thread overview]
Message-ID: <20231109160040.bahkcsp44t5xu7qo@localhost> (raw)
In-Reply-To: <20231108034231.GB2482@sol.localdomain>
[-- Attachment #1: Type: text/plain, Size: 3395 bytes --]
On Tue, Nov 07, 2023 at 07:42:31PM -0800, Eric Biggers wrote:
> On Tue, Nov 07, 2023 at 02:44:21PM +0100, Joel Granados via B4 Relay wrote:
> > [PATCH 2/4] aio: Remove the now superfluous sentinel elements from ctl_table array
>
> The commit prefix should be "fs:".
>
> > Remove sentinel elements ctl_table struct. Special attention was placed in
> > making sure that an empty directory for fs/verity was created when
> > CONFIG_FS_VERITY_BUILTIN_SIGNATURES is not defined. In this case we use the
> > register sysctl call that expects a size.
> [...]
> > diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h
> > index d071a6e32581..8191bf7ad706 100644
> > --- a/fs/verity/fsverity_private.h
> > +++ b/fs/verity/fsverity_private.h
> > @@ -122,8 +122,8 @@ void __init fsverity_init_info_cache(void);
> >
> > /* signature.c */
> >
> > -#ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES
> > extern int fsverity_require_signatures;
> > +#ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES
> > int fsverity_verify_signature(const struct fsverity_info *vi,
> > const u8 *signature, size_t sig_size);
> >
> > diff --git a/fs/verity/init.c b/fs/verity/init.c
> > index a29f062f6047..e31045dd4f6c 100644
> > --- a/fs/verity/init.c
> > +++ b/fs/verity/init.c
> > @@ -13,7 +13,6 @@
> > static struct ctl_table_header *fsverity_sysctl_header;
> >
> > static struct ctl_table fsverity_sysctl_table[] = {
> > -#ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES
> > {
> > .procname = "require_signatures",
> > .data = &fsverity_require_signatures,
> > @@ -23,14 +22,17 @@ static struct ctl_table fsverity_sysctl_table[] = {
> > .extra1 = SYSCTL_ZERO,
> > .extra2 = SYSCTL_ONE,
> > },
> > -#endif
> > - { }
> > };
> >
> > static void __init fsverity_init_sysctl(void)
> > {
> > +#ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES
> > fsverity_sysctl_header = register_sysctl("fs/verity",
> > fsverity_sysctl_table);
> > +#else
> > + fsverity_sysctl_header = register_sysctl_sz("fs/verity",
> > + fsverity_sysctl_table, 0);
> > +#endif
> > if (!fsverity_sysctl_header)
> > panic("fsverity sysctl registration failed");
>
> This does not make sense, and it causes a build error when CONFIG_FS_VERITY=y
> and CONFIG_FS_VERITY_BUILTIN_SIGNATURES=n.
>
> I think all you need to do is delete the sentinel element, the same as
> everywhere else. I just tested it, and it works fine.
I found the reason why I added the CONFIG_FS_VERITY_BUILTIN_SIGNATURES
here: it is related to
https://lore.kernel.org/all/20230705212743.42180-3-ebiggers@kernel.org/
where the directory is registered with an element only if
CONFIG_FS_VERITY_BUILTIN_SIGNATURES is defined. I had forgotten, but I
even asked for a clarification on the patch :).
I see that that patch made it to v6.6. So the solution is not to remove
the CONFIG_FS_VERITY_BUILTIN_SIGNATURES, but for me to rebase on top of
a more up to date base.
@Eric: Please get back to me if the patch in
https://lore.kernel.org/all/20230705212743.42180-3-ebiggers@kernel.org/
is no longer relevant.
Best.
>
> BTW, the comments for register_sysctl_sz() and __register_sysctl_table() are
> outdated, as they still say "A completely 0 filled entry terminates the table."
>
> - Eric
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2023-11-09 16:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 13:44 [PATCH 0/4] sysctl: Remove sentinel elements from fs dir Joel Granados via B4 Relay
2023-11-07 13:44 ` [PATCH 1/4] cachefiles: Remove the now superfluous sentinel element from ctl_table array Joel Granados via B4 Relay
2023-11-07 13:44 ` [PATCH 2/4] aio: Remove the now superfluous sentinel elements " Joel Granados via B4 Relay
2023-11-07 16:22 ` Darrick J. Wong
2023-11-08 8:28 ` Joel Granados
2023-11-08 3:42 ` Eric Biggers
2023-11-08 8:26 ` Joel Granados
2023-11-09 16:00 ` Joel Granados [this message]
2023-11-09 16:08 ` Eric Biggers
2023-11-09 21:12 ` Joel Granados
2023-11-08 9:56 ` Jan Kara
2023-11-07 13:44 ` [PATCH 3/4] sysctl: " Joel Granados via B4 Relay
2023-11-07 13:44 ` [PATCH 4/4] coda: " Joel Granados via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231109160040.bahkcsp44t5xu7qo@localhost \
--to=j.granados@samsung.com \
--cc=Dai.Ngo@oracle.com \
--cc=amir73il@gmail.com \
--cc=anna@kernel.org \
--cc=anton@tuxera.com \
--cc=bcrl@kvack.org \
--cc=brauner@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=chuck.lever@oracle.com \
--cc=coda@cs.cmu.edu \
--cc=codalist@telemann.coda.cs.cmu.edu \
--cc=dhowells@redhat.com \
--cc=djwong@kernel.org \
--cc=ebiederm@xmission.com \
--cc=ebiggers@kernel.org \
--cc=fsverity@lists.linux.dev \
--cc=jack@suse.cz \
--cc=jaharkes@cs.cmu.edu \
--cc=jlayton@kernel.org \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=josh@joshtriplett.org \
--cc=keescook@chromium.org \
--cc=kolga@netapp.com \
--cc=linkinjeon@kernel.org \
--cc=linux-aio@kvack.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-ntfs-dev@lists.sourceforge.net \
--cc=linux-xfs@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=mcgrof@kernel.org \
--cc=neilb@suse.de \
--cc=ocfs2-devel@lists.linux.dev \
--cc=repnop@google.com \
--cc=tom@talpey.com \
--cc=trond.myklebust@hammerspace.com \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=yzaikin@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).