From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <stephen.smalley.work@gmail.com>
Cc: <anna@kernel.org>, <brauner@kernel.org>, <casey@schaufler-ca.com>,
<davem@davemloft.net>, <edumazet@google.com>, <horms@kernel.org>,
<jack@suse.cz>, <jmorris@namei.org>, <kuba@kernel.org>,
<kuniyu@amazon.com>, <linux-fsdevel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-nfs@vger.kernel.org>,
<linux-security-module@vger.kernel.org>, <netdev@vger.kernel.org>,
<omosnace@redhat.com>, <pabeni@redhat.com>, <paul@paul-moore.com>,
<selinux@vger.kernel.org>, <serge@hallyn.com>,
<trondmy@kernel.org>, <viro@zeniv.linux.org.uk>,
<willemb@google.com>
Subject: Re: [PATCH v2] security,fs,nfs,net: update security_inode_listsecurity() interface
Date: Tue, 20 May 2025 17:31:49 -0700 [thread overview]
Message-ID: <20250521003211.8847-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20250428195022.24587-2-stephen.smalley.work@gmail.com>
From: Stephen Smalley <stephen.smalley.work@gmail.com>
Date: Mon, 28 Apr 2025 15:50:19 -0400
> Update the security_inode_listsecurity() interface to allow
> use of the xattr_list_one() helper and update the hook
> implementations.
>
> Link: https://lore.kernel.org/selinux/20250424152822.2719-1-stephen.smalley.work@gmail.com/
>
> Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
[...]
> diff --git a/net/socket.c b/net/socket.c
> index 9a0e720f0859..bbcaa3371fcd 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -560,17 +560,14 @@ static ssize_t sockfs_listxattr(struct dentry *dentry, char *buffer,
> size_t size)
> {
> ssize_t len;
> - ssize_t used = 0;
> + ssize_t used, remaining;
> + int err;
Paul: Could you sort this in the reverse xmas tree order before merging ?
https://docs.kernel.org/process/maintainer-netdev.html#local-variable-ordering-reverse-xmas-tree-rcs
otherwise the socket part looks good to me:
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
>
> - len = security_inode_listsecurity(d_inode(dentry), buffer, size);
> - if (len < 0)
> - return len;
> - used += len;
> - if (buffer) {
> - if (size < used)
> - return -ERANGE;
> - buffer += len;
> - }
> + err = security_inode_listsecurity(d_inode(dentry), &buffer,
> + &remaining);
> + if (err)
> + return err;
> + used = size - remaining;
>
> len = (XATTR_NAME_SOCKPROTONAME_LEN + 1);
> used += len;
next prev parent reply other threads:[~2025-05-21 0:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 19:50 [PATCH v2] security,fs,nfs,net: update security_inode_listsecurity() interface Stephen Smalley
2025-04-29 7:46 ` Christian Brauner
2025-04-29 12:25 ` Stephen Smalley
2025-04-29 23:34 ` Paul Moore
2025-05-20 21:31 ` Paul Moore
2025-05-21 0:22 ` Casey Schaufler
2025-05-27 21:03 ` Anna Schumaker
2025-06-19 21:18 ` Paul Moore
2025-07-24 2:09 ` Paul Moore
2025-12-03 15:35 ` Stephen Smalley
2025-12-03 15:55 ` Paul Moore
2025-12-03 18:08 ` Stephen Smalley
2025-12-03 20:01 ` Stephen Smalley
2025-06-05 18:09 ` Stephen Smalley
2025-06-05 18:24 ` Paul Moore
2025-05-21 0:31 ` Kuniyuki Iwashima [this message]
2025-06-19 21:04 ` Paul Moore
2025-06-06 13:39 ` Konstantin Andreev
2025-06-06 14:28 ` Stephen Smalley
2025-06-06 15:24 ` Konstantin Andreev
2026-04-28 19:21 ` [PATCH ported/repost " Paul Moore
2026-04-28 19:26 ` Paul Moore
2026-05-01 16:00 ` Paul Moore
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=20250521003211.8847-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=anna@kernel.org \
--cc=brauner@kernel.org \
--cc=casey@schaufler-ca.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jack@suse.cz \
--cc=jmorris@namei.org \
--cc=kuba@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=omosnace@redhat.com \
--cc=pabeni@redhat.com \
--cc=paul@paul-moore.com \
--cc=selinux@vger.kernel.org \
--cc=serge@hallyn.com \
--cc=stephen.smalley.work@gmail.com \
--cc=trondmy@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willemb@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