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-next>] [day] [month] [year] [list]
Date:	Wed, 25 Mar 2009 16:14:13 +0000
From:	David Howells <dhowells@...hat.com>
To:	Kentaro Takeda <takedakn@...data.co.jp>,
	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
	Toshiharu Harada <haradats@...data.co.jp>,
	Al Viro <viro@...iv.linux.org.uk>
cc:	dhowells@...hat.com, linux-kernel@...r.kernel.org
Subject: Are path-based LSM hooks called from the wrong places?


Hi Kentaro,

I've just been looking at some of the VFS syscall routines, such as
notify_change(), with an eye to calling it from FS-Cache to grow a file.  I
see that whilst notify_change() calls the inode-based LSM hooks (as drive
SELinux), it doesn't call the path-based LSM hooks (as drive other security
modules).  It leaves that to the callers, such as do_sys_ftruncate().

I see that vfs_mkdir(), for example, is similar, in that vfs_mkdir() - which
I'm calling from FS-Cache - invokes the inode-based LSM hooks, but it bypasses
the path-based LSM hooks as those are called from sys_mkdir().

It would appear that path-based LSM hooks may well be being called from the
wrong places.  They were added in:

	commit be6d3e56a6b9b3a4ee44a0685e39e595073c6f0d
	Author: Kentaro Takeda <takedakn@...data.co.jp>
	Date:   Wed Dec 17 13:24:15 2008 +0900

	    introduce new LSM hooks where vfsmount is available.

	    Add new LSM hooks for path-based checks.  Call them on directory-modifying
	    operations at the points where we still know the vfsmount involved.

	    Signed-off-by: Kentaro Takeda <takedakn@...data.co.jp>
	    Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
	    Signed-off-by: Toshiharu Harada <haradats@...data.co.jp>
	    Signed-off-by: Al Viro <viro@...iv.linux.org.uk>

Using sys_mkdir() and suchlike directly from within the kernel would add a lot
of overhead as I'd have to generate a full pathname for each call, whereas
vfs_mkdir() or notify_change() allows me to start from an inode I already
have.

David
--
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