Song Liu
bc235cdb42
bpf: Prevent deadlock from recursive bpf_task_storage_[get|delete]
...
BPF helpers bpf_task_storage_[get|delete] could hold two locks:
bpf_local_storage_map_bucket->lock and bpf_local_storage->lock. Calling
these helpers from fentry/fexit programs on functions in bpf_*_storage.c
may cause deadlock on either locks.
Prevent such deadlock with a per cpu counter, bpf_task_storage_busy. We
need this counter to be global, because the two locks here belong to two
different objects: bpf_local_storage_map and bpf_local_storage. If we
pick one of them as the owner of the counter, it is still possible to
trigger deadlock on the other lock. For example, if bpf_local_storage_map
owns the counters, it cannot prevent deadlock on bpf_local_storage->lock
when two maps are used.
Signed-off-by: Song Liu <songliubraving@fb.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Acked-by: Martin KaFai Lau <kafai@fb.com >
Link: https://lore.kernel.org/bpf/20210225234319.336131-3-songliubraving@fb.com
2021-02-26 11:51:48 -08:00
..
2021-02-26 11:51:48 -08:00
2021-01-19 11:37:05 -05:00
2021-01-06 17:39:38 +01:00
2020-11-24 16:47:49 +01:00
2021-02-05 12:48:46 +01:00
2021-02-17 14:12:43 +01:00
2021-02-21 12:49:32 -08:00
2021-02-05 11:03:47 -08:00
2021-02-21 11:53:06 -08:00
2021-01-04 14:39:07 -08:00
2020-11-13 12:15:28 -05:00
2021-02-21 12:35:04 -08:00
2021-02-15 18:50:01 +01:00
2021-01-25 14:29:35 +01:00
2021-02-21 12:35:04 -08:00
2021-02-21 12:35:04 -08:00
2021-02-21 12:04:41 -08:00
2021-02-26 11:51:47 -08:00
2020-03-25 11:50:48 +01:00
2020-12-15 22:46:15 -08:00
2020-07-16 12:35:15 -07:00
2020-12-03 14:58:35 +01:00
2020-12-03 14:58:35 +01:00
2020-12-03 14:58:35 +01:00
2020-12-02 22:52:16 -05:00
2020-08-17 20:26:58 -04:00
2020-08-23 17:36:59 -05:00
2020-12-16 10:54:03 -08:00
2020-07-30 11:15:58 -07:00
2020-10-13 09:17:34 -07:00
2020-08-23 17:36:59 -05:00
2020-02-04 03:05:26 +00:00
2020-06-11 15:14:36 +02:00
2020-09-01 09:58:03 +02:00
2021-01-06 16:24:59 -08:00
2020-12-15 22:46:18 -08:00
2020-04-15 11:21:54 +02:00
2020-05-20 14:44:21 -05:00
2020-12-30 19:36:54 -07:00
2020-04-07 10:43:42 -07:00
2020-12-15 22:46:19 -08:00
2021-02-26 11:51:47 -08:00
2021-02-12 12:54:58 +01:00
2020-06-06 23:42:01 +09:00
2020-10-13 09:17:34 -07:00
2020-11-02 12:14:19 -08:00
2020-11-24 16:47:49 +01:00
2020-12-18 16:53:12 +01:00
2020-10-25 14:51:49 -07:00
2020-12-15 19:36:48 -08:00
2019-12-08 14:37:36 +01:00
2021-02-17 14:12:24 +01:00
2020-11-02 18:00:20 -08:00
2021-02-21 09:29:23 -08:00
2020-11-20 14:45:33 +11:00
2020-01-08 16:32:55 +00:00
2020-10-05 13:37:03 +02:00
2020-08-12 10:58:01 -07:00
2021-01-29 17:29:16 -05:00
2021-01-24 10:09:20 -08:00
2020-04-27 02:07:40 -04:00
2020-12-15 22:46:19 -08:00
2020-12-17 13:01:31 -08:00
2020-09-01 09:58:03 +02:00
2020-12-14 16:40:27 -08:00
2020-09-04 17:51:55 +10:00
2020-11-14 11:26:04 -08:00
2020-12-17 13:01:31 -08:00
2020-12-14 16:40:27 -08:00
2020-12-15 19:36:48 -08:00
2020-02-04 03:05:26 +00:00
2020-12-15 12:53:37 -08:00
2020-10-16 11:11:19 -07:00
2020-12-15 22:46:19 -08:00
2020-07-27 14:31:12 -04:00
2020-12-15 22:46:18 -08:00
2020-11-25 18:52:35 +01:00
2020-12-15 22:46:18 -08:00
2019-12-25 10:41:20 +01:00
2021-01-04 13:53:41 -08:00
2020-12-01 10:30:28 +00:00
2020-12-16 11:30:10 -08:00
2021-01-24 09:35:28 -08:00
2021-02-17 14:12:42 +01:00
2021-01-22 15:09:42 +01:00
2020-12-27 09:06:10 -08:00
2020-09-19 13:13:39 -07:00
2020-09-18 14:24:16 +01:00
2021-02-17 14:12:42 +01:00
2020-11-27 11:10:50 +01:00
2020-12-19 11:18:38 -08:00
2021-01-29 10:06:46 +05:30
2020-01-09 16:42:29 -07:00
2020-11-19 19:37:16 -08:00
2020-12-12 09:17:38 -07:00
2020-11-16 08:08:54 -08:00
2021-01-06 17:17:22 -08:00
2020-11-16 21:53:15 +01:00
2019-12-18 18:07:31 +01:00
2020-04-07 21:51:27 +02:00
2020-10-06 10:31:52 -07:00
2020-02-07 15:34:12 +01:00
2020-12-14 16:40:27 -08:00
2020-08-19 14:14:12 +02:00
2020-07-07 11:58:59 -05:00
2020-04-27 02:07:40 -04:00
2020-08-19 14:13:20 +02:00
2020-08-17 09:39:18 -07:00
2020-11-14 11:26:03 -08:00
2021-01-22 15:09:43 +01:00