summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2023-07-01 09:44:44 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-07-01 18:26:23 +0300
commitdd546618ba704be4f3724a11e5a194052c551f08 (patch)
treeff54f98f4a99a521c1de628502955dc359d49d11 /include
parent408579cd627a15bd703fe3eeb8485fd02726e9d3 (diff)
downloadlinux-dd546618ba704be4f3724a11e5a194052c551f08.tar.xz
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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions