[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.1409051214450.5269@file01.intranet.prod.int.rdu2.redhat.com>
Date: Fri, 5 Sep 2014 12:16:01 -0400 (EDT)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Miklos Szeredi <mszeredi@...e.cz>
cc: Jan Kara <jack@...e.cz>, "J. Bruce Fields" <bfields@...hat.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] dcache: fix kmemcheck warning in switch_names
This patch fixes kmemcheck warning in switch_names. The function
switch_names swaps inline names of two dentries. It swaps full arrays
d_iname, no matter how many bytes are really used by the strings. Reading
data beyond string ends results in kmemcheck warning.
We fix the bug by marking both arrays as fully initialized.
Signed-off-by: Mikulas Patocka <mpatocka@...hat.com>
Cc: stable@...r.kernel.org # v3.15
---
fs/dcache.c | 2 ++
1 file changed, 2 insertions(+)
Index: linux-2.6/fs/dcache.c
===================================================================
--- linux-2.6.orig/fs/dcache.c 2014-09-04 23:04:21.000000000 +0200
+++ linux-2.6/fs/dcache.c 2014-09-04 23:43:11.000000000 +0200
@@ -2407,6 +2407,8 @@ static void switch_names(struct dentry *
*/
unsigned int i;
BUILD_BUG_ON(!IS_ALIGNED(DNAME_INLINE_LEN, sizeof(long)));
+ kmemcheck_mark_initialized(dentry->d_iname, DNAME_INLINE_LEN);
+ kmemcheck_mark_initialized(target->d_iname, DNAME_INLINE_LEN);
for (i = 0; i < DNAME_INLINE_LEN / sizeof(long); i++) {
swap(((long *) &dentry->d_iname)[i],
((long *) &target->d_iname)[i]);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists