mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
net: add a truesize parameter to skb_add_rx_frag()
skb_add_rx_frag() API is misleading. Network skbs built with this helper can use uncharged kernel memory and eventually stress/crash machine in OOM. Add a 'truesize' parameter and then fix drivers in followup patches. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0015e551ed
commit
50269e19ad
7 changed files with 13 additions and 9 deletions
|
|
@ -1244,7 +1244,7 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i,
|
|||
}
|
||||
|
||||
extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
|
||||
int off, int size);
|
||||
int off, int size, unsigned int truesize);
|
||||
|
||||
#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
|
||||
#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb))
|
||||
|
|
|
|||
Loading…
Reference in a new issue