lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FB0D1C6.7090801@gmail.com>
Date:	Mon, 14 May 2012 17:35:02 +0800
From:	Cong Wang <xiyou.wangcong@...il.com>
To:	Hugh Dickins <hughd@...gle.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Christoph Hellwig <hch@...radead.org>,
	Andi Kleen <andi@...stfloor.org>,
	Al Viro <viro@...iv.linux.org.uk>, linux-mm@...ck.org,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/10] tmpfs: enable NOSEC optimization

On 05/12/2012 08:02 PM, Hugh Dickins wrote:
> Let tmpfs into the NOSEC optimization (avoiding file_remove_suid()
> overhead on most common writes): set MS_NOSEC on its superblocks.
>
> Signed-off-by: Hugh Dickins<hughd@...gle.com>
> ---
>   mm/shmem.c |    1 +
>   1 file changed, 1 insertion(+)
>
> --- 3045N.orig/mm/shmem.c	2012-05-05 10:45:17.888060878 -0700
> +++ 3045N/mm/shmem.c	2012-05-05 10:46:05.732062006 -0700
> @@ -2361,6 +2361,7 @@ int shmem_fill_super(struct super_block
>   		}
>   	}
>   	sb->s_export_op =&shmem_export_ops;
> +	sb->s_flags |= MS_NOSEC;

Isn't setting the flag on inode better? Something like:

diff --git a/mm/shmem.c b/mm/shmem.c
index f99ff3e..7d98fb5 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2325,6 +2325,7 @@ static void shmem_init_inode(void *foo)
  {
         struct shmem_inode_info *info = foo;
         inode_init_once(&info->vfs_inode);
+       info->vfs_inode.i_flags |= S_NOSEC;
  }

  static int shmem_init_inodecache(void)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ