All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
	linux-fsdevel@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>
Subject: [PATCH] xattr: Fail with -EINVAL for NULL attribute names
Date: Wed, 13 Apr 2016 14:57:19 +0200	[thread overview]
Message-ID: <1460552239-30041-1-git-send-email-agruenba@redhat.com> (raw)

Commit 98e9cb57 improved the xattr name checks in xattr_resolve_name but
didn't update the NULL attribute name check appropriately, so NULL
attribute names lead to NULL pointer dereferences.  Turn that into
-EINVAL results instead.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xattr.c b/fs/xattr.c
index 4861322..1515fe9 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -668,7 +668,7 @@ xattr_resolve_name(const struct xattr_handler **handlers, const char **name)
 	const struct xattr_handler *handler;
 
 	if (!*name)
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	for_each_xattr_handler(handlers, handler) {
 		const char *n;
-- 
2.5.5


             reply	other threads:[~2016-04-13 12:57 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 12:57 Andreas Gruenbacher [this message]
2016-04-13 15:40 ` [PATCH] xattr: Export xattr_resolve_name Andreas Gruenbacher
2016-04-13 18:20   ` Al Viro
     [not found]     ` <20160413182026.GR25498-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2016-04-13 22:27       ` Andreas Gruenbacher
2016-04-13 22:27         ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27         ` Andreas Gruenbacher
     [not found]       ` <1460586466-5518-1-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-13 22:27         ` [PATCH 2/8] cifs: Check for equality with ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT Andreas Gruenbacher
2016-04-13 22:27           ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27           ` Andreas Gruenbacher
2016-04-13 22:27         ` [PATCH 3/8] cifs: Fix removexattr for os2.* xattrs Andreas Gruenbacher
2016-04-13 22:27           ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27           ` Andreas Gruenbacher
2016-04-13 22:27         ` [PATCH 6/8] ceph: kill __ceph_removexattr() Andreas Gruenbacher
2016-04-13 22:27           ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27           ` Andreas Gruenbacher
2016-04-13 22:30       ` [PATCH] xattr: Export xattr_resolve_name Andreas Gruenbacher
2016-04-13 22:30         ` [Cluster-devel] " Andreas Gruenbacher
     [not found]       ` <1460586620-5717-1-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-13 22:30         ` [PATCH 1/8] cifs: Fix xattr name checks Andreas Gruenbacher
2016-04-13 22:30           ` [Cluster-devel] " Andreas Gruenbacher
     [not found]           ` <1460586620-5717-2-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-14  4:26             ` Steve French
2016-04-14  4:26               ` [Cluster-devel] " Steve French
     [not found]               ` <CAH2r5mumJ22+Q0bASFcXp5fK39Ubh+sznfOpVUtSJ94_c5gkxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-14  4:37                 ` Al Viro
2016-04-14  4:37                   ` [Cluster-devel] " Al Viro
2016-04-14  4:43                   ` Steve French
2016-04-14  4:43                     ` [Cluster-devel] " Steve French
     [not found]                     ` <CAH2r5ms6USEO3a_EPUpgsnvTZgSHB2QqJnUnCSCQdFmvV0yPDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-14  4:49                       ` Steve French
2016-04-14  4:49                         ` [Cluster-devel] " Steve French
2016-04-14  4:59                       ` Al Viro
2016-04-14  4:59                         ` [Cluster-devel] " Al Viro
     [not found]                         ` <20160414045920.GT25498-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2016-04-15  3:01                           ` Steve French
2016-04-15  3:01                             ` [Cluster-devel] " Steve French
2016-04-13 22:30         ` [PATCH 3/8] cifs: Fix removexattr for os2.* xattrs Andreas Gruenbacher
2016-04-13 22:30           ` [Cluster-devel] " Andreas Gruenbacher
     [not found]           ` <1460586620-5717-4-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-14  4:27             ` Steve French
2016-04-14  4:27               ` [Cluster-devel] " Steve French
2016-04-13 22:30         ` [PATCH 8/8] gfs2: Switch to generic xattr handlers Andreas Gruenbacher
2016-04-13 22:30           ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27     ` [PATCH 1/8] cifs: Fix xattr name checks Andreas Gruenbacher
2016-04-13 22:27       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27       ` Andreas Gruenbacher
2016-04-13 22:27     ` [PATCH 4/8] ceph: Get rid of d_find_alias in ceph_set_acl Andreas Gruenbacher
2016-04-13 22:27       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27       ` Andreas Gruenbacher
2016-04-13 22:27     ` [PATCH 5/8] ceph: Switch to generic xattr handlers Andreas Gruenbacher
2016-04-13 22:27       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27       ` Andreas Gruenbacher
2016-04-13 22:27     ` [PATCH 7/8] posix acls: Export xattr_handler functions Andreas Gruenbacher
2016-04-13 22:27       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27       ` Andreas Gruenbacher
2016-04-13 22:27     ` [PATCH 8/8] gfs2: Switch to generic xattr handlers Andreas Gruenbacher
2016-04-13 22:27       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:27       ` Andreas Gruenbacher
2016-04-13 22:30     ` [PATCH 2/8] cifs: Check for equality with ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT Andreas Gruenbacher
2016-04-13 22:30       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-14  4:26       ` Steve French
2016-04-14  4:26         ` [Cluster-devel] " Steve French
2016-04-13 22:30     ` [PATCH 4/8] ceph: Get rid of d_find_alias in ceph_set_acl Andreas Gruenbacher
2016-04-13 22:30       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:30     ` [PATCH 5/8] ceph: Switch to generic xattr handlers Andreas Gruenbacher
2016-04-13 22:30       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:30     ` [PATCH 6/8] ceph: kill __ceph_removexattr() Andreas Gruenbacher
2016-04-13 22:30       ` [Cluster-devel] " Andreas Gruenbacher
2016-04-13 22:30     ` [PATCH 7/8] posix acls: Export xattr_handler functions Andreas Gruenbacher
2016-04-13 22:30       ` [Cluster-devel] " Andreas Gruenbacher

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=1460552239-30041-1-git-send-email-agruenba@redhat.com \
    --to=agruenba@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.