Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-11-01 14:04:41 +1100
committerNeilBrown <neilb@suse.com>2018-11-01 14:05:19 +1100
commit72e430a422210622f0b619f9e57b70c364f8f75f (patch)
treed1714841855ce571f85806484473c001ee7a942b
parent00bcaec491353f4d755e4d1bdbc0fef2108bc103 (diff)
getname_kernel() needs to make sure that ->name != ->iname in
long case (git-fixes).
-rw-r--r--patches.fixes/getname_kernel-needs-to-make-sure-that-name-iname-in.patch32
-rw-r--r--series.conf1
2 files changed, 33 insertions, 0 deletions
diff --git a/patches.fixes/getname_kernel-needs-to-make-sure-that-name-iname-in.patch b/patches.fixes/getname_kernel-needs-to-make-sure-that-name-iname-in.patch
new file mode 100644
index 0000000000..76b6586a0d
--- /dev/null
+++ b/patches.fixes/getname_kernel-needs-to-make-sure-that-name-iname-in.patch
@@ -0,0 +1,32 @@
+From: Al Viro <viro@zeniv.linux.org.uk>
+Date: Sun, 8 Apr 2018 11:57:10 -0400
+Subject: [PATCH] getname_kernel() needs to make sure that ->name != ->iname in
+ long case
+Git-commit: 30ce4d1903e1d8a7ccd110860a5eef3c638ed8be
+Patch-mainline: v4.17
+References: git-fixes
+
+missed it in "kill struct filename.separate" several years ago.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/namei.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/namei.c
++++ b/fs/namei.c
+@@ -221,9 +221,10 @@ getname_kernel(const char * filename)
+ if (len <= EMBEDDED_NAME_MAX) {
+ result->name = (char *)result->iname;
+ } else if (len <= PATH_MAX) {
++ const size_t size = offsetof(struct filename, iname[1]);
+ struct filename *tmp;
+
+- tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
++ tmp = kmalloc(size, GFP_KERNEL);
+ if (unlikely(!tmp)) {
+ __putname(result);
+ return ERR_PTR(-ENOMEM);
diff --git a/series.conf b/series.conf
index 2b1e362a9d..0609b4fd59 100644
--- a/series.conf
+++ b/series.conf
@@ -14935,6 +14935,7 @@
patches.drivers/kvm-svm-add-pause-filter-threshold
patches.drivers/kvm-svm-implement-pause-loop-exit-logic-in-svm
patches.arch/kvm-vmx-raise-internal-error-for-exception-during-invalid-protected-mode-state
+ patches.fixes/getname_kernel-needs-to-make-sure-that-name-iname-in.patch
patches.suse/net-fool-proof-dev_valid_name.patch
patches.suse/ip_tunnel-better-validate-user-provided-tunnel-names.patch
patches.suse/ipv6-sit-better-validate-user-provided-tunnel-names.patch