From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08DC6C55178 for ; Tue, 27 Oct 2020 15:32:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2C09206D4 for ; Tue, 27 Oct 2020 15:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812754; bh=fkpBxmfNOcwEsEY2B5f6l5JmMKKxZmeXpAnX27yXbj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fbWojW2qvkpET+cz+nnt2nX3mqmb4DNdgN04wnUUMuVj5vwB7ngAMfA+LtSazmLkL MhNQ99pTxwRCKB5YsRhEVYld0v0mgi+i7RPKBJMoIh6iwiQsM0iWdKsm7eQbf32U3L xCRpva3xNrNcvhdmj8oCWYv5sGCf3xh/54YEKZeU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1799631AbgJ0Pcd (ORCPT ); Tue, 27 Oct 2020 11:32:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:35218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1796943AbgJ0PUo (ORCPT ); Tue, 27 Oct 2020 11:20:44 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 D74F12064B; Tue, 27 Oct 2020 15:20:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812043; bh=fkpBxmfNOcwEsEY2B5f6l5JmMKKxZmeXpAnX27yXbj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h9ZuT1OdPQpXxde0Xb//74iSaoYD46XjTp5GtBu4b+jNWnRpg0oDOmwvObwR3XxPP j6ayObEFHzHV6ztaoazcdQ/Ip54Cz2KV7yi3gAXZxV9sG9dOYXVjL6eiTQIC6KqU+D cdEdVewDJZjgsdTsP+83PGTBA58oUtlaI3fzvjO0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve French , Ronnie Sahlberg , Shyam Prasad N Subject: [PATCH 5.9 071/757] smb3: fix stat when special device file and mounted with modefromsid Date: Tue, 27 Oct 2020 14:45:21 +0100 Message-Id: <20201027135453.872928262@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steve French commit 3c3317daef0afa0cd541fc9c1bfd6ce8bbf1129a upstream. When mounting with modefromsid mount option, it was possible to get the error on stat of a fifo or char or block device: "cannot stat : Operation not supported" Special devices can be stored as reparse points by some servers (e.g. Windows NFS server and when using the SMB3.1.1 POSIX Extensions) but when the modefromsid mount option is used the client attempts to get the ACL for the file which requires opening with OPEN_REPARSE_POINT create option. Signed-off-by: Steve French CC: Stable Reviewed-by: Ronnie Sahlberg Reviewed-by: Shyam Prasad N Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2ops.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3072,7 +3072,12 @@ get_smb2_acl_by_path(struct cifs_sb_info oparms.tcon = tcon; oparms.desired_access = READ_CONTROL; oparms.disposition = FILE_OPEN; - oparms.create_options = cifs_create_options(cifs_sb, 0); + /* + * When querying an ACL, even if the file is a symlink we want to open + * the source not the target, and so the protocol requires that the + * client specify this flag when opening a reparse point + */ + oparms.create_options = cifs_create_options(cifs_sb, 0) | OPEN_REPARSE_POINT; oparms.fid = &fid; oparms.reconnect = false;