[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a0ae82d6-8c9f-4b6d-9f7b-a6d38efbf80f@maowtm.org>
Date: Mon, 9 Feb 2026 18:33:38 +0000
From: Tingmao Wang <m@...wtm.org>
To: Mickaël Salaün <mic@...ikod.net>,
Justin Suess <utilityemal77@...il.com>, Günther Noack
<gnoack3000@...il.com>
Cc: John Johansen <john.johansen@...onical.com>,
Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
"Serge E . Hallyn" <serge@...lyn.com>,
linux-security-module@...r.kernel.org,
Samasth Norway Ananda <samasth.norway.ananda@...cle.com>,
Matthieu Buffet <matthieu@...fet.re>,
Mikhail Ivanov <ivanov.mikhail1@...wei-partners.com>,
konstantin.meskhidze@...wei.com, Demi Marie Obenour <demiobenour@...il.com>,
Alyssa Ross <hi@...ssa.is>, Jann Horn <jannh@...gle.com>,
Tahera Fahimi <fahimitahera@...il.com>, Simon Horman <horms@...nel.org>,
netdev@...r.kernel.org, Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>
Subject: Re: [PATCH v4 1/6] lsm: Add LSM hook security_unix_find
On 2/9/26 17:51, Mickaël Salaün wrote:
> On Mon, Feb 09, 2026 at 12:10:11AM +0100, Günther Noack wrote:
>> [...]
>> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
>> index d0511225799b..db9d279b3883 100644
>> --- a/net/unix/af_unix.c
>> +++ b/net/unix/af_unix.c
>> @@ -1226,10 +1226,19 @@ static struct sock *unix_find_bsd(struct sockaddr_un *sunaddr, int addr_len,
>> if (!S_ISSOCK(inode->i_mode))
>> goto path_put;
>>
>> + err = -ECONNREFUSED;
>
> We don't see it in this patch but err is already set to -ECONNREFUSED.
> This line might be confusing, and unrelated to the goal of this patch,
> so we should remove it.
I will confess that in a side conversation with Justin previously I
suggested that for blocks like these it might be better to always assign
to err, and let the compiler optimize it away, so that when this block is
moved there is less chances of mistake. (This was relevant in the
previous context where a move of this hook caused err to be reset,
resulting in a NULL deference from syzbot)
But of course if the convention in this file is to not do it, or if I have
missed some reason against doing this, then that's also fine (even though,
IMHO, personally I think this is better).
Powered by blists - more mailing lists