[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.11.1407161313210.7782@eggly.anvils>
Date: Wed, 16 Jul 2014 13:14:06 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Al Viro <viro@...iv.linux.org.uk>
cc: Jeff Layton <jlayton@...chiereds.net>,
Aristeu Rozanski <aris@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] simple_xattr: permit 0-size extended attributes
If a filesystem uses simple_xattr to support user extended attributes,
LTP setxattr01 and xfstests generic/062 fail with "Cannot allocate memory":
simple_xattr_alloc()'s wrap-around test mistakenly excludes values of zero
size. Fix that off-by-one (but apparently no filesystem needs them yet).
Signed-off-by: Hugh Dickins <hughd@...gle.com>
---
fs/xattr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- 3.16-rc5/fs/xattr.c 2013-02-18 15:58:34.000000000 -0800
+++ linux/fs/xattr.c 2014-07-16 12:47:10.640004412 -0700
@@ -843,7 +843,7 @@ struct simple_xattr *simple_xattr_alloc(
/* wrap around? */
len = sizeof(*new_xattr) + size;
- if (len <= sizeof(*new_xattr))
+ if (len < sizeof(*new_xattr))
return NULL;
new_xattr = kmalloc(len, GFP_KERNEL);
--
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