From patchwork Thu May 24 06:55:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 919624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RYIPbPiw"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40s0Wl4cx3z9s29 for ; Thu, 24 May 2018 16:55:31 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935565AbeEXGza (ORCPT ); Thu, 24 May 2018 02:55:30 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:44210 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935530AbeEXGz3 (ORCPT ); Thu, 24 May 2018 02:55:29 -0400 Received: by mail-pl0-f68.google.com with SMTP id m24-v6so450266pls.11 for ; Wed, 23 May 2018 23:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=CTMxx5TXfggVTjF4GlVnCoLLDeHvX9FU2WFJn9s/Yu0=; b=RYIPbPiwavsFLIyB3YG2xh0kby6PCpb2FctqJo3EoCy0LQHnGHZ56xqaB4AnEEo6hK e1xdIjNLw/3blQLgbx0UeuBH+PWkhOPkG+FYSnicfdd3x8QyzHvCsuZp7D7llIn/gNe2 UXNidwV/s0yY5XOLgl1t/1GoTBdszCw7v8MMnbd/fmtAI7VHhVQlOIpG95Ap3xix/xt7 DWZLdk3P2km1C/hm9os0spJJJpewXFlo06sH/Lc+XxDbbussqFq7s+5W/KmwNfN8YEEW UKiNlvhtqYcb3g2qw2aibb+B8jaQEHInQpKbm4sjGlfuzAfJ71qt9MIqjdmCjpT/nUCg Uxyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=CTMxx5TXfggVTjF4GlVnCoLLDeHvX9FU2WFJn9s/Yu0=; b=bJChawzNHpiVWm5MEbXy55G850d1p//8NNAbkhiCM5gHpxgRzhvUldq5EN19PZZN8V Lfn+psX/f4vSFOmk1nPbQKqE4kdWARhZi1OOxFwJHnrWax0Az5AEF/E5+weRUrwFz3TG G0kPc0sJr2mkJ47BpW78BjdIx0508g10+keInTPSs4LTgpPDMtgPptI417ij+LHoIZyQ 9cXTFpCJFxvLuEdeJEHC4QA+TM/KyfF6csNXdH+2nLft/POQf2AkB4XWjYTtqAZNNLk1 ezOfLmzkur4v0iW3I3d4GequMmlSkTr+QH3hz3OddVRS4G6V2lxBmPp0n9blFW1tX4kx b7Qw== X-Gm-Message-State: ALKqPwd21Qp9SKpCX5A9mgUHq9wdy/uycIkRJA8+NhsqjKoQkVIosPKy YNu4lJc5USsbxfK4T570ka/3scbiq9w3vGDzg8SzXQ== X-Google-Smtp-Source: AB8JxZryaWfp4DRQWeJQoqmJGfZxjiilJDoL+ozSJIG51RXWucIAL4hSANVbA7ySgzptkeR8mDUJLP/87tmMC3SIuAI= X-Received: by 2002:a17:902:d68b:: with SMTP id v11-v6mr1620743ply.16.1527144929037; Wed, 23 May 2018 23:55:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:bd8f:0:0:0:0 with HTTP; Wed, 23 May 2018 23:55:08 -0700 (PDT) In-Reply-To: References: <20180524041805.17039-1-lsahlber@redhat.com> From: Steve French Date: Thu, 24 May 2018 01:55:08 -0500 Message-ID: Subject: Fwd: [PATCH] cifs: show the "w" bit for writeable /proc/fs/cifs/* files To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org ---------- Forwarded message ---------- From: Steve French Date: Thu, May 24, 2018 at 1:53 AM Subject: Re: [PATCH] cifs: show the "w" bit for writeable /proc/fs/cifs/* files To: Ronnie Sahlberg Cc: linux-cifs merged into cifs-2.6.git for-next I also added a patch to allow use to load "smb3" instead of just "cifs" ("modprobe smb3" will now work not just "modprobe cifs" - we really want to be encouraging people to use SMB3 and later for security reasons (among others) and this will allow us to use the more logical name 'smb3') https://git.samba.org/?p=sfrench/cifs-2.6.git;a=commit;h=64a051adf5911e8a71a46413c60beaf17ce7143d On Wed, May 23, 2018 at 11:18 PM, Ronnie Sahlberg wrote: > > RHBZ: 1539612 > > Lets show the "w" bit for those files have a .write interface to set/enable/... > the feature. > > Reported-by: Xiaoli Feng > Signed-off-by: Ronnie Sahlberg > --- > fs/cifs/cifs_debug.c | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > > diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c > index 9d69ea433330..22eb7b3c44fb 100644 > --- a/fs/cifs/cifs_debug.c > +++ b/fs/cifs/cifs_debug.c > @@ -500,32 +500,32 @@ cifs_proc_init(void) > proc_create("DebugData", 0, proc_fs_cifs, &cifs_debug_data_proc_fops); > > #ifdef CONFIG_CIFS_STATS > - proc_create("Stats", 0, proc_fs_cifs, &cifs_stats_proc_fops); > + proc_create("Stats", 0644, proc_fs_cifs, &cifs_stats_proc_fops); > #endif /* STATS */ > - proc_create("cifsFYI", 0, proc_fs_cifs, &cifsFYI_proc_fops); > - proc_create("traceSMB", 0, proc_fs_cifs, &traceSMB_proc_fops); > - proc_create("LinuxExtensionsEnabled", 0, proc_fs_cifs, > + proc_create("cifsFYI", 0644, proc_fs_cifs, &cifsFYI_proc_fops); > + proc_create("traceSMB", 0644, proc_fs_cifs, &traceSMB_proc_fops); > + proc_create("LinuxExtensionsEnabled", 0644, proc_fs_cifs, > &cifs_linux_ext_proc_fops); > - proc_create("SecurityFlags", 0, proc_fs_cifs, > + proc_create("SecurityFlags", 0644, proc_fs_cifs, > &cifs_security_flags_proc_fops); > - proc_create("LookupCacheEnabled", 0, proc_fs_cifs, > + proc_create("LookupCacheEnabled", 0644, proc_fs_cifs, > &cifs_lookup_cache_proc_fops); > #ifdef CONFIG_CIFS_SMB_DIRECT > - proc_create("rdma_readwrite_threshold", 0, proc_fs_cifs, > + proc_create("rdma_readwrite_threshold", 0644, proc_fs_cifs, > &cifs_rdma_readwrite_threshold_proc_fops); > - proc_create("smbd_max_frmr_depth", 0, proc_fs_cifs, > + proc_create("smbd_max_frmr_depth", 0644, proc_fs_cifs, > &cifs_smbd_max_frmr_depth_proc_fops); > - proc_create("smbd_keep_alive_interval", 0, proc_fs_cifs, > + proc_create("smbd_keep_alive_interval", 0644, proc_fs_cifs, > &cifs_smbd_keep_alive_interval_proc_fops); > - proc_create("smbd_max_receive_size", 0, proc_fs_cifs, > + proc_create("smbd_max_receive_size", 0644, proc_fs_cifs, > &cifs_smbd_max_receive_size_proc_fops); > - proc_create("smbd_max_fragmented_recv_size", 0, proc_fs_cifs, > + proc_create("smbd_max_fragmented_recv_size", 0644, proc_fs_cifs, > &cifs_smbd_max_fragmented_recv_size_proc_fops); > - proc_create("smbd_max_send_size", 0, proc_fs_cifs, > + proc_create("smbd_max_send_size", 0644, proc_fs_cifs, > &cifs_smbd_max_send_size_proc_fops); > - proc_create("smbd_send_credit_target", 0, proc_fs_cifs, > + proc_create("smbd_send_credit_target", 0644, proc_fs_cifs, > &cifs_smbd_send_credit_target_proc_fops); > - proc_create("smbd_receive_credit_max", 0, proc_fs_cifs, > + proc_create("smbd_receive_credit_max", 0644, proc_fs_cifs, > &cifs_smbd_receive_credit_max_proc_fops); > #endif > } > -- > 2.13.3 > From 64a051adf5911e8a71a46413c60beaf17ce7143d Mon Sep 17 00:00:00 2001 From: Steve French Date: Wed, 23 May 2018 21:44:53 -0500 Subject: [PATCH 1/2] smb3: add module alias for smb3 to cifs.ko We really don't want to be encouraging people to use the old (less secure) cifs dialect (SMB1) and it can be confusing for them with SMB3 (or later) being recommended but the module name is cifs. Add a module alias for "smb3" to cifs.ko to make this less confusing. Signed-off-by: Steve French --- fs/cifs/cifsfs.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 62f166270459..645bb88f0ee4 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -899,6 +899,17 @@ struct file_system_type cifs_fs_type = { /* .fs_flags */ }; MODULE_ALIAS_FS("cifs"); + +struct file_system_type smb3_fs_type = { + .owner = THIS_MODULE, + .name = "smb3", + .mount = cifs_do_mount, + .kill_sb = cifs_kill_sb, + /* .fs_flags */ +}; +MODULE_ALIAS_FS("smb3"); +MODULE_ALIAS("smb3"); + const struct inode_operations cifs_dir_inode_ops = { .create = cifs_create, .atomic_open = cifs_atomic_open, @@ -1437,6 +1448,12 @@ init_cifs(void) if (rc) goto out_init_cifs_idmap; + rc = register_filesystem(&smb3_fs_type); + if (rc) { + unregister_filesystem(&cifs_fs_type); + goto out_init_cifs_idmap; + } + return 0; out_init_cifs_idmap: @@ -1467,8 +1484,9 @@ init_cifs(void) static void __exit exit_cifs(void) { - cifs_dbg(NOISY, "exit_cifs\n"); + cifs_dbg(NOISY, "exit_smb3\n"); unregister_filesystem(&cifs_fs_type); + unregister_filesystem(&smb3_fs_type); cifs_dfs_release_automount_timer(); #ifdef CONFIG_CIFS_ACL exit_cifs_idmap(); -- 2.17.0