Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1414633ybc; Tue, 12 Nov 2019 21:02:54 -0800 (PST) X-Google-Smtp-Source: APXvYqw2prPcwjot8mIQFKEJuA2OCm3hmhTnbW9R9bEuLUAmk8F7qyFPH2bacBlpC2JLcmI5lb7q X-Received: by 2002:aa7:cad5:: with SMTP id l21mr1521960edt.131.1573621374743; Tue, 12 Nov 2019 21:02:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573621374; cv=none; d=google.com; s=arc-20160816; b=EH6YO95LF8fdhCMDOiMvkkXcWaQb2BvsR/LB9Qin1XD+V+dCHzGrCz4nIL3D78Fh10 cEzkIRUcMI+lwcoudMBldQlU4G7b+iBwAj+xRenQV+DWNyxLoOEx4GLXxiMtGVKSeRPi 62WEfbBL4NItFh7+VpxVmE8UMweqqzeCeO/GFenMXFGeahV6TMw10lrG7UbN3ECuXvRY cXH/fzuY5rrLdBTnxFse9fYof8YuGIQbVNDSi9lSztUQc0jsuKP/B8cP72uaWgFJHHCz Lo+XYo4renPJda1hz+Gc9Whlh5Dlep7YB/5/uxt/GpvdD0ft8wXE6TCBr6XkvWEZi57A OO1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=gur0MXsjp+wa2mTPl85kkjzu+SU5Mhbf0Mg5knm6b+Q=; b=lUWCxwbWMr+1taVHx6lCbCMjEZ5Vksb4YMcmOJQlWOhNvpARMt8xafLiS61JzqEVRR XrmxLkN3rTDGKLx0zBfM1EQc7f0XpKS1RfUAnhRUG9pyYEimPbiYVb7rz27Zvg+ZX5w7 RL3jJCohjpv+zhwrVNAUdBtfWJJgAaWcl6jyGLcCLdzSKIKh20XMVKXCMuAIAQQVON7b qtxigEFRa73hONi6ZGyv/UbUIbRVkvfkfXYiqwee1FNesvQSK2aFdnMmkZLrmzkhpsni ZZyj7hU8mHzH+bSzyuXcxNk5W+m2JtpzHZEjAooqzYiYW95PlDAqAfp+lm7tfKsnov7Q qFNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f26si459923ejr.92.2019.11.12.21.02.29; Tue, 12 Nov 2019 21:02:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725966AbfKMFB3 (ORCPT + 99 others); Wed, 13 Nov 2019 00:01:29 -0500 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:54782 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbfKMFB3 (ORCPT ); Wed, 13 Nov 2019 00:01:29 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0ThxP.9P_1573621281; Received: from JosephdeMacBook-Pro.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0ThxP.9P_1573621281) by smtp.aliyun-inc.com(127.0.0.1); Wed, 13 Nov 2019 13:01:22 +0800 Subject: Re: ocfs2: xattr problems with 5.4.0-rc7 From: Joseph Qi To: Thomas Voegtle , Jia-Ju Bai , Mark Fasheh , Joel Becker Cc: linux-kernel@vger.kernel.org References: Message-ID: <3ea0ee86-eb74-7330-75fa-15f90e82ada7@linux.alibaba.com> Date: Wed, 13 Nov 2019 13:01:21 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-7 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> 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