Roman Gushchin
5689666aa1
bpf: allocate local storage buffers using GFP_ATOMIC
[ Upstream commit 569a933b03f3c48b392fe67c0086b3a6b9306b5a ]
Naresh reported an issue with the non-atomic memory allocation of
cgroup local storage buffers:
[ 73.047526] BUG: sleeping function called from invalid context at
/srv/oe/build/tmp-rpb-glibc/work-shared/intel-corei7-64/kernel-source/mm/slab.h:421
[ 73.060915] in_atomic(): 1, irqs_disabled(): 0, pid: 3157, name: test_cgroup_sto
[ 73.068342] INFO: lockdep is turned off.
[ 73.072293] CPU: 2 PID: 3157 Comm: test_cgroup_sto Not tainted
4.20.0-rc2-next-20181113 #1
[ 73.080548] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS
2.0b 07/27/2017
[ 73.088018] Call Trace:
[ 73.090463] dump_stack+0x70/0xa5
[ 73.093783] ___might_sleep+0x152/0x240
[ 73.097619] __might_sleep+0x4a/0x80
[ 73.101191] __kmalloc_node+0x1cf/0x2f0
[ 73.105031] ? cgroup_storage_update_elem+0x46/0x90
[ 73.109909] cgroup_storage_update_elem+0x46/0x90
cgroup_storage_update_elem() (as well as other update map update
callbacks) is called with disabled preemption, so GFP_ATOMIC
allocation should be used: e.g. alloc_htab_elem() in hashtab.c.
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-17 09:24:33 +01:00
..
2018-12-17 09:24:33 +01:00
2018-10-04 13:28:08 -07:00
2018-06-15 07:15:28 +09:00
2018-12-01 09:37:33 +01:00
2018-11-13 11:08:17 -08:00
2018-12-08 12:59:06 +01:00
2018-06-08 18:56:02 +09:00
2018-11-13 11:08:48 -08:00
2018-08-20 18:33:50 +02:00
2018-11-13 11:08:20 -08:00
2018-10-12 12:35:02 +02:00
2018-11-13 11:08:48 -08:00
2018-12-01 09:37:34 +01:00
2018-12-05 19:32:02 +01:00
2018-09-06 23:38:35 +02:00
2018-12-08 12:59:07 +01:00
2018-08-17 09:41:28 -07:00
2018-07-18 11:43:36 -04:00
2018-07-17 14:45:08 -04:00
2018-06-19 10:39:54 -04:00
2018-08-15 10:46:54 -07:00
2018-11-13 11:08:47 -08:00
2018-06-24 14:39:47 +02:00
2018-12-05 19:32:02 +01:00
2018-08-22 10:52:47 -07:00
2018-07-21 12:57:35 -05:00
2018-06-21 12:33:19 +02:00
2018-09-04 16:45:02 -07:00
2018-08-06 12:35:20 +02:00
2018-08-20 18:23:00 +02:00
2018-08-22 10:52:47 -07:00
2018-09-10 10:15:48 +02:00
2018-08-14 19:12:29 -03:00
2018-08-02 08:06:54 +09:00
2018-06-15 07:55:24 +09:00
2018-06-15 07:55:24 +09:00
2018-06-12 16:19:22 -07:00
2018-07-16 12:31:57 -07:00
2018-11-13 11:08:28 -08:00
2018-08-13 11:25:07 -07:00
2018-07-18 01:18:05 +09:00
2018-08-25 18:43:59 -07:00
2018-07-02 11:36:17 +02:00
2018-07-02 11:36:17 +02:00
2018-08-22 10:52:47 -07:00
2018-06-14 12:21:18 +09:00
2018-09-20 22:01:11 +02:00
2018-12-05 19:32:03 +01:00
2018-08-06 12:35:20 +02:00
2018-06-15 07:55:24 +09:00
2018-06-08 17:21:52 -07:00
2018-07-10 22:18:52 +02:00
2018-06-06 16:34:00 -07:00
2018-11-13 11:08:45 -08:00
2018-08-07 12:25:30 +02:00
2018-07-03 09:20:44 +02:00
2018-08-03 15:52:10 +02:00
2018-08-13 11:25:07 -07:00
2018-06-10 10:17:09 -07:00
2018-09-20 22:01:11 +02:00
2018-08-23 18:48:43 -07:00
2018-06-21 12:33:05 +02:00
2018-06-25 11:30:10 -07:00
2018-10-17 15:35:29 -04:00
2018-06-07 16:56:28 -04:00
2018-11-13 11:09:00 -08:00
2018-08-22 10:52:47 -07:00
2018-08-11 02:05:53 -05:00
2018-08-30 12:56:40 +02:00
2018-08-30 12:56:40 +02:00
2018-08-30 12:56:40 +02:00