Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4049795ybv; Mon, 10 Feb 2020 11:18:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzVepzK6GHXd3Oj/plKoYe7Kq3MJKilhkONF2CzWlH7yKK3zHch+1rzV4dHsWnK3EG7pCQi X-Received: by 2002:a9d:798e:: with SMTP id h14mr2153431otm.257.1581362307800; Mon, 10 Feb 2020 11:18:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581362307; cv=none; d=google.com; s=arc-20160816; b=QUyrNXYQbxHJHDuXp2XzG7sBeNbtREWkDoI2buw6aguo4d7dTd3HuzQ6QiYHkTR9hE wiXwA6o36N89wZRj239J018ykNlqVX+l0yJ4BsGMrQzOOClpY39d+xM1wG6bBB0wykDI lr37nQuoBIG8UfcG6rwo18Vl23DxttV57nuJqYRf6pfbTYn0qUo0zMlahlaTwWDDA69Q B4OPJRLYFeAZCiaLtviAlTcKEQL3XwhfOB78BaWR4cscvYAI0+dIVh02x0QLKKiGMTgq dvZNwJU2+YdY/Oux1FX7FKAsVJZg5bz84wJdLUxpwOBroMoXBDjRc+SxkEIeOSh9IW9B r4lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=otGHtOCM6rh86w/9WiKH7KtUi7LnrVpg2XTkkOdRN5o=; b=CNRDunRSNfotX8rCPloO5nMS9oeOv8tvR8ABC6ZNbjcLR8+FSJWmLrJ67tVRGe0Ih9 n6dwRoA+k1KzhVbzIG4HjBOpgUjEZSqUnPc3WxpqQfvV/dTy3iBhPAYnaLdlqX/IiXnf idPBsi5h+R6fkFLmGWXRaAnr1+NfdI/M1JxpC0QSx/a5KEo6KvtQLAecvRcdZ44fXmbS 75Z8oktnaylEronj7lQRPL2KU9ZT+ALeEq55nbAXgKeM21RApANI8wH/FvoPsJiq/k1K IFyILv0NvjHd+LZzxq5bZsKeAw3nwtCNAG04iBt4kgWyfTAMRirwAZIWI+D+JeO1Xr1s qOGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JjcZB5vn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si657930otd.143.2020.02.10.11.18.16; Mon, 10 Feb 2020 11:18:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=JjcZB5vn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727434AbgBJTR7 (ORCPT + 99 others); Mon, 10 Feb 2020 14:17:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:46698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726831AbgBJTR7 (ORCPT ); Mon, 10 Feb 2020 14:17:59 -0500 Received: from localhost (unknown [104.132.1.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2ED2E20661; Mon, 10 Feb 2020 19:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581362278; bh=ZyB0HayJV9hA11EQE3OHddet92bzHEDctB8rpbAnB2A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JjcZB5vn0hUrVokfNT8lpRNWPpvf6xsZ2XP8QGuI4TuiuMUmBl7rECwc++d/GJtv4 cSdjcYYCvTkpCV9T2upXleimEwzmh6OUdTftd8tZynfo8dRKWMolDaOyDmW7D3b78o 7CBSY4X4loVfQg71m2RNPCZXUgsz0m4JKBWGhEVg= Date: Mon, 10 Feb 2020 11:17:57 -0800 From: Greg Kroah-Hartman To: Pavel Shilovskiy Cc: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Aurelien Aptel , Steven French Subject: Re: [EXTERNAL] [PATCH 5.4 303/309] cifs: fix mode bits from dir listing when mounted with modefromsid Message-ID: <20200210191757.GA1098324@kroah.com> References: <20200210122406.106356946@linuxfoundation.org> <20200210122436.056141941@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 10, 2020 at 07:10:00PM +0000, Pavel Shilovskiy wrote: > > -----Original Message Begin----- > From: Greg Kroah-Hartman > Sent: Monday, February 10, 2020 4:34 AM > To: linux-kernel@vger.kernel.org > Cc: Greg Kroah-Hartman ; stable@vger.kernel.org; Aurelien Aptel ; Steven French ; Pavel Shilovskiy > Subject: [EXTERNAL] [PATCH 5.4 303/309] cifs: fix mode bits from dir listing when mounted with modefromsid > > From: Aurelien Aptel > > commit e3e056c35108661e418c803adfc054bf683426e7 upstream. > > When mounting with -o modefromsid, the mode bits are stored in an ACE. Directory enumeration (e.g. ls -l /mnt) triggers an SMB Query Dir which does not include ACEs in its response. The mode bits in this case are silently set to a default value of 755 instead. > > This patch marks the dentry created during the directory enumeration as needing re-evaluation (i.e. additional Query Info with ACEs) so that the mode bits can be properly extracted. > > Quick repro: > > $ mount.cifs //win19.test/data /mnt -o ...,modefromsid $ touch /mnt/foo && chmod 751 /mnt/foo $ stat /mnt/foo > # reports 751 (OK) > $ sleep 2 > # dentry older than 1s by default get invalidated $ ls -l /mnt > # since dentry invalid, ls does a Query Dir > # and reports foo as 755 (WRONG) > > Signed-off-by: Aurelien Aptel > Signed-off-by: Steve French > CC: Stable > Reviewed-by: Pavel Shilovsky > Signed-off-by: Greg Kroah-Hartman > > --- > fs/cifs/readdir.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > --- a/fs/cifs/readdir.c > +++ b/fs/cifs/readdir.c > @@ -174,7 +174,8 @@ cifs_fill_common_info(struct cifs_fattr > * may look wrong since the inodes may not have timed out by the time > * "ls" does a stat() call on them. > */ > - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) > + if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) || > + (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_SID)) > fattr->cf_flags |= CIFS_FATTR_NEED_REVAL; > > if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL && > > -----Original Message End----- > > Hi Greg, > > This patch fixes the following commit that was introduced in v5.5: > > commit fdef665ba44ad5ed154af2acfb19ae2ee3bf5dcc > Author: Steve French > Date: Fri Dec 6 02:02:38 2019 -0600 > > smb3: fix mode passed in on create for modetosid mount option > > > Please remove the patch from all stable trees expect 5.5.y. Now dropped, thanks for letting me know. greg k-h