1. 29 4月, 2008 6 次提交
    • D
      keys: allow the callout data to be passed as a blob rather than a string · 4a38e122
      David Howells 提交于
      Allow the callout data to be passed as a blob rather than a string for
      internal kernel services that call any request_key_*() interface other than
      request_key().  request_key() itself still takes a NUL-terminated string.
      
      The functions that change are:
      
      	request_key_with_auxdata()
      	request_key_async()
      	request_key_async_with_auxdata()
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Paul Moore <paul.moore@hp.com>
      Cc: Chris Wright <chrisw@sous-sol.org>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: James Morris <jmorris@namei.org>
      Cc: Kevin Coffman <kwc@citi.umich.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4a38e122
    • K
      keys: check starting keyring as part of search · dceba994
      Kevin Coffman 提交于
      Check the starting keyring as part of the search to (a) see if that is what
      we're searching for, and (b) to check it is still valid for searching.
      
      The scenario: User in process A does things that cause things to be created in
      its process session keyring.  The user then does an su to another user and
      starts a new process, B.  The two processes now share the same process session
      keyring.
      
      Process B does an NFS access which results in an upcall to gssd.  When gssd
      attempts to instantiate the context key (to be linked into the process session
      keyring), it is denied access even though it has an authorization key.
      
      The order of calls is:
      
         keyctl_instantiate_key()
            lookup_user_key()				    (the default: case)
               search_process_keyrings(current)
      	    search_process_keyrings(rka->context)   (recursive call)
      	       keyring_search_aux()
      
      keyring_search_aux() verifies the keys and keyrings underneath the top-level
      keyring it is given, but that top-level keyring is neither fully validated nor
      checked to see if it is the thing being searched for.
      
      This patch changes keyring_search_aux() to:
      1) do more validation on the top keyring it is given and
      2) check whether that top-level keyring is the thing being searched for
      Signed-off-by: NKevin Coffman <kwc@citi.umich.edu>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Paul Moore <paul.moore@hp.com>
      Cc: Chris Wright <chrisw@sous-sol.org>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: James Morris <jmorris@namei.org>
      Cc: Kevin Coffman <kwc@citi.umich.edu>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dceba994
    • D
      keys: increase the payload size when instantiating a key · 38bbca6b
      David Howells 提交于
      Increase the size of a payload that can be used to instantiate a key in
      add_key() and keyctl_instantiate_key().  This permits huge CIFS SPNEGO blobs
      to be passed around.  The limit is raised to 1MB.  If kmalloc() can't allocate
      a buffer of sufficient size, vmalloc() will be tried instead.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Paul Moore <paul.moore@hp.com>
      Cc: Chris Wright <chrisw@sous-sol.org>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: James Morris <jmorris@namei.org>
      Cc: Kevin Coffman <kwc@citi.umich.edu>
      Cc: Steven French <sfrench@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      38bbca6b
    • S
      cgroups: introduce cft->read_seq() · 29486df3
      Serge E. Hallyn 提交于
      Introduce a read_seq() helper in cftype, which uses seq_file to print out
      lists.  Use it in the devices cgroup.  Also split devices.allow into two
      files, so now devices.deny and devices.allow are the ones to use to manipulate
      the whitelist, while devices.list outputs the cgroup's current whitelist.
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Acked-by: NPaul Menage <menage@google.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      29486df3
    • S
      cgroups: implement device whitelist · 08ce5f16
      Serge E. Hallyn 提交于
      Implement a cgroup to track and enforce open and mknod restrictions on device
      files.  A device cgroup associates a device access whitelist with each cgroup.
       A whitelist entry has 4 fields.  'type' is a (all), c (char), or b (block).
      'all' means it applies to all types and all major and minor numbers.  Major
      and minor are either an integer or * for all.  Access is a composition of r
      (read), w (write), and m (mknod).
      
      The root device cgroup starts with rwm to 'all'.  A child devcg gets a copy of
      the parent.  Admins can then remove devices from the whitelist or add new
      entries.  A child cgroup can never receive a device access which is denied its
      parent.  However when a device access is removed from a parent it will not
      also be removed from the child(ren).
      
      An entry is added using devices.allow, and removed using
      devices.deny.  For instance
      
      	echo 'c 1:3 mr' > /cgroups/1/devices.allow
      
      allows cgroup 1 to read and mknod the device usually known as
      /dev/null.  Doing
      
      	echo a > /cgroups/1/devices.deny
      
      will remove the default 'a *:* mrw' entry.
      
      CAP_SYS_ADMIN is needed to change permissions or move another task to a new
      cgroup.  A cgroup may not be granted more permissions than the cgroup's parent
      has.  Any task can move itself between cgroups.  This won't be sufficient, but
      we can decide the best way to adequately restrict movement later.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: fix may-be-used-uninitialized warning]
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Looks-good-to: Pavel Emelyanov <xemul@openvz.org>
      Cc: Daniel Hokka Zakrisson <daniel@hozac.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Paul Menage <menage@google.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      08ce5f16
    • D
      xattr: add missing consts to function arguments · 8f0cfa52
      David Howells 提交于
      Add missing consts to xattr function arguments.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Andreas Gruenbacher <agruen@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8f0cfa52
  2. 28 4月, 2008 17 次提交
  3. 22 4月, 2008 3 次提交
  4. 21 4月, 2008 14 次提交
    • E
      SELinux: one little, two little, three little whitespaces, the avc.c saga. · 95fff33b
      Eric Paris 提交于
      avc.c was bad.  It had whitespace and syntax issues which are against
      our coding style.  I have had a little chat with it and the result of
      that conversation looked like this patch.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      95fff33b
    • E
      SELinux: cleanup on isle selinuxfs.c · 1872981b
      Eric Paris 提交于
      Why would anyone just clean up white space all day?  Because they were
      out too late last night and don't want to think for a day.  So here is a
      nice clean selinuxfs.c patch.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      1872981b
    • E
      changing whitespace for fun and profit: policydb.c · 2ced3dfd
      Eric Paris 提交于
      More formatting changes.  Aside from the 80 character line limit even
      the checkpatch scripts like this file now.  Too bad I don't get paid by
      the lines of code I change.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      2ced3dfd
    • E
      SELinux: whitespace and formating fixes for hooks.c · 828dfe1d
      Eric Paris 提交于
      All whitespace and formatting.  Nothing interesting to see here.  About
      the only thing to remember is that we aren't supposed to initialize
      static variables to 0/NULL.  It is done for us and doing it ourselves
      puts them in a different section.
      
      With this patch running checkpatch.pl against hooks.c only gives us
      complaints about busting the 80 character limit and declaring extern's
      in .c files.  Apparently they don't like it, but I don't feel like going
      to the trouble of moving those to .h files...
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      828dfe1d
    • E
      SELinux: clean up printks · 744ba35e
      Eric Paris 提交于
      Make sure all printk start with KERN_*
      Make sure all printk end with \n
      Make sure all printk have the word 'selinux' in them
      Change "function name" to "%s", __func__ (found 2 wrong)
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      744ba35e
    • E
      SELinux: sidtab.c whitespace, syntax, and static declaraction cleanups · 11670889
      Eric Paris 提交于
      This patch changes sidtab.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      11670889
    • E
      SELinux: services.c whitespace, syntax, and static declaraction cleanups · 5d55a345
      Eric Paris 提交于
      This patch changes services.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      5d55a345
    • E
      SELinux: mls.c whitespace, syntax, and static declaraction cleanups · 1a5e6f87
      Eric Paris 提交于
      This patch changes mls.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      1a5e6f87
    • E
      SELinux: hashtab.c whitespace, syntax, and static declaraction cleanups · 719a2f8e
      Eric Paris 提交于
      This patch changes hashtab.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      719a2f8e
    • E
      SELinux: ebitmap.c whitespace, syntax, and static declaraction cleanups · 7696ee80
      Eric Paris 提交于
      This patch changes ebitmap.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      7696ee80
    • E
      SELinux: conditional.c whitespace, syntax, and static declaraction cleanups · 7c2b240e
      Eric Paris 提交于
      This patch changes conditional.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      7c2b240e
    • E
      SELinux: avtab.c whitespace, syntax, and static declaraction cleanups · eb5df9a7
      Eric Paris 提交于
      This patch changes avtab.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      eb5df9a7
    • E
      SELinux: xfrm.c whitespace, syntax, and static declaraction cleanups · 3c1c88ab
      Eric Paris 提交于
      This patch changes xfrm.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      3c1c88ab
    • E
      SELinux: nlmsgtab.c whitespace, syntax, and static declaraction cleanups · bfff3aa4
      Eric Paris 提交于
      This patch changes nlmsgtab.c to fix whitespace and syntax issues.  Things that
      are fixed may include (does not not have to include)
      
      whitespace at end of lines
      spaces followed by tabs
      spaces used instead of tabs
      spacing around parenthesis
      locateion of { around struct and else clauses
      location of * in pointer declarations
      removal of initialization of static data to keep it in the right section
      useless {} in if statemetns
      useless checking for NULL before kfree
      fixing of the indentation depth of switch statements
      and any number of other things I forgot to mention
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      bfff3aa4