mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
skbuff: Unconditionally copy pfmemalloc in __skb_clone()
Commit8b7008620b
("net: Don't copy pfmemalloc flag in __copy_skb_header()") introduced a different handling for the pfmemalloc flag in copy and clone paths. In __skb_clone(), now, the flag is set only if it was set in the original skb, but not cleared if it wasn't. This is wrong and might lead to socket buffers being flagged with pfmemalloc even if the skb data wasn't allocated from pfmemalloc reserves. Copy the flag instead of ORing it. Reported-by: Sabrina Dubroca <sd@queasysnail.net> Fixes:8b7008620b
("net: Don't copy pfmemalloc flag in __copy_skb_header()") Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Tested-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8f19f12bdc
commit
e78bfb0751
@ -858,8 +858,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
|
||||
n->cloned = 1;
|
||||
n->nohdr = 0;
|
||||
n->peeked = 0;
|
||||
if (skb->pfmemalloc)
|
||||
n->pfmemalloc = 1;
|
||||
C(pfmemalloc);
|
||||
n->destructor = NULL;
|
||||
C(tail);
|
||||
C(end);
|
||||
|
Loading…
Reference in New Issue
Block a user