public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Thomas Voegtle <tv@lio96.de>, Jia-Ju Bai <baijiaju1990@gmail.com>,
	Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ocfs2: xattr problems with 5.4.0-rc7
Date: Wed, 13 Nov 2019 13:01:21 +0800	[thread overview]
Message-ID: <3ea0ee86-eb74-7330-75fa-15f90e82ada7@linux.alibaba.com> (raw)
In-Reply-To: <fc2993e9-f0d6-fb7c-5050-8dbb36338140@linux.alibaba.com>



On 19/11/13 09:28, Joseph Qi wrote:
> Hi Thomas,
> Thanks for reporting this issue.
> I have some doubts on it, please see my comments below.
> 
> On 19/11/12 22:45, Thomas Voegtle wrote:
>>
>> Hello,
>>
>> with 5.4.0-rc7 and 4.9.200 we see the following errors with mkdir or touch on a ocfs2 mountpoint:
>>
>> root@s2:/shared/ClusterShareDisk# mkdir dir
>> mkdir: cannot create directory ‘dir’: Invalid argument
>>
>> which produces this output:
>>
>> root@s2:/shared/ClusterShareDisk# dmesg
>> [ 6918.815770] (mkdir,19461,0):ocfs2_xa_set:2242 ERROR: status = -22
>> [ 6918.815772] (mkdir,19461,0):ocfs2_mknod:408 ERROR: status = -22
>> [ 6918.816215] (mkdir,19461,0):ocfs2_mknod:486 ERROR: status = -22
>> [ 6918.816216] (mkdir,19461,0):ocfs2_mkdir:652 ERROR: status = -22
>>
> ocfs2_xa_set
>   ocfs2_xa_prepare_entry
> 
> Since ocfs2_xa_set() returns -EINVAL, it means loc->xl_entry is NULL.
> 
> 	if (!loc->xl_entry) {
> 		rc = -EINVAL;
> 		goto out;
> 	}
> 
> After reverting
> commit 56e94ea132bb "fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()",
> it will call ocfs2_xa_add_entry(),
> 
> 	if (loc->xl_entry) {
> 		...
> 	} else
> 		ocfs2_xa_add_entry(loc, name_hash);
> 
> Theoretically it will cause NULL pointer dereference when access attributes of loc->xl_entry.
> So could you please check if the issue is caused by NULL loc->xl_entry?
> 

I think I've got the answer. loc->xl_ops->xlo_add_entry() will handle this case.
I'll revert this patch.

Thanks,
Joseph

> 
>> We got some ACLs:
>> $ getfacl /shared/ClusterShareDisk/
>> getfacl: Removing leading '/' from absolute path names
>> # file: shared/ClusterShareDisk/
>> # owner: root
>> # group: root
>> user::rwx
>> user:admin:rwx
>> group::rwx
>> mask::rwx
>> other::---
>> default:user::rwx
>> default:user:admin:rwx
>> default:group::rwx
>> default:mask::rwx
>> default:other::---
>>
>> And of course it is mounted with user_xattr and acl option.
>>
>> Reverting
>> commit 56e94ea132bb5c2c1d0b60a6aeb34dcb7d71a53d
>> Author: Jia-Ju Bai <baijiaju1990@gmail.com>
>> Date:   Sun Oct 6 17:57:50 2019 -0700
>>
>>     fs: ocfs2: fix possible null-pointer dereferences in
>> ocfs2_xa_prepare_entry()
>>
>> fixes the problem.
>>
>> Greetings,
>>
>>
>>     Thomas

      reply	other threads:[~2019-11-13  5:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 14:45 ocfs2: xattr problems with 5.4.0-rc7 Thomas Voegtle
2019-11-13  1:28 ` Joseph Qi
2019-11-13  5:01   ` Joseph Qi [this message]

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=3ea0ee86-eb74-7330-75fa-15f90e82ada7@linux.alibaba.com \
    --to=joseph.qi@linux.alibaba.com \
    --cc=baijiaju1990@gmail.com \
    --cc=jlbec@evilplan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=tv@lio96.de \
    /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