24 Jun, 2005

6 commits

  • Add a new `suid_dumpable' sysctl:

    This value can be used to query and set the core dump mode for setuid
    or otherwise protected/tainted binaries. The modes are

    0 - (default) - traditional behaviour. Any process which has changed
    privilege levels or is execute only will not be dumped

    1 - (debug) - all processes dump core when possible. The core dump is
    owned by the current user and no security is applied. This is intended
    for system debugging situations only. Ptrace is unchecked.

    2 - (suidsafe) - any binary which normally would not be dumped is dumped
    readable by root only. This allows the end user to remove such a dump but
    not access it directly. For security reasons core dumps in this mode will
    not overwrite one another or other files. This mode is appropriate when
    adminstrators are attempting to debug problems in a normal environment.

    (akpm:

    > > +EXPORT_SYMBOL(suid_dumpable);
    >
    > EXPORT_SYMBOL_GPL?

    No problem to me.

    > > if (current->euid == current->uid && current->egid == current->gid)
    > > current->mm->dumpable = 1;
    >
    > Should this be SUID_DUMP_USER?

    Actually the feedback I had from last time was that the SUID_ defines
    should go because its clearer to follow the numbers. They can go
    everywhere (and there are lots of places where dumpable is tested/used
    as a bool in untouched code)

    > Maybe this should be renamed to `dump_policy' or something. Doing that
    > would help us catch any code which isn't using the #defines, too.

    Fair comment. The patch was designed to be easy to maintain for Red Hat
    rather than for merging. Changing that field would create a gigantic
    diff because it is used all over the place.

    )

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Use lookup_one_len instead of opencoding a simplified lookup using
    lookup_hash with a fake hash.

    Also there's no need anymore for the d_invalidate as we have a completely
    valid dentry now.

    Signed-off-by: Christoph Hellwig
    Acked-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Move some code duplicated in both callers into vfs_quota_on_mount

    Signed-off-by: Christoph Hellwig
    Acked-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Various filesystem drivers have grown a get_dentry() function that's a
    duplicate of lookup_one_len, except that it doesn't take a maximum length
    argument and doesn't check for \0 or / in the passed in filename.

    Switch all these places to use lookup_one_len.

    Signed-off-by: Christoph Hellwig
    Cc: Greg KH
    Cc: Paul Jackson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Patch to add check to get_chrdev_list and get_blkdev_list to prevent reads
    of /proc/devices from spilling over the provided page if more than 4096
    bytes of string data are generated from all the registered character and
    block devices in a system

    Signed-off-by: Neil Horman
    Cc: Christoph Hellwig
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Neil Horman
     
  • Based on analysis and a patch from Russ Weight

    There is a race condition that can occur if an inode is allocated and then
    released (using iput) during the ->fill_super functions. The race
    condition is between kswapd and mount.

    For most filesystems this can only happen in an error path when kswapd is
    running concurrently. For isofs, however, the error can occur in a more
    common code path (which is how the bug was found).

    The logic here is "we want final iput() to free inode *now* instead of
    letting it sit in cache if fs is going down or had not quite come up". The
    problem is with kswapd seeing such inodes in the middle of being killed and
    happily taking over.

    The clean solution would be to tell kswapd to leave those inodes alone and
    let our final iput deal with them. I.e. add a new flag
    (I_FORCED_FREEING), set it before write_inode_now() there and make
    prune_icache() leave those alone.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Viro
     

23 Jun, 2005

34 commits