netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Vinicius Costa Gomes <vinicius.gomes@intel.com>, netdev@vger.kernel.org
Cc: randy.e.witt@intel.com, davem@davemloft.net
Subject: Re: [PATCH net-next 2/2] skbuff: Fix not waking applications when errors are enqueued
Date: Wed, 14 Mar 2018 09:40:16 -0700	[thread overview]
Message-ID: <bfe9c6a5-4d9d-c37e-a80c-c708fc45626f@gmail.com> (raw)
In-Reply-To: <20180313203519.8638-3-vinicius.gomes@intel.com>



On 03/13/2018 01:35 PM, Vinicius Costa Gomes wrote:
> When errors are enqueued to the error queue via sock_queue_err_skb()
> function, it is possible that the waiting application is not notified.
> 
> Calling 'sk->sk_data_ready()' would not notify applications that
> selected only POLLERR events in poll() (for example).
> 
> Reported-by: Randy E. Witt <randy.e.witt@intel.com>
> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> ---
>   net/core/skbuff.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 715c13495ba6..6def3534f509 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -4181,7 +4181,7 @@ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
>   
>   	skb_queue_tail(&sk->sk_error_queue, skb);
>   	if (!sock_flag(sk, SOCK_DEAD))
> -		sk->sk_data_ready(sk);
> +		sk->sk_error_report(sk);
>   	return 0;
>   }
>   EXPORT_SYMBOL(sock_queue_err_skb);
> 

Reviewed-by: Eric Dumazet <edumazet@google.com>

Given this bug has been there forever, there is probably no rush to get 
the fix in 4.16, but this looks safe enough IMO.

  reply	other threads:[~2018-03-14 16:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 20:35 [PATCH net-next 0/2] skbuff: Fix applications not being woken for errors Vinicius Costa Gomes
2018-03-13 20:35 ` [PATCH net-next 1/2] selftests/txtimestamp: Add more configurable parameters Vinicius Costa Gomes
2018-03-13 20:35 ` [PATCH net-next 2/2] skbuff: Fix not waking applications when errors are enqueued Vinicius Costa Gomes
2018-03-14 16:40   ` Eric Dumazet [this message]
2018-03-14 16:32 ` [PATCH net-next 0/2] skbuff: Fix applications not being woken for errors Willem de Bruijn
2018-03-14 17:39   ` Soheil Hassas Yeganeh
2018-03-14 19:37   ` Vinicius Costa Gomes

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=bfe9c6a5-4d9d-c37e-a80c-c708fc45626f@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=randy.e.witt@intel.com \
    --cc=vinicius.gomes@intel.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;
as well as URLs for NNTP newsgroup(s).