summaryrefslogtreecommitdiff
path: root/fs/overlayfs/export.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2020-05-28 08:58:12 +0300
committerIngo Molnar <mingo@kernel.org>2020-05-28 08:58:12 +0300
commit0bffedbce90818228f554651baf8d7c75f2876d8 (patch)
tree96101208e0200c70c6688737ac6596bdd0ed2950 /fs/overlayfs/export.c
parentc50c75e9b87946499a62bffc021e95c87a1d57cd (diff)
parent9cb1fd0efd195590b828b9b865421ad345a4a145 (diff)
downloadlinux-0bffedbce90818228f554651baf8d7c75f2876d8.tar.xz
Merge tag 'v5.7-rc7' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/overlayfs/export.c')
-rw-r--r--fs/overlayfs/export.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c
index 475c61f53f0f..ed5c1078919c 100644
--- a/fs/overlayfs/export.c
+++ b/fs/overlayfs/export.c
@@ -783,6 +783,9 @@ static struct ovl_fh *ovl_fid_to_fh(struct fid *fid, int buflen, int fh_type)
if (fh_type != OVL_FILEID_V0)
return ERR_PTR(-EINVAL);
+ if (buflen <= OVL_FH_WIRE_OFFSET)
+ return ERR_PTR(-EINVAL);
+
fh = kzalloc(buflen, GFP_KERNEL);
if (!fh)
return ERR_PTR(-ENOMEM);