Hello. Indan Zupancic wrote:It depends. Some users have to continue using brain dead legacy applications without modification because ... the application's source code is not available. the distributor no longer supports the application. the application is too difficult/complicated to reconstruct. For cases where you can expect "application won't do brain dead things" and/or "we can reconstruct application", your approach is OK. I assume "a static /dev/" means a /dev/ directory in 2.4 kernels. This filesystem's advantage: (1) Can guarantee filename/attribute pairs. A process with "root" privilege can do "mv /dev/hda1 /dev/hda1.tmp; mv /dev/hda2 /dev/hda1; mv /dev/hda1.tmp /dev/hda2" if /dev is in / partition or is a devfs partition, whereas a process with "root" privilege cannot do "mv /dev/hda1 /dev/hda1.tmp; mv /dev/hda2 /dev/hda1; mv /dev/hda1.tmp /dev/hda2" if /dev is this filesystem unless granted by the configuration file. So, you can guarantee that /dev/hda1 is block-3-1 and /dev/hda2 is block-3-2 . (e.g. "mount /dev/hda1 /home" won't mount block-3-2 partition on /home .) (2) Can keep nodes that needn't to be deleted/modified for read-only. A process with "root" privilege can delete /dev/null on / partition or on devfs partition, whereas a process with "root" privilege cannot delete /dev/null on this filesystem unless granted by the configuration file. So, you can guarantee the node which needn't to be deleted/modified won't be deleted/modified. (e.g. /dev/null is always there with char-1-3 attribute.) (3) Can hide unwanted device nodes. A process with "root" privilege can create new nodes on / partition or on devfs, whereas a process with "root" privilege cannot create new nodes on this filesystem that are not specified by configuration file. So, you can expose specific nodes selectively. (e.g. Allow accessing /dev/hda1 , but forbid accessing /dev/hda2 .) I don't know. I'm not using rare software. No. The kernel must be involved. Suppose the tiny daemon is the only one allowed to modify /dev/ . "foo" requests "mknod /dev/null" from chroot() environment. "bar" requests "mknod /dev/null" from clone(CLONE_FS) + mount() environment. How can the daemon know where to create the node? How can the daemon determine whether the requested pathname is in /dev directory or not? The process who requests "mknod" and the process who performs "mknod" are not always using the same "/" directory. The daemon must not forbid creation of /dev/null if the realpath() is /tmp/dev/null (i.e. "mknod /dev/null" after "chroot /tmp"), because the daemon is not asked to manage /tmp/dev directory. Who can guarantee that the daemon can access all namespaces? The process who requests "mknod" and the process who performs "mknod" are not always using the same namespace. If "foo" or "bar" is a statically linked or suid-root application (where LD_PRELOAD is ignored), they would attempt to create device nodes directly (i.e. call sys_mknod() instead of communicating with the daemon) and abort due to failure. Not only applications who wants to create device nodes in /dev/ , but also all applications who wants to modify entries in /dev/ . From the beginning, the kernel is deeply involved because in-kernel MAC is essential to realize "only the tiny daemon can modify /dev/". Why not do this "filename/attribute" checking in the kernel too? You will be bothered with "what is the realpath of /dev/null?" and "how can I reach the realpath?" because you have to manage namespace information. In the LSM list, there was a discussion of "How to implement (pathname based) AppArmor using (label based) SELinux", and somebody proposed to use a daemon that immediately updates labels of accessed files. But I think such daemon cannot always access to all namespaces. OK. I'll consider adding this feature. But I'd like to use approach (B) to keep the advantage (3). (A) White-listing + Black-listing approach. "Permit any operations if the filename didn't appear in the configuration file". (B) White-listing + Wild-card approach. "Support wildcard and permit only operations if the filename-with-wildcard/attributes-with-wildcard appeared in the configuration file". Thanks. - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Peter Zijlstra | [PATCH 00/23] per device dirty throttling -v8 |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| Frans Pop | svc: failed to register lockdv1 RPC service (errno 97). |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
