Milan Landaverde
6a1504dd36
bpf: prevent leak of lsm program after failed attach
...
[ Upstream commit e89f3edffb860a0f54a9ed16deadb7a4a1fa3862 ]
In [0], we added the ability to bpf_prog_attach LSM programs to cgroups,
but in our validation to make sure the prog is meant to be attached to
BPF_LSM_CGROUP, we return too early if the check fails. This results in
lack of decrementing prog's refcnt (through bpf_prog_put)
leaving the LSM program alive past the point of the expected lifecycle.
This fix allows for the decrement to take place.
[0] https://lore.kernel.org/all/20220628174314.1216643-4-sdf@google.com/
Fixes: 69fd337a975c ("bpf: per-cgroup lsm flavor")
Signed-off-by: Milan Landaverde <milan@mdaverde.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20221213175714.31963-1-milan@mdaverde.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:32:54 +01:00
..
2022-12-31 13:32:54 +01:00
2022-12-08 10:40:58 -08:00
2022-09-28 09:02:20 +02:00
2022-09-26 19:46:18 -07:00
2022-10-10 17:53:04 -07:00
2022-10-03 14:03:25 -07:00
2022-12-31 13:31:56 +01:00
2022-12-31 13:31:58 +01:00
2022-11-22 18:50:41 -08:00
2022-12-31 13:31:58 +01:00
2022-10-11 17:42:58 -06:00
2022-10-10 11:36:19 -07:00
2022-10-11 17:42:55 -06:00
2022-12-31 13:32:10 +01:00
2022-12-31 13:31:55 +01:00
2022-09-29 15:20:52 +02:00
2022-10-20 15:34:49 -07:00
2022-12-31 13:31:55 +01:00
2022-10-11 17:42:55 -06:00
2022-12-31 13:32:42 +01:00
2022-09-26 19:46:22 -07:00
2022-02-03 11:20:34 -08:00
2022-08-22 18:50:06 -04:00
2022-04-25 14:37:28 +02:00
2022-09-01 17:39:30 -04:00
2022-08-29 19:47:03 -04:00
2022-09-07 11:30:15 -04:00
2022-01-11 13:08:21 -08:00
2022-10-04 11:05:43 -07:00
2022-09-26 19:46:09 -07:00
2022-03-09 10:32:06 -08:00
2022-09-26 10:13:13 -07:00
2022-07-05 13:33:00 -07:00
2022-07-05 13:32:59 -07:00
2022-12-31 13:31:59 +01:00
2022-08-28 14:02:44 -07:00
2022-03-15 10:32:44 +01:00
2022-09-26 19:46:07 -07:00
2022-10-12 11:00:22 -07:00
2022-07-05 13:32:59 -07:00
2022-09-11 21:55:11 -07:00
2022-12-31 13:31:53 +01:00
2022-09-07 21:53:50 +02:00
2022-09-29 04:40:15 +09:00
2022-07-15 18:21:49 +00:00
2022-09-30 16:50:39 +02:00
2022-04-15 14:49:55 -07:00
2022-06-24 09:48:55 +02:00
2022-07-17 17:31:39 -07:00
2022-10-03 17:11:07 -07:00
2022-03-31 10:36:55 +02:00
2022-10-03 14:03:23 -07:00
2022-09-11 21:55:08 -07:00
2022-09-11 21:55:06 -07:00
2022-09-11 21:55:06 -07:00
2022-09-11 21:55:06 -07:00
2022-12-31 13:32:50 +01:00
2022-09-11 21:55:06 -07:00
2022-10-09 16:01:59 -07:00
2022-09-11 21:55:12 -07:00
2022-10-03 14:03:20 -07:00
2022-05-19 19:30:30 +02:00
2022-09-13 10:38:43 -07:00
2022-12-31 13:32:34 +01:00
2022-09-01 16:55:35 +02:00
2022-04-29 14:38:00 -07:00
2022-06-29 13:07:16 +02:00
2022-09-11 21:55:12 -07:00
2022-09-07 21:53:50 +02:00
2022-10-04 15:59:36 +02:00
2022-12-31 13:32:00 +01:00
2022-07-21 17:19:25 -07:00
2022-11-14 09:58:32 +01:00
2022-04-11 17:07:29 -07:00
2022-03-24 19:06:48 -07:00
2022-05-03 14:11:58 -07:00
2022-10-10 09:10:28 -07:00
2022-10-10 12:49:34 -07:00
2022-09-11 21:55:10 -07:00
2022-07-05 13:32:59 -07:00
2022-05-08 01:33:09 -07:00
2022-02-25 09:36:06 +01:00
2022-04-05 09:59:38 +02:00
2022-04-05 09:59:38 +02:00
2022-05-24 11:11:13 -07:00
2022-08-20 15:17:45 -07:00
2022-10-10 10:41:21 -07:00
2022-09-08 16:56:45 -07:00
2022-12-05 12:09:06 -08:00
2022-09-11 21:55:10 -07:00
2022-08-29 12:47:15 +01:00
2022-02-01 17:24:39 -08:00
2022-09-26 13:01:18 -04:00
2022-04-29 14:38:03 -07:00
2022-05-18 18:24:57 -05:00
2022-09-07 21:53:50 +02:00
2022-10-09 16:24:05 -07:00
2022-05-19 23:25:47 -04:00
2022-10-23 12:01:01 -07:00
2022-08-02 19:24:24 -07:00
2022-06-23 18:41:40 +02:00
2022-08-06 16:38:17 -07:00
2022-10-03 17:11:07 -07:00