RE: how do you call userspace syscalls (e.g. sys_rename) from inside kernel

From: Jirka Kosina (jikos_at_jikos.cz)
Date: 10/11/04

  • Next message: Pavel Machek: "Re: Totally broken PCI PM calls"
    Date:	Mon, 11 Oct 2004 11:56:18 +0200 (CEST)
    To: Aboo Valappil <aboo@ABOOSPLANET.com>
    
    

    On Mon, 11 Oct 2004, Aboo Valappil wrote:

    > In the past I looked in to open, read and write a file from a kernel
    > module. But problem I faced using the kernel function was that it
    > checks for the permissions of the file and path against the "current"
    > process. For eg: open_namei() function ... My requirement was to open
    > the file regardless of the permissions on the file and also not by
    > modifying task_struct of the current process to change the permissions
    > first ! I also wanted not associate the file with the current/any
    > processes. Any ideas on this ?

    1) This is offtopic on LKML, kernelnewbies might be more apropriate list
    2) look at set_fs() and filp_open() calls, they might be useful for you
    3) Think twice if opening files from kernel is the thing you are willing
    to do

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

  • Next message: Pavel Machek: "Re: Totally broken PCI PM calls"

    Relevant Pages

    • Re: whats next for the linux kernel?
      ... `ls -l' can show you the complete permissions of a lot of files in a few ... permission and some of the inheritees' permissions might suddenly make ... including UTF-8 canoncalization code, inside the kernel. ... complex and thus, when they *do* fail, the failures are correspondingly ...
      (Linux-Kernel)
    • Re: scanning sysfs to populate /dev
      ... | perspective there doesn't seem to be a way to acquire permissions data. ... | if you have to compile it into the kernel image. ... The config file could be done, but it is just a different way ... | filesystems why would you need to do anything more from early userspace when you ...
      (comp.os.linux.development.system)
    • Re: [RFC] FUSE permission modell (Was: fuse review bits)
      ... >> root is denied all access. ... and the kernel checks the permission. ... The userspace can't enforce the permissions. ...
      (Linux-Kernel)
    • Re: scanning sysfs to populate /dev
      ... the kernel only deals with devices by their device code. ... > Having a device namespace in the kernel, is a departure from that philosophy. ... > external policy, and now it is migrating to device drivers. ... permissions for any nodes it just creates them with the default permissions ...
      (comp.os.linux.development.system)
    • Re: Function to verify a virtual address?
      ... [The Win32 API VirtualQuery() is vastly superior ... 0xffffe000 on 32-bit architectures, and sometimes the permissions ... This is a bug that the kernel maintainers show no interest in fixing. ... if the process does not have Read permission to the memory. ...
      (comp.os.linux.development.apps)