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: <Y/inNodCGZlPz5wF@eidolon.nox.tf>
Date:   Fri, 24 Feb 2023 13:01:58 +0100
From:   David Lamparter <equinox@...c24.net>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     David Lamparter <equinox@...c24.net>, Jens Axboe <axboe@...nel.dk>,
        netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Willem de Bruijn <willemdebruijn.kernel@...il.com>
Subject: Re: [PATCH net-next] packet: allow MSG_NOSIGNAL in recvmsg

On Fri, Feb 24, 2023 at 11:26:27AM +0100, Eric Dumazet wrote:
> On Fri, Feb 24, 2023 at 8:18 AM David Lamparter <equinox@...c24.net> wrote:
[...]
> > packet_recvmsg() whitelists a bunch of MSG_* flags, which notably does
> > not include MSG_NOSIGNAL.  Unfortunately, io_uring always sets
> > MSG_NOSIGNAL, meaning AF_PACKET sockets can't be used in io_uring
> > recvmsg().
> 
> This is odd... I think MSG_NOSIGNAL flag has a meaning for sendmsg()
> (or write sides in general)
> 
> EPIPE is not supposed to be generated at the receiving side ?

I would agree, but then again the behavior is inconsistent between
socket types.  (AF_INET6, SOCK_RAW, ...) works fine with
io_uring/MSG_NOSIGNAL, meanwhile setting MSG_NOSIGNAL on (AF_PACKET,
SOCK_RAW, ...) gives EINVAL.

Just to get consistency, MSG_NOSIGNAL might be worth ignoring in
AF_PACKET recvmsg?  Independent of dropping it from io_uring...

> So I would rather make io_uring slightly faster :
[...]
> -       sr->msg_flags = READ_ONCE(sqe->msg_flags) | MSG_NOSIGNAL;
> +       sr->msg_flags = READ_ONCE(sqe->msg_flags);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ