[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb446581-6eaf-3b61-1e5d-07d629c77831@gmail.com>
Date: Mon, 14 Mar 2022 10:42:39 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Kuniyuki Iwashima <kuniyu@...zon.co.jp>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Rao Shoaib <Rao.Shoaib@...cle.com>
Cc: Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net] af_unix: Support POLLPRI for OOB.
On 3/13/22 22:21, Kuniyuki Iwashima wrote:
> The commit 314001f0bf92 ("af_unix: Add OOB support") introduced OOB for
> AF_UNIX, but it lacks some changes for POLLPRI. Let's add the missing
> piece.
>
> In the selftest, normal datagrams are sent followed by OOB data, so this
> commit replaces `POLLIN | POLLPRI` with just `POLLPRI` in the first test
> case.
>
> Fixes: 314001f0bf92 ("af_unix: Add OOB support")
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.co.jp>
> ---
> net/unix/af_unix.c | 2 ++
> tools/testing/selftests/net/af_unix/test_unix_oob.c | 6 +++---
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index c19569819866..711d21b1c3e1 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -3139,6 +3139,8 @@ static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wa
> mask |= EPOLLIN | EPOLLRDNORM;
> if (sk_is_readable(sk))
> mask |= EPOLLIN | EPOLLRDNORM;
> + if (unix_sk(sk)->oob_skb)
> + mask |= EPOLLPRI;
This adds another data-race, maybe add something to avoid another syzbot
report ?
>
> /* Connection-based need to check for termination and startup */
> if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) &&
> diff --git a/tools/testing/selftests/net/af_unix/test_unix_oob.c b/tools/testing/selftests/net/af_unix/test_unix_oob.c
> index 3dece8b29253..b57e91e1c3f2 100644
> --- a/tools/testing/selftests/net/af_unix/test_unix_oob.c
> +++ b/tools/testing/selftests/net/af_unix/test_unix_oob.c
> @@ -218,10 +218,10 @@ main(int argc, char **argv)
>
> /* Test 1:
> * veriyf that SIGURG is
> - * delivered and 63 bytes are
> - * read and oob is '@'
> + * delivered, 63 bytes are
> + * read, oob is '@', and POLLPRI works.
> */
> - wait_for_data(pfd, POLLIN | POLLPRI);
> + wait_for_data(pfd, POLLPRI);
> read_oob(pfd, &oob);
> len = read_data(pfd, buf, 1024);
> if (!signal_recvd || len != 63 || oob != '@') {
Powered by blists - more mailing lists