From: Hugh Dickins <hughd@google.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jeff Layton <jlayton@poochiereds.net>,
Aristeu Rozanski <aris@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] simple_xattr: permit 0-size extended attributes
Date: Wed, 16 Jul 2014 13:14:06 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.11.1407161313210.7782@eggly.anvils> (raw)
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@google.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);
reply other threads:[~2014-07-16 20:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LSU.2.11.1407161313210.7782@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=aris@redhat.com \
--cc=jlayton@poochiereds.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox