]> git.baikalelectronics.ru Git - kernel.git/commit
skbuff: Unconditionally copy pfmemalloc in __skb_clone()
authorStefano Brivio <sbrivio@redhat.com>
Fri, 13 Jul 2018 11:21:07 +0000 (13:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Jul 2018 21:27:39 +0000 (14:27 -0700)
commit73afd53497cca74bf923b80b546b423d9e966589
tree34c8a46c15226408d5d7c2a8023f0d5bdfc0ca3d
parentda881a43831523ff42624cdddf9a46ee8449fbc8
skbuff: Unconditionally copy pfmemalloc in __skb_clone()

Commit b4e489ca89bd ("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: b4e489ca89bd ("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>
net/core/skbuff.c