Christian Brauner dd546618ba pid: use struct_size_t() helper
Before commit d67790ddf021 ("overflow: Add struct_size_t() helper") only
struct_size() existed, which expects a valid pointer instance containing
the flexible array.

However, when we determine the default struct pid allocation size for
the associated kmem cache of a pid namespace we need to take the nesting
depth of the pid namespace into account without an variable instance
necessarily being available.

In commit b69f0aeb0689 ("pid: Replace struct pid 1-element array with
flex-array") we used to handle this the old fashioned way and cast NULL
to a struct pid pointer type. However, we do apparently have a dedicated
struct_size_t() helper for exactly this case. So switch to that.

Suggested-by: Kees Cook <keescook@chromium.org>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-07-01 08:26:23 -07:00
..
2023-06-24 14:52:28 -07:00
2022-12-02 11:25:00 +01:00
2023-06-29 21:12:20 -07:00
2022-12-21 14:31:52 -08:00
2023-06-26 11:05:49 +02:00
2023-06-28 15:51:08 -07:00
2023-06-27 16:54:21 -07:00
2023-06-27 21:24:18 -07:00
2023-06-30 10:44:53 -07:00
2022-08-29 19:47:03 -04:00
2022-09-26 10:13:13 -07:00
2023-03-24 11:01:29 +01:00
2023-06-28 15:51:08 -07:00
2023-06-28 15:51:08 -07:00
2023-04-20 22:55:35 -04:00
2023-06-09 17:44:15 -07:00
2023-07-01 08:26:23 -07:00
2023-06-28 16:05:21 -07:00
2023-06-28 16:05:21 -07:00
2023-06-27 16:32:52 -07:00