Files
linux/include/linux
Kees Cook b69f0aeb06 pid: Replace struct pid 1-element array with flex-array
For pid namespaces, struct pid uses a dynamically sized array member,
"numbers".  This was implemented using the ancient 1-element fake
flexible array, which has been deprecated for decades.

Replace it with a C99 flexible array, refactor the array size
calculations to use struct_size(), and address elements via indexes.
Note that the static initializer (which defines a single element) works
as-is, and requires no special handling.

Without this, CONFIG_UBSAN_BOUNDS (and potentially
CONFIG_FORTIFY_SOURCE) will trigger bounds checks:

  https://lore.kernel.org/lkml/20230517-bushaltestelle-super-e223978c1ba6@brauner

Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Jeff Xu <jeffxu@google.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Daniel Verkamp <dverkamp@chromium.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Jeff Xu <jeffxu@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Reported-by: syzbot+ac3b41786a2d0565b6d5@syzkaller.appspotmail.com
[brauner: dropped unrelated changes and remove 0 with NULL cast]
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-06-30 09:04:01 -07:00
..
2023-01-16 09:26:05 +01:00
2022-11-04 12:59:25 +02:00
2023-03-29 12:26:32 +02:00
2023-06-16 10:08:09 -06:00
2023-01-19 14:46:25 +01:00
2023-06-16 10:08:09 -06:00
2023-05-31 13:06:57 +02:00
2023-02-03 08:20:55 -07:00
2023-01-13 11:48:15 +01:00
2023-03-05 10:49:37 -08:00
2023-05-25 09:26:19 +02:00
2023-04-17 18:01:23 +02:00
2023-04-20 18:20:04 +08:00
2023-01-19 16:07:40 +01:00
2023-03-06 15:49:07 -06:00
2023-01-29 15:18:33 -07:00
2023-01-29 15:18:33 -07:00
2023-02-06 19:06:58 +01:00
2023-01-19 09:24:28 +01:00
2023-01-11 06:52:43 -05:00
2023-03-19 10:02:04 -07:00
2023-06-19 16:19:05 -07:00
2023-06-13 16:49:23 +02:00
2023-05-01 17:50:18 -07:00
2023-05-22 17:38:45 +02:00
2023-03-07 22:04:45 +05:30
2023-06-28 20:35:21 -07:00
2023-01-19 09:24:30 +01:00
2023-03-29 12:26:32 +02:00
2023-06-20 20:17:10 -07:00
2023-05-24 18:08:49 +02:00
2023-03-15 14:58:52 +01:00
2023-06-23 16:59:30 -07:00
2023-06-05 09:36:39 +02:00
2023-06-19 16:19:25 -07:00
2023-03-06 09:57:07 +01:00
2022-12-20 03:13:45 +01:00
2022-10-23 18:06:54 -04:00
2023-06-23 16:59:28 -07:00
2023-03-17 15:00:40 +01:00
2023-01-19 15:01:19 +01:00
2023-05-18 19:52:31 -07:00
2023-06-05 09:36:39 +02:00
2023-06-24 15:50:13 -07:00
2023-03-16 13:08:39 -07:00
2023-03-23 17:25:46 +01:00
2023-03-29 08:19:38 +01:00
2023-04-05 20:03:01 -07:00
2023-04-21 03:02:34 -04:00
2023-03-06 09:57:11 +01:00
2022-10-24 12:12:32 -07:00