From: Eric Dumazet <eric.dumazet@gmail.com>
To: frank.blaschka@de.ibm.com
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-s390@vger.kernel.org,
Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Subject: Re: [patch 1/2] af_iucv: recvmsg: use correct skb_pull() function
Date: Tue, 02 Apr 2013 08:37:19 -0700 [thread overview]
Message-ID: <1364917039.5113.170.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130402105707.116460653@de.ibm.com>
On Tue, 2013-04-02 at 12:56 +0200, frank.blaschka@de.ibm.com wrote:
> plain text document attachment (601-af-iucv-skb-pull.diff)
> From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
>
> When receiving data messages, the "BUG_ON(skb->len < skb->data_len)" in
> the skb_pull() function triggers a kernel panic.
>
> Check if the skb uses paged data (is non-linear) and use the pskb_pull()
> function. Use skb_pull() for linear skbs' only.
>
> Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com>
> Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
> ---
> net/iucv/af_iucv.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> --- a/net/iucv/af_iucv.c
> +++ b/net/iucv/af_iucv.c
> @@ -1382,7 +1382,10 @@ static int iucv_sock_recvmsg(struct kioc
>
> /* SOCK_STREAM: re-queue skb if it contains unreceived data */
> if (sk->sk_type == SOCK_STREAM) {
> - skb_pull(skb, copied);
> + if (skb_is_nonlinear(skb))
> + pskb_pull(skb, copied);
> + else
> + skb_pull(skb, copied);
> if (skb->len) {
> skb_queue_head(&sk->sk_receive_queue, skb);
> goto done;
That cant be right. You can not ignore pskb_pull() return value.
Its also not very efficient.
I would advise using a per skb offset, to avoid skb_pull()
next prev parent reply other threads:[~2013-04-02 15:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-02 10:56 [patch 0/2] s390: network bug fixes for net frank.blaschka
2013-04-02 10:56 ` [patch 1/2] af_iucv: recvmsg: use correct skb_pull() function frank.blaschka
2013-04-02 15:37 ` Eric Dumazet [this message]
2013-04-02 10:56 ` [patch 2/2] qeth: fix qeth_wait_for_threads() deadlock for OSN devices frank.blaschka
2013-04-02 16:13 ` Eric Dumazet
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=1364917039.5113.170.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=brueckner@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=frank.blaschka@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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