1
0
Fork 0
remarkable-linux/net/ieee802154
Eric Dumazet 990204ddc5 inet: frags: break the 2GB limit for frags storage
Some users are willing to provision huge amounts of memory to be able
to perform reassembly reasonnably well under pressure.

Current memory tracking is using one atomic_t and integers.

Switch to atomic_long_t so that 64bit arches can use more than 2GB,
without any cost for 32bit arches.

Note that this patch avoids an overflow error, if high_thresh was set
to ~2GB, since this test in inet_frag_alloc() was never true :

if (... || frag_mem_limit(nf) > nf->high_thresh)

Tested:

$ echo 16000000000 >/proc/sys/net/ipv4/ipfrag_high_thresh

<frag DDOS>

$ grep FRAG /proc/net/sockstat
FRAG: inuse 14705885 memory 16000002880

$ nstat -n ; sleep 1 ; nstat | grep Reas
IpReasmReqds                    3317150            0.0
IpReasmFails                    3317112            0.0

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3e67f106f6)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-19 22:43:46 +02:00
..
6lowpan inet: frags: break the 2GB limit for frags storage 2018-09-19 22:43:46 +02:00
Kconfig nl802154: add support for security layer 2015-09-30 13:16:44 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
core.c ieee802154: add netns support 2016-07-08 12:20:57 +02:00
core.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
header_ops.c ieee802154: change needed headroom/tailroom 2015-09-22 11:51:20 +02:00
ieee802154.h ieee802154: add nl802154 framework 2014-11-09 19:50:29 +01:00
netlink.c genetlink: mark families as __ro_after_init 2016-10-27 16:16:09 -04:00
nl-mac.c ieee802154: use nla_put_u64_64bit() 2016-04-25 15:09:11 -04:00
nl-phy.c ieee802154: check device type 2016-11-30 12:33:07 +01:00
nl802154.c netlink: pass extended ACK struct where available 2017-04-13 13:58:22 -04:00
nl802154.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nl_policy.c ieee802154: mac802154: remove FSF address 2014-10-25 08:07:30 +02:00
rdev-ops.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
socket.c net: ieee802154: fix net_device reference release too early 2017-05-23 20:05:15 +02:00
sysfs.c cfg802154: add PM hooks 2015-07-23 17:10:49 +02:00
sysfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.c ieee802154: Add trace events for rdev->ops 2015-04-30 18:48:09 +02:00
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00