aboutsummaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/readdir.c
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2025-06-12 17:08:24 +0000
committerJakub Kicinski <[email protected]>2025-06-12 17:09:10 +0000
commit535de528015b56e34a40a8e1eb1629fadf809a84 (patch)
treef0287cdc9d13798b0e723541f51d1dfd8c99c50c /fs/overlayfs/readdir.c
parentMerge branch 'net-bcmgenet-add-support-for-gro-software-interrupt-coalescing' (diff)
parentMerge tag 'net-6.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadkernel-535de528015b56e34a40a8e1eb1629fadf809a84.tar.gz
kernel-535de528015b56e34a40a8e1eb1629fadf809a84.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.16-rc2). No conflicts or adjacent changes. Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'fs/overlayfs/readdir.c')
-rw-r--r--fs/overlayfs/readdir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 44e208da417c..474c80d210d1 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -13,6 +13,7 @@
#include <linux/security.h>
#include <linux/cred.h>
#include <linux/ratelimit.h>
+#include <linux/overflow.h>
#include "overlayfs.h"
struct ovl_cache_entry {
@@ -147,9 +148,8 @@ static struct ovl_cache_entry *ovl_cache_entry_new(struct ovl_readdir_data *rdd,
u64 ino, unsigned int d_type)
{
struct ovl_cache_entry *p;
- size_t size = offsetof(struct ovl_cache_entry, name[len + 1]);
- p = kmalloc(size, GFP_KERNEL);
+ p = kmalloc(struct_size(p, name, len + 1), GFP_KERNEL);
if (!p)
return NULL;