2019-06-01 10:08:55 +02:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-02 17:54:15 +01:00
|
|
|
|
2017-02-04 01:27:20 +01:00
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-11 01:04:48 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:15 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
2023-08-09 00:26:36 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:12:43 -07:00
|
|
|
|
2019-12-17 15:40:41 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2025-04-01 15:51:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2023-11-27 20:59:04 +03:00
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
2023-11-27 20:59:04 +03:00
|
|
|
|
|
|
|
|
|
2024-11-07 12:25:27 +01:00
|
|
|
|
2025-08-01 02:21:44 -07:00
|
|
|
|
2025-04-01 15:51:41 -07:00
|
|
|
|
2023-11-27 20:59:04 +03:00
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-23 09:11:24 +08:00
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-13 09:09:43 +01:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-13 09:09:43 +01:00
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2026-01-13 09:09:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-05-25 06:23:42 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2026-03-01 12:29:06 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:15 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:15 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-03 22:07:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 17:24:48 +03:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
|
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
|
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-03 22:07:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-01 20:36:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
|
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-25 11:59:30 +08:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-07-10 21:11:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:11:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
|
|
|
|
|
2022-09-23 16:36:10 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:14 -08:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2023-08-21 15:37:24 -03:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
|
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2026-02-24 10:20:02 -08:00
|
|
|
|
2020-06-07 04:10:33 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2013-02-18 16:11:34 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-25 09:13:49 +08:00
|
|
|
|
2017-01-16 00:42:35 -08:00
|
|
|
|
2013-02-18 16:11:34 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2013-02-18 16:11:34 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
2013-02-18 16:11:34 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:35 -08:00
|
|
|
|
2013-07-10 21:07:43 -07:00
|
|
|
|
2017-07-31 17:36:45 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
|
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
2025-08-01 20:36:06 -07:00
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-18 16:11:34 -08:00
|
|
|
|
2023-08-21 16:54:58 -07:00
|
|
|
|
2013-02-18 16:11:34 -08:00
|
|
|
|
|
|
|
|
|
2013-07-10 21:07:43 -07:00
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2013-07-10 21:07:43 -07:00
|
|
|
|
|
|
|
|
|
2013-02-18 16:11:34 -08:00
|
|
|
|
|
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-27 10:31:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
2023-10-27 10:31:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
2023-10-27 10:31:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-02 13:50:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2015-12-16 18:09:10 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 06:06:26 -07:00
|
|
|
|
2025-01-24 00:51:00 +05:30
|
|
|
|
2022-10-03 06:06:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-02 12:45:12 -08:00
|
|
|
|
2022-10-03 06:06:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-17 15:37:58 +08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2012-05-16 11:00:05 -07:00
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
2013-07-10 21:08:43 -07:00
|
|
|
|
2012-05-16 11:00:05 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-01-16 00:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-01-16 00:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-01-16 00:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 02:48:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-21 11:01:56 -07:00
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
|
|
|
|
|
2023-10-27 10:31:06 -07:00
|
|
|
|
2022-10-03 02:48:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-27 10:31:06 -07:00
|
|
|
|
|
|
|
|
|
2022-10-03 02:48:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
2022-10-03 02:48:24 -07:00
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 02:48:24 -07:00
|
|
|
|
|
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
2017-08-16 05:40:49 -07:00
|
|
|
|
|
|
|
|
|
2017-11-15 15:25:30 -08:00
|
|
|
|
2025-11-22 12:54:46 +01:00
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-22 12:54:46 +01:00
|
|
|
|
|
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
2025-11-22 12:54:46 +01:00
|
|
|
|
|
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-22 12:54:46 +01:00
|
|
|
|
|
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
2025-11-22 12:54:46 +01:00
|
|
|
|
|
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-16 05:40:49 -07:00
|
|
|
|
|
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 02:48:24 -07:00
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-20 23:24:09 -08:00
|
|
|
|
2017-08-16 05:40:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-15 15:25:30 -08:00
|
|
|
|
2017-08-16 08:59:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2019-04-16 15:42:18 +01:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:54 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-14 00:20:12 -07:00
|
|
|
|
2017-01-16 00:42:54 -08:00
|
|
|
|
2022-09-14 00:20:12 -07:00
|
|
|
|
2017-01-16 00:42:54 -08:00
|
|
|
|
2022-09-14 00:20:12 -07:00
|
|
|
|
2017-01-16 00:42:54 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2022-09-19 00:46:09 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 00:46:09 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-01-16 00:42:54 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2022-09-14 00:20:12 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2022-09-14 00:20:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 00:46:09 -07:00
|
|
|
|
2017-01-16 00:43:02 -08:00
|
|
|
|
2022-09-14 00:20:12 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2020-07-01 02:18:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
|
|
|
|
|
2020-07-01 02:18:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
2020-07-01 02:18:18 -07:00
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
2020-07-01 02:18:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
2020-06-30 17:00:11 -07:00
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
2023-06-25 09:13:49 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
|
|
|
|
|
2016-06-22 18:01:08 -07:00
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
2020-06-30 17:00:11 -07:00
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
|
|
|
|
|
2016-06-22 18:01:08 -07:00
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
|
|
|
|
|
2016-06-22 18:01:08 -07:00
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-22 18:01:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
|
|
|
|
|
2016-06-22 18:01:08 -07:00
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:51 -08:00
|
|
|
|
2022-09-23 16:36:10 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:51 -08:00
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
2020-06-30 17:00:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-18 23:06:41 +01:00
|
|
|
|
2020-06-30 17:00:11 -07:00
|
|
|
|
2025-03-18 23:06:41 +01:00
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
2025-03-18 23:06:41 +01:00
|
|
|
|
2020-06-30 17:00:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-18 23:06:41 +01:00
|
|
|
|
2020-06-30 17:00:11 -07:00
|
|
|
|
2025-03-18 23:06:41 +01:00
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
2025-03-18 23:06:41 +01:00
|
|
|
|
2020-06-30 17:00:11 -07:00
|
|
|
|
|
|
|
|
|
2016-06-22 18:01:08 -07:00
|
|
|
|
|
|
|
|
|
apparmor: fix unprivileged local user can do privileged policy management
An unprivileged local user can load, replace, and remove profiles by
opening the apparmorfs interfaces, via a confused deputy attack, by
passing the opened fd to a privileged process, and getting the
privileged process to write to the interface.
This does require a privileged target that can be manipulated to do
the write for the unprivileged process, but once such access is
achieved full policy management is possible and all the possible
implications that implies: removing confinement, DoS of system or
target applications by denying all execution, by-passing the
unprivileged user namespace restriction, to exploiting kernel bugs for
a local privilege escalation.
The policy management interface can not have its permissions simply
changed from 0666 to 0600 because non-root processes need to be able
to load policy to different policy namespaces.
Instead ensure the task writing the interface has privileges that
are a subset of the task that opened the interface. This is already
done via policy for confined processes, but unconfined can delegate
access to the opened fd, by-passing the usual policy check.
Fixes: b7fd2c0340eac ("apparmor: add per policy ns .load, .replace, .remove interface files")
Reported-by: Qualys Security Advisory <qsa@qualys.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-11-07 08:36:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2023-10-23 09:11:24 +08:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2023-06-25 09:13:49 +08:00
|
|
|
|
apparmor: fix unprivileged local user can do privileged policy management
An unprivileged local user can load, replace, and remove profiles by
opening the apparmorfs interfaces, via a confused deputy attack, by
passing the opened fd to a privileged process, and getting the
privileged process to write to the interface.
This does require a privileged target that can be manipulated to do
the write for the unprivileged process, but once such access is
achieved full policy management is possible and all the possible
implications that implies: removing confinement, DoS of system or
target applications by denying all execution, by-passing the
unprivileged user namespace restriction, to exploiting kernel bugs for
a local privilege escalation.
The policy management interface can not have its permissions simply
changed from 0666 to 0600 because non-root processes need to be able
to load policy to different policy namespaces.
Instead ensure the task writing the interface has privileges that
are a subset of the task that opened the interface. This is already
done via policy for confined processes, but unconfined can delegate
access to the opened fd, by-passing the usual policy check.
Fixes: b7fd2c0340eac ("apparmor: add per policy ns .load, .replace, .remove interface files")
Reported-by: Qualys Security Advisory <qsa@qualys.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-11-07 08:36:04 -08:00
|
|
|
|
2023-01-02 12:45:12 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:52 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
apparmor: fix unprivileged local user can do privileged policy management
An unprivileged local user can load, replace, and remove profiles by
opening the apparmorfs interfaces, via a confused deputy attack, by
passing the opened fd to a privileged process, and getting the
privileged process to write to the interface.
This does require a privileged target that can be manipulated to do
the write for the unprivileged process, but once such access is
achieved full policy management is possible and all the possible
implications that implies: removing confinement, DoS of system or
target applications by denying all execution, by-passing the
unprivileged user namespace restriction, to exploiting kernel bugs for
a local privilege escalation.
The policy management interface can not have its permissions simply
changed from 0666 to 0600 because non-root processes need to be able
to load policy to different policy namespaces.
Instead ensure the task writing the interface has privileges that
are a subset of the task that opened the interface. This is already
done via policy for confined processes, but unconfined can delegate
access to the opened fd, by-passing the usual policy check.
Fixes: b7fd2c0340eac ("apparmor: add per policy ns .load, .replace, .remove interface files")
Reported-by: Qualys Security Advisory <qsa@qualys.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-11-07 08:36:04 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:52 -08:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
apparmor: fix unprivileged local user can do privileged policy management
An unprivileged local user can load, replace, and remove profiles by
opening the apparmorfs interfaces, via a confused deputy attack, by
passing the opened fd to a privileged process, and getting the
privileged process to write to the interface.
This does require a privileged target that can be manipulated to do
the write for the unprivileged process, but once such access is
achieved full policy management is possible and all the possible
implications that implies: removing confinement, DoS of system or
target applications by denying all execution, by-passing the
unprivileged user namespace restriction, to exploiting kernel bugs for
a local privilege escalation.
The policy management interface can not have its permissions simply
changed from 0666 to 0600 because non-root processes need to be able
to load policy to different policy namespaces.
Instead ensure the task writing the interface has privileges that
are a subset of the task that opened the interface. This is already
done via policy for confined processes, but unconfined can delegate
access to the opened fd, by-passing the usual policy check.
Fixes: b7fd2c0340eac ("apparmor: add per policy ns .load, .replace, .remove interface files")
Reported-by: Qualys Security Advisory <qsa@qualys.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-11-07 08:36:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:52 -08:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:29 -08:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2017-05-25 06:23:42 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-25 09:13:49 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 07:09:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-06-09 07:09:05 -07:00
|
|
|
|
|
|
|
|
|
2017-06-09 07:16:46 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-06-04 12:22:22 -07:00
|
|
|
|
2017-01-16 00:42:57 -08:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
2017-01-16 00:42:55 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-01-27 04:36:47 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2019-03-09 16:58:10 -08:00
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
2026-02-24 10:20:02 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:55 -08:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
2025-01-24 00:51:00 +05:30
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-10 06:22:17 -07:00
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-06-04 12:22:22 -07:00
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
2017-04-06 06:55:22 -07:00
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-06 06:55:22 -07:00
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-11-20 23:24:09 -08:00
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
2021-02-01 03:43:18 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
apparmor: fix use-after-free in rawdata dedup loop
aa_replace_profiles() walks ns->rawdata_list to dedup the incoming
policy blob against entries already attached to existing profiles.
Per the kernel-doc on struct aa_loaddata, list membership does not
hold a reference: profiles hold pcount, and when the last pcount
drops, do_ploaddata_rmfs() is queued on a workqueue that takes
ns->lock and removes the entry. Between dropping the last pcount
and the workqueue running, an entry remains on the list with
pcount == 0.
aa_get_profile_loaddata() is an unconditional kref_get() on
pcount, so when the dedup loop hits such an entry, refcount
hardening reports
refcount_t: addition on 0; use-after-free.
inside aa_replace_profiles(), and the poisoned counter then
trips "saturated" and "underflow" warnings on the subsequent
uses of the same loaddata.
Before commit a0b7091c4de4 ("apparmor: fix race on rawdata
dereference") the dedup path used a get_unless_zero-style helper
on a single counter, so the existing "if (tmp)" guard was
meaningful. The split-refcount refactor introduced
aa_get_profile_loaddata(), which has plain kref_get() semantics,
and the guard quietly became a no-op.
Introduce aa_get_profile_loaddata_not0(), matching the existing
_not0 convention used by aa_get_profile_not0(), and use it for
the rawdata_list dedup lookup so dying entries are skipped.
Reproduced on x86_64 with v7.1-rc5 in QEMU+KVM running Ubuntu
24.04 + stress-ng 0.17.06:
stress-ng --apparmor 1 --klog-check --timeout 60s
Without this patch the three refcount_t warnings fire within a
few seconds. With it the same 60 s run is clean. Coverage is a
smoke-test only; a longer soak with CONFIG_KASAN, CONFIG_KCSAN
and CONFIG_PROVE_LOCKING would be welcome from anyone with the
cycles.
Fixes: a0b7091c4de4 ("apparmor: fix race on rawdata dereference")
Reported-by: Colin Ian King <colin.i.king@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221513
Cc: stable@vger.kernel.org
Signed-off-by: Ruslan Valiyev <linuxoid@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2026-05-26 00:04:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-01 03:43:18 -08:00
|
|
|
|
2026-02-24 10:20:02 -08:00
|
|
|
|
2021-02-01 03:43:18 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 06:06:26 -07:00
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
2021-02-01 03:43:18 -08:00
|
|
|
|
2026-02-24 10:20:02 -08:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
|
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 06:06:26 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
2022-10-03 06:06:26 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
2022-10-03 06:06:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2022-10-03 06:06:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
2021-02-01 03:43:18 -08:00
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
2017-06-09 07:24:18 -07:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-25 06:23:42 -07:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 07:24:18 -07:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
2021-02-01 03:43:18 -08:00
|
|
|
|
|
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2021-02-01 03:43:18 -08:00
|
|
|
|
|
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
|
|
|
|
|
2018-04-13 22:33:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-29 15:39:42 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
2017-06-09 07:09:05 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2026-01-29 15:39:42 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
2017-06-09 07:16:46 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2026-06-14 16:16:59 -07:00
|
|
|
|
|
|
|
|
|
2026-02-18 10:27:34 +01:00
|
|
|
|
|
|
|
|
|
2026-02-24 10:20:02 -08:00
|
|
|
|
2019-03-09 16:58:10 -08:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2026-02-18 10:27:34 +01:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
2016-04-16 14:16:50 -07:00
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
2017-01-16 00:42:56 -08:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2016-04-16 14:16:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-06 06:55:22 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2016-04-16 14:16:50 -07:00
|
|
|
|
2013-07-10 21:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-04 12:22:22 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-12 12:34:34 +02:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-01-16 00:42:57 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-04 12:22:22 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-06-02 17:44:27 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-02 17:44:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-21 01:14:17 -08:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2013-02-21 01:14:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-06 03:39:55 -07:00
|
|
|
|
2017-05-09 00:08:41 -07:00
|
|
|
|
2020-01-02 05:31:22 -08:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-11-20 23:24:09 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-02 05:31:22 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:43:02 -08:00
|
|
|
|
2017-01-16 00:42:57 -08:00
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:43:02 -08:00
|
|
|
|
2017-01-16 00:42:57 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|