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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMw=ZnTcsYXnwDcKNxwbLCE3dWwaw_UBRmaBUNCYEF5X4BCGuw@mail.gmail.com>
Date: Mon, 7 Aug 2023 10:50:41 +0100
From: Luca Boccassi <bluca@...ian.org>
To: David Rheinsberg <david@...dahead.eu>
Cc: netdev@...r.kernel.org, Alexander Mikhalitsyn <alexander@...alicyn.com>, 
	Christian Brauner <brauner@...nel.org>, "David S . Miller" <davem@...emloft.net>, 
	Stanislav Fomichev <sdf@...gle.com>, Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH] net/unix: use consistent error code in SO_PEERPIDFD

On Mon, 7 Aug 2023 at 09:13, David Rheinsberg <david@...dahead.eu> wrote:
>
> Change the new (unreleased) SO_PEERPIDFD sockopt to return ENODATA
> rather than ESRCH if a socket type does not support remote peer-PID
> queries.
>
> Currently, SO_PEERPIDFD returns ESRCH when the socket in question is
> not an AF_UNIX socket. This is quite unexpected, given that one would
> assume ESRCH means the peer process already exited and thus cannot be
> found. However, in that case the sockopt actually returns EINVAL (via
> pidfd_prepare()). This is rather inconsistent with other syscalls, which
> usually return ESRCH if a given PID refers to a non-existant process.
>
> This changes SO_PEERPIDFD to return ENODATA instead. This is also what
> SO_PEERGROUPS returns, and thus keeps a consistent behavior across
> sockopts.
>
> Note that this code is returned in 2 cases: First, if the socket type is
> not AF_UNIX, and secondly if the socket was not yet connected. In both
> cases ENODATA seems suitable.
>
> Signed-off-by: David Rheinsberg <david@...dahead.eu>
> ---
> Hi!
>
> The SO_PEERPIDFD sockopt has been queued for 6.5, so hopefully we can
> get that in before the release?
>
> Thanks
> David
>
>  net/core/sock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

As one of the first users of this new API, I am fine with this for 6.5, thanks.

Acked-by: Luca Boccassi <bluca@...ian.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ