Re: [PATCH] net: handle the return value of pskb_carve_frag_list() correctly

2020-08-18 Thread David Miller
From: Miaohe Lin Date: Sat, 15 Aug 2020 04:46:41 -0400 > pskb_carve_frag_list() may return -ENOMEM in pskb_carve_inside_nonlinear(). > we should handle this correctly or we would get wrong sk_buff. > > Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function") > Signed-off-by: Miaohe

Re: [PATCH] net: handle the return value of pskb_carve_frag_list() correctly

2020-08-17 Thread linmiaohe
David Miller wrote: >> David Miller wrote: + /* split line is in frag list */ + if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) { + /* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. */ + if (skb_has_frag_list(skb))

Re: [PATCH] net: handle the return value of pskb_carve_frag_list() correctly

2020-08-16 Thread David Miller
From: linmiaohe Date: Mon, 17 Aug 2020 02:27:23 + > David Miller wrote: >>> + /* split line is in frag list */ >>> + if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) { >>> + /* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. >>> */ >>> +

Re: [PATCH] net: handle the return value of pskb_carve_frag_list() correctly

2020-08-16 Thread linmiaohe
David Miller wrote: >> +/* split line is in frag list */ >> +if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) { >> +/* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. >> */ >> +if (skb_has_frag_list(skb)) >> +

Re: [PATCH] net: handle the return value of pskb_carve_frag_list() correctly

2020-08-16 Thread David Miller
From: Miaohe Lin Date: Sat, 15 Aug 2020 04:46:41 -0400 > + /* split line is in frag list */ > + if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) { > + /* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. > */ > + if

[PATCH] net: handle the return value of pskb_carve_frag_list() correctly

2020-08-15 Thread Miaohe Lin
pskb_carve_frag_list() may return -ENOMEM in pskb_carve_inside_nonlinear(). we should handle this correctly or we would get wrong sk_buff. Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function") Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 10 +++--- 1 file changed, 7