Re: Pass struct vfsmount to the inode_create LSM hook
- From: Tetsuo Handa <penguin-fsdevel@xxxxxxxxxxxxxxxxxxx>
- Date: Sat, 26 May 2007 23:44:46 +0900
Hello.
Andreas Gruenbacher wrote:
TOMOYO Linux ristricts argv[0] using allow_argv0 syntax.Therefore, TOMOYO Linux checks the combination of filename and argv[0]So you are indeed trying to control the value of argv[0]? Well, good luck with
passed to execve().
that, but it's totally insane. You are guaranteed to break some applications.
"allow_argv0 /bin/bash -bash" to allow passing "/bin/bash" to filename and "-bash" to argv[0] .
"allow_argv0 /bin/gzip gunzip" to allow passing "/bin/gzip" to filename and "gunzip" to argv[0] .
"allow_argv0 /sbin/busybox cat" to allow passing "/sbin/busybox" to filename and "cat" to argv[0] .
No need to use allow_argv0 syntax if the basename of filename and basename of argv[0] are the same
(i.e. "allow_argv0 /bin/bash bash" is not required).
TOMOYO Linux doesn't unconditionally forbid passing different values for filename and argv[0].
TOMOYO Linux allows passing different values for filename and argv[0] only if it is allowed by allow_argv0 syntax.
Could you please explain me why this approach breaks applications?
If /bin/cat and /bin/rm are binaries or hardlinks to the same busybox binaryIt is true if all processes are kept under control (e.g. strict policy in SELinux).
(rather than symlinks), different profiles could be used for each of them.
If there is a process that is not kept under control (e.g. targeted policy in SELinux),
you can't protect the application.
For example, an administrator may wish to allow users run /bin/ls without applying profiles
because /bin/ls won't read/write the content of files. But a malicious user may pass
"/bin/ls" to filename and "rm" to argv[0] and "/etc/shadow" to argv[1].
A malicious user may pass "/bin/ls" to filename and "/usr/sbin/httpd" to argv[0],
resulting behave as /usr/sbin/httpd without applying profiles for /usr/sbin/httpd .
Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: Pass struct vfsmount to the inode_create LSM hook
- From: Kyle Moffett
- Re: Pass struct vfsmount to the inode_create LSM hook
- From: Andreas Gruenbacher
- Re: Pass struct vfsmount to the inode_create LSM hook
- References:
- Re: [AppArmor 01/41] Pass struct vfsmount to the inode_create LSM hook
- From: Casey Schaufler
- Re: [AppArmor 01/41] Pass struct vfsmount to the inode_create LSM hook
- From: Andreas Gruenbacher
- Re: Pass struct vfsmount to the inode_create LSM hook
- From: Tetsuo Handa
- Re: Pass struct vfsmount to the inode_create LSM hook
- From: Andreas Gruenbacher
- Re: [AppArmor 01/41] Pass struct vfsmount to the inode_create LSM hook
- Prev by Date: Re: 2.6.21.1 - 97% wait time on IDE operations
- Next by Date: [BUG] Warning in mm/slab.c:777
- Previous by thread: Re: Pass struct vfsmount to the inode_create LSM hook
- Next by thread: Re: Pass struct vfsmount to the inode_create LSM hook
- Index(es):
Relevant Pages
|