On Wed, May 21, 2003 at 11:37:46AM -0700, Seth Arnold wrote: > On Wed, May 21, 2003 at 10:36:36AM -0700, Michael Halcrow wrote: > > Anyone have any good ways of chmod'ing a file from inside an LSM > > module? No hacks, please. :-) > > Take a look at sys_chmod() for some ideas how it should work. The kernel > source most easily available to me appears to go through some hoops with > struct iattr newattrs, performs the mode masking operations on the > structure, then uses notify_change() to perform the modifications. > (This is probably to assist tools such as the file access monitor, used > in many explorer.exe-work-alikes.) > > I hope this helps... I've been trying to re-implement sys_chmod inside of my LSM, but I keep getting errno=14 every time I use __user_walk to get the dentry for my file. This is the EFAULT error code, which indicates that one of the arguments may be an invalid pointer. I have checked my pointers carefully, and they are valid. I tried allocating the memory those pointers point to via __get_free_page, but that did not help. Is there some sort of dark magic that I have yet to become acquainted with in order for this to work? Mike -- ------------------------------------------- | --------------------- Michael Halcrow | mhalcrowat_private Developer, IBM Linux Technology Center | | ------------------------------------------- | --------------------- GnuPG Keyprint: 05B5 08A8 713A 64C1 D35D 2371 2D3C FDDA 3EB6 601D
This archive was generated by hypermail 2b30 : Thu May 22 2003 - 09:16:29 PDT