linux/net/core
Stefano Brivio 76362a5df8 skbuff: Unconditionally copy pfmemalloc in __skb_clone()
commit e78bfb0751 upstream.

Commit 8b7008620b ("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>
[bwh: Backported to 3.16: We didn't set the pfmemalloc flag in either copy
 or clone path until now]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-11-20 18:05:39 +00:00
..
datagram.c Revert "[stable-only] net: add length argument to skb_copy_and_csum_datagram_iovec" 2016-01-25 10:44:07 +00:00
dev.c vlan: Fix reading memory beyond skb->tail in skb_vlan_tagged_multi 2018-10-21 08:45:30 +01:00
dev_addr_lists.c net: fix uninit-value in __hw_addr_add_ex() 2018-10-21 08:45:18 +01:00
dev_ioctl.c net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP 2013-11-19 19:07:21 +00:00
drop_monitor.c drop_monitor: consider inserted data in genlmsg_end 2017-03-16 02:27:22 +00:00
dst.c ipv4: add reference counting to metrics 2017-11-11 13:33:21 +00:00
ethtool.c ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings 2015-10-28 10:33:20 +00:00
fib_rules.c fib_rules: Fix dump_rules() not to exit early 2015-10-19 11:23:19 +01:00
filter.c rose: limit sk_filter trim to payload 2017-02-23 03:54:46 +00:00
flow.c flowcache: Fix kernel panic in flow_cache_flush_task 2015-03-12 15:46:26 +00:00
flow_dissector.c net: Rename skb->rxhash to skb->hash 2014-03-26 15:58:20 -04:00
gen_estimator.c net_sched: add 64bit rate estimators 2013-06-11 02:51:03 -07:00
gen_stats.c gen_stats.c: Duplicate xstats buffer for later use 2015-03-12 16:27:17 +00:00
iovec.c net: sendmsg: fix NULL pointer dereference 2014-07-29 12:20:22 -07:00
link_watch.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
Makefile net: Add a software TSO helper API 2014-05-22 14:57:15 -04:00
neighbour.c net: fix deadlock while clearing neighbor proxy table 2018-10-21 08:45:24 +01:00
net-procfs.c rps: selective flow shedding during softnet overflow 2013-05-20 13:48:04 -07:00
net-sysfs.c net: don't decrement kobj reference count on init failure 2017-11-26 13:50:21 +00:00
net-sysfs.h net: netdev_kobject_init: annotate with __init 2014-01-05 20:27:54 -05:00
net-traces.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
net_namespace.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-05-24 00:32:30 -04:00
netclassid_cgroup.c cgroup: remove css_parent() 2014-05-16 13:22:48 -04:00
netevent.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
netpoll.c netpoll: Use skb_irq_freeable to make zap_completion_queue safe. 2014-04-01 17:53:36 -04:00
netprio_cgroup.c cgroup: remove css_parent() 2014-05-16 13:22:48 -04:00
pktgen.c dst: Increase alignment of metrics to allow extra flag on pointers 2017-11-11 13:33:20 +00:00
ptp_classifier.c net: filter: let unattached filters use sock_fprog_kern 2014-05-23 16:48:05 -04:00
request_sock.c net: remove unnecessary return's 2014-02-13 18:33:38 -05:00
rtnetlink.c rtnetlink: validate attributes in do_setlink() 2018-11-20 18:05:10 +00:00
scm.c unix: correctly track in-flight fds in sending process user_struct 2016-02-25 10:51:00 +00:00
secure_seq.c inetpeer: get rid of ip_id_count 2014-06-02 11:00:41 -07:00
skbuff.c skbuff: Unconditionally copy pfmemalloc in __skb_clone() 2018-11-20 18:05:39 +00:00
sock.c net: Set sk_prot_creator when cloning sockets to the right proto 2018-09-25 23:47:21 +01:00
sock_diag.c net: Move the permission check in sock_diag_put_filterinfo to packet_diag_dump 2014-04-24 13:44:53 -04:00
stream.c net: replace macros net_random and net_srandom with direct calls to prandom 2014-01-14 15:15:25 -08:00
sysctl_net_core.c net:Add sysctl_max_skb_frags 2016-03-24 10:00:44 +00:00
timestamping.c net: ptp: move PTP classifier in its own file 2014-04-01 16:43:18 -04:00
tso.c net: tso: fix unaligned access to crafted TCP header in helper API 2014-11-05 16:39:43 +00:00
user_dma.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
utils.c net: avoid dependency of net_get_random_once on nop patching 2014-05-14 00:37:34 -04:00