1. 25 11月, 2008 1 次提交
    • S
      User namespaces: set of cleanups (v2) · 18b6e041
      Serge Hallyn 提交于
      The user_ns is moved from nsproxy to user_struct, so that a struct
      cred by itself is sufficient to determine access (which it otherwise
      would not be).  Corresponding ecryptfs fixes (by David Howells) are
      here as well.
      
      Fix refcounting.  The following rules now apply:
              1. The task pins the user struct.
              2. The user struct pins its user namespace.
              3. The user namespace pins the struct user which created it.
      
      User namespaces are cloned during copy_creds().  Unsharing a new user_ns
      is no longer possible.  (We could re-add that, but it'll cause code
      duplication and doesn't seem useful if PAM doesn't need to clone user
      namespaces).
      
      When a user namespace is created, its first user (uid 0) gets empty
      keyrings and a clean group_info.
      
      This incorporates a previous patch by David Howells.  Here
      is his original patch description:
      
      >I suggest adding the attached incremental patch.  It makes the following
      >changes:
      >
      > (1) Provides a current_user_ns() macro to wrap accesses to current's user
      >     namespace.
      >
      > (2) Fixes eCryptFS.
      >
      > (3) Renames create_new_userns() to create_user_ns() to be more consistent
      >     with the other associated functions and because the 'new' in the name is
      >     superfluous.
      >
      > (4) Moves the argument and permission checks made for CLONE_NEWUSER to the
      >     beginning of do_fork() so that they're done prior to making any attempts
      >     at allocation.
      >
      > (5) Calls create_user_ns() after prepare_creds(), and gives it the new creds
      >     to fill in rather than have it return the new root user.  I don't imagine
      >     the new root user being used for anything other than filling in a cred
      >     struct.
      >
      >     This also permits me to get rid of a get_uid() and a free_uid(), as the
      >     reference the creds were holding on the old user_struct can just be
      >     transferred to the new namespace's creator pointer.
      >
      > (6) Makes create_user_ns() reset the UIDs and GIDs of the creds under
      >     preparation rather than doing it in copy_creds().
      >
      >David
      
      >Signed-off-by: David Howells <dhowells@redhat.com>
      
      Changelog:
      	Oct 20: integrate dhowells comments
      		1. leave thread_keyring alone
      		2. use current_user_ns() in set_user()
      Signed-off-by: NSerge Hallyn <serue@us.ibm.com>
      18b6e041
  2. 20 11月, 2008 2 次提交
  3. 18 11月, 2008 7 次提交
    • J
      Merge branch 'master' into next · f3a5c547
      James Morris 提交于
      Conflicts:
      	fs/cifs/misc.c
      
      Merge to resolve above, per the patch below.
      Signed-off-by: NJames Morris <jmorris@namei.org>
      
      diff --cc fs/cifs/misc.c
      index ec36410,addd1dc..0000000
      --- a/fs/cifs/misc.c
      +++ b/fs/cifs/misc.c
      @@@ -347,13 -338,13 +338,13 @@@ header_assemble(struct smb_hdr *buffer
        		/*  BB Add support for establishing new tCon and SMB Session  */
        		/*      with userid/password pairs found on the smb session   */
        		/*	for other target tcp/ip addresses 		BB    */
       -				if (current->fsuid != treeCon->ses->linux_uid) {
       +				if (current_fsuid() != treeCon->ses->linux_uid) {
        					cFYI(1, ("Multiuser mode and UID "
        						 "did not match tcon uid"));
      - 					read_lock(&GlobalSMBSeslock);
      - 					list_for_each(temp_item, &GlobalSMBSessionList) {
      - 						ses = list_entry(temp_item, struct cifsSesInfo, cifsSessionList);
      + 					read_lock(&cifs_tcp_ses_lock);
      + 					list_for_each(temp_item, &treeCon->ses->server->smb_ses_list) {
      + 						ses = list_entry(temp_item, struct cifsSesInfo, smb_ses_list);
       -						if (ses->linux_uid == current->fsuid) {
       +						if (ses->linux_uid == current_fsuid()) {
        							if (ses->server == treeCon->ses->server) {
        								cFYI(1, ("found matching uid substitute right smb_uid"));
        								buffer->Uid = ses->Suid;
      f3a5c547
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 · 4e14e833
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
        prevent cifs_writepages() from skipping unwritten pages
        Fixed parsing of mount options when doing DFS submount
        [CIFS] Fix check for tcon seal setting and fix oops on failed mount from earlier patch
        [CIFS] Fix build break
        cifs: reinstate sharing of tree connections
        [CIFS] minor cleanup to cifs_mount
        cifs: reinstate sharing of SMB sessions sans races
        cifs: disable sharing session and tcon and add new TCP sharing code
        [CIFS] clean up server protocol handling
        [CIFS] remove unused list, add new cifs sock list to prepare for mount/umount fix
        [CIFS] Fix cifs reconnection flags
        [CIFS] Can't rely on iov length and base when kernel_recvmsg returns error
      4e14e833
    • D
      prevent cifs_writepages() from skipping unwritten pages · b066a48c
      Dave Kleikamp 提交于
      Fixes a data corruption under heavy stress in which pages could be left
      dirty after all open instances of a inode have been closed.
      
      In order to write contiguous pages whenever possible, cifs_writepages()
      asks pagevec_lookup_tag() for more pages than it may write at one time.
      Normally, it then resets index just past the last page written before calling
      pagevec_lookup_tag() again.
      
      If cifs_writepages() can't write the first page returned, it wasn't resetting
      index, and the next call to pagevec_lookup_tag() resulted in skipping all of
      the pages it previously returned, even though cifs_writepages() did nothing
      with them.  This can result in data loss when the file descriptor is about
      to be closed.
      
      This patch ensures that index gets set back to the next returned page so
      that none get skipped.
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Cc: Shirish S Pargaonkar <shirishp@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b066a48c
    • I
      Fixed parsing of mount options when doing DFS submount · 2c55608f
      Igor Mammedov 提交于
      Since these hit the same routines, and are relatively small, it is easier to review
      them as one patch.
      
      Fixed incorrect handling of the last option in some cases
      Fixed prefixpath handling convert path_consumed into host depended string length (in bytes)
      Use non default separator if it is provided in the original mount options
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NIgor Mammedov <niallain@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      2c55608f
    • K
      Remove -mno-spe flags as they dont belong · 65ecc14a
      Kumar Gala 提交于
      For some unknown reason at Steven Rostedt added in disabling of the SPE
      instruction generation for e500 based PPC cores in commit
      6ec56232.
      
      We are removing it because:
      
      1. It generates e500 kernels that don't work
      2. its not the correct set of flags to do this
      3. we handle this in the arch/powerpc/Makefile already
      4. its unknown in talking to Steven why he did this
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      Tested-and-Acked-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      65ecc14a
    • L
      Merge branch 'for-linus' of git://git.o-hand.com/linux-mfd · e77a20e8
      Linus Torvalds 提交于
      * 'for-linus' of git://git.o-hand.com/linux-mfd:
        mfd: Correct WM8350 I2C return code usage
        mfd: fix event masking for da9030
      e77a20e8
    • S
      [CIFS] Fix check for tcon seal setting and fix oops on failed mount from earlier patch · ab3f9929
      Steve French 提交于
      set tcon->ses earlier
      
      If the inital tree connect fails, we'll end up calling cifs_put_smb_ses
      with a NULL pointer. Fix it by setting the tcon->ses earlier.
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ab3f9929
  4. 17 11月, 2008 15 次提交
  5. 16 11月, 2008 15 次提交