Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-06-19 15:18:26 +0200
committerTakashi Iwai <tiwai@suse.de>2019-06-19 15:18:32 +0200
commitc177bf5f29a16d66b25c77c2ec8c7d2e3e379f98 (patch)
tree8bcc550c0c2daf6fa14cd77922bd4820ae4c4e89
parent6d094336cd515b3c66bde44d0b1e2f594baee0dc (diff)
tmpfs: fix uninitialized return value in shmem_link
(bsc#1051510).
-rw-r--r--patches.fixes/tmpfs-fix-uninitialized-return-value-in-shmem_link.patch42
-rw-r--r--series.conf1
2 files changed, 43 insertions, 0 deletions
diff --git a/patches.fixes/tmpfs-fix-uninitialized-return-value-in-shmem_link.patch b/patches.fixes/tmpfs-fix-uninitialized-return-value-in-shmem_link.patch
new file mode 100644
index 0000000000..a04de9ba19
--- /dev/null
+++ b/patches.fixes/tmpfs-fix-uninitialized-return-value-in-shmem_link.patch
@@ -0,0 +1,42 @@
+From 29b00e609960ae0fcff382f4c7079dd0874a5311 Mon Sep 17 00:00:00 2001
+From: "Darrick J. Wong" <darrick.wong@oracle.com>
+Date: Fri, 22 Feb 2019 22:35:32 -0800
+Subject: [PATCH] tmpfs: fix uninitialized return value in shmem_link
+Git-commit: 29b00e609960ae0fcff382f4c7079dd0874a5311
+Patch-mainline: v5.0
+References: bsc#1051510
+
+When we made the shmem_reserve_inode call in shmem_link conditional, we
+forgot to update the declaration for ret so that it always has a known
+value. Dan Carpenter pointed out this deficiency in the original patch.
+
+Fixes: 1062af920c07 ("tmpfs: fix link accounting when a tmpfile is linked in")
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+Signed-off-by: Hugh Dickins <hughd@google.com>
+Cc: Matej Kupljen <matej.kupljen@gmail.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ mm/shmem.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mm/shmem.c b/mm/shmem.c
+index 0905215fb016..2c012eee133d 100644
+--- a/mm/shmem.c
++++ b/mm/shmem.c
+@@ -2848,7 +2848,7 @@ static int shmem_create(struct inode *dir, struct dentry *dentry, umode_t mode,
+ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
+ {
+ struct inode *inode = d_inode(old_dentry);
+- int ret;
++ int ret = 0;
+
+ /*
+ * No ordinary (disk based) filesystem counts links as inodes;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 021367fa13..dea93ddf4b 100644
--- a/series.conf
+++ b/series.conf
@@ -21373,6 +21373,7 @@
patches.fixes/bpf-lpm-fix-lookup-bug-in-map_delete_elem.patch
patches.fixes/0001-nfp-bpf-fix-ALU32-high-bits-clearance-bug.patch
patches.suse/net-x25-fix-a-race-in-x25_bind.patch
+ patches.fixes/tmpfs-fix-uninitialized-return-value-in-shmem_link.patch
patches.fixes/0001-mm-enforce-min-addr-even-if-capable-in-expand_downwa.patch
patches.fixes/crypto-sha256-arm-fix-crash-bug-in-Thumb2-build.patch
patches.fixes/crypto-sha512-arm-fix-crash-bug-in-Thumb2-build.patch