1. 18 2月, 2007 1 次提交
  2. 14 2月, 2007 1 次提交
  3. 13 2月, 2007 1 次提交
    • M
      [PATCH] eCryptfs: Public key transport mechanism · 88b4a07e
      Michael Halcrow 提交于
      This is the transport code for public key functionality in eCryptfs.  It
      manages encryption/decryption request queues with a transport mechanism.
      Currently, netlink is the only implemented transport.
      
      Each inode has a unique File Encryption Key (FEK).  Under passphrase, a File
      Encryption Key Encryption Key (FEKEK) is generated from a salt/passphrase
      combo on mount.  This FEKEK encrypts each FEK and writes it into the header of
      each file using the packet format specified in RFC 2440.  This is all
      symmetric key encryption, so it can all be done via the kernel crypto API.
      
      These new patches introduce public key encryption of the FEK.  There is no
      asymmetric key encryption support in the kernel crypto API, so eCryptfs pushes
      the FEK encryption and decryption out to a userspace daemon.  After
      considering our requirements and determining the complexity of using various
      transport mechanisms, we settled on netlink for this communication.
      
      eCryptfs stores authentication tokens into the kernel keyring.  These tokens
      correlate with individual keys.  For passphrase mode of operation, the
      authentication token contains the symmetric FEKEK.  For public key, the
      authentication token contains a PKI type and an opaque data blob managed by
      individual PKI modules in userspace.
      
      Each user who opens a file under an eCryptfs partition mounted in public key
      mode must be running a daemon.  That daemon has the user's credentials and has
      access to all of the keys to which the user should have access.  The daemon,
      when started, initializes the pluggable PKI modules available on the system
      and registers itself with the eCryptfs kernel module.  Userspace utilities
      register public key authentication tokens into the user session keyring.
      These authentication tokens correlate key signatures with PKI modules and PKI
      blobs.  The PKI blobs contain PKI-specific information necessary for the PKI
      module to carry out asymmetric key encryption and decryption.
      
      When the eCryptfs module parses the header of an existing file and finds a Tag
      1 (Public Key) packet (see RFC 2440), it reads in the public key identifier
      (signature).  The asymmetrically encrypted FEK is in the Tag 1 packet;
      eCryptfs puts together a decrypt request packet containing the signature and
      the encrypted FEK, then it passes it to the daemon registered for the
      current->euid via a netlink unicast to the PID of the daemon, which was
      registered at the time the daemon was started by the user.
      
      The daemon actually just makes calls to libecryptfs, which implements request
      packet parsing and manages PKI modules.  libecryptfs grabs the public key
      authentication token for the given signature from the user session keyring.
      This auth tok tells libecryptfs which PKI module should receive the request.
      libecryptfs then makes a decrypt() call to the PKI module, and it passes along
      the PKI block from the auth tok.  The PKI uses the blob to figure out how it
      should decrypt the data passed to it; it performs the decryption and passes
      the decrypted data back to libecryptfs.  libecryptfs then puts together a
      reply packet with the decrypted FEK and passes that back to the eCryptfs
      module.
      
      The eCryptfs module manages these request callouts to userspace code via
      message context structs.  The module maintains an array of message context
      structs and places the elements of the array on two lists: a free and an
      allocated list.  When eCryptfs wants to make a request, it moves a msg ctx
      from the free list to the allocated list, sets its state to pending, and fires
      off the message to the user's registered daemon.
      
      When eCryptfs receives a netlink message (via the callback), it correlates the
      msg ctx struct in the alloc list with the data in the message itself.  The
      msg->index contains the offset of the array of msg ctx structs.  It verifies
      that the registered daemon PID is the same as the PID of the process that sent
      the message.  It also validates a sequence number between the received packet
      and the msg ctx.  Then, it copies the contents of the message (the reply
      packet) into the msg ctx struct, sets the state in the msg ctx to done, and
      wakes up the process that was sleeping while waiting for the reply.
      
      The sleeping process was whatever was performing the sys_open().  This process
      originally called ecryptfs_send_message(); it is now in
      ecryptfs_wait_for_response().  When it wakes up and sees that the msg ctx
      state was set to done, it returns a pointer to the message contents (the reply
      packet) and returns.  If all went well, this packet contains the decrypted
      FEK, which is then copied into the crypt_stat struct, and life continues as
      normal.
      
      The case for creation of a new file is very similar, only instead of a decrypt
      request, eCryptfs sends out an encrypt request.
      
      > - We have a great clod of key mangement code in-kernel.  Why is that
      >   not suitable (or growable) for public key management?
      
      eCryptfs uses Howells' keyring to store persistent key data and PKI state
      information.  It defers public key cryptographic transformations to userspace
      code.  The userspace data manipulation request really is orthogonal to key
      management in and of itself.  What eCryptfs basically needs is a secure way to
      communicate with a particular daemon for a particular task doing a syscall,
      based on the UID.  Nothing running under another UID should be able to access
      that channel of communication.
      
      > - Is it appropriate that new infrastructure for public key
      > management be private to a particular fs?
      
      The messaging.c file contains a lot of code that, perhaps, could be extracted
      into a separate kernel service.  In essence, this would be a sort of
      request/reply mechanism that would involve a userspace daemon.  I am not aware
      of anything that does quite what eCryptfs does, so I was not aware of any
      existing tools to do just what we wanted.
      
      >   What happens if one of these daemons exits without sending a quit
      >   message?
      
      There is a stale uid<->pid association in the hash table for that user.  When
      the user registers a new daemon, eCryptfs cleans up the old association and
      generates a new one.  See ecryptfs_process_helo().
      
      > - _why_ does it use netlink?
      
      Netlink provides the transport mechanism that would minimize the complexity of
      the implementation, given that we can have multiple daemons (one per user).  I
      explored the possibility of using relayfs, but that would involve having to
      introduce control channels and a protocol for creating and tearing down
      channels for the daemons.  We do not have to worry about any of that with
      netlink.
      Signed-off-by: NMichael Halcrow <mhalcrow@us.ibm.com>
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      88b4a07e
  4. 12 2月, 2007 1 次提交
  5. 08 2月, 2007 1 次提交
  6. 23 12月, 2006 1 次提交
  7. 13 12月, 2006 2 次提交
  8. 30 11月, 2006 2 次提交
  9. 17 11月, 2006 1 次提交
  10. 25 10月, 2006 1 次提交
  11. 21 10月, 2006 1 次提交
    • R
      [PATCH] fs/Kconfig: move GENERIC_ACL, fix acl() call errors · f2fbc6c2
      Randy Dunlap 提交于
      GENERIC_ACL shouldn't be under Network File Systems (which made it depend
      on NET) as far as I can tell.  Having it there and having many (FS) config
      symbols disabled gives this (which the patch fixes):
      
      mm/built-in.o: In function `shmem_check_acl':
      shmem_acl.c:(.text.shmem_check_acl+0x33): undefined reference to `posix_acl_permission'
      fs/built-in.o: In function `generic_acl_get':
      (.text.generic_acl_get+0x30): undefined reference to `posix_acl_to_xattr'
      fs/built-in.o: In function `generic_acl_set':
      (.text.generic_acl_set+0x75): undefined reference to `posix_acl_from_xattr'
      fs/built-in.o: In function `generic_acl_set':
      (.text.generic_acl_set+0x94): undefined reference to `posix_acl_valid'
      fs/built-in.o: In function `generic_acl_set':
      (.text.generic_acl_set+0xc1): undefined reference to `posix_acl_equiv_mode'
      fs/built-in.o: In function `generic_acl_init':
      (.text.generic_acl_init+0x7a): undefined reference to `posix_acl_clone'
      fs/built-in.o: In function `generic_acl_init':
      (.text.generic_acl_init+0xb4): undefined reference to `posix_acl_clone'
      fs/built-in.o: In function `generic_acl_init':
      (.text.generic_acl_init+0xc8): undefined reference to `posix_acl_create_masq'
      fs/built-in.o: In function `generic_acl_chmod':
      (.text.generic_acl_chmod+0x49): undefined reference to `posix_acl_clone'
      fs/built-in.o: In function `generic_acl_chmod':
      (.text.generic_acl_chmod+0x76): undefined reference to `posix_acl_chmod_masq'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: NAndreas Gruenbacher <agruen@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f2fbc6c2
  12. 12 10月, 2006 3 次提交
  13. 04 10月, 2006 4 次提交
  14. 01 10月, 2006 1 次提交
    • D
      [PATCH] BLOCK: Make it possible to disable the block layer [try #6] · 9361401e
      David Howells 提交于
      Make it possible to disable the block layer.  Not all embedded devices require
      it, some can make do with just JFFS2, NFS, ramfs, etc - none of which require
      the block layer to be present.
      
      This patch does the following:
      
       (*) Introduces CONFIG_BLOCK to disable the block layer, buffering and blockdev
           support.
      
       (*) Adds dependencies on CONFIG_BLOCK to any configuration item that controls
           an item that uses the block layer.  This includes:
      
           (*) Block I/O tracing.
      
           (*) Disk partition code.
      
           (*) All filesystems that are block based, eg: Ext3, ReiserFS, ISOFS.
      
           (*) The SCSI layer.  As far as I can tell, even SCSI chardevs use the
           	 block layer to do scheduling.  Some drivers that use SCSI facilities -
           	 such as USB storage - end up disabled indirectly from this.
      
           (*) Various block-based device drivers, such as IDE and the old CDROM
           	 drivers.
      
           (*) MTD blockdev handling and FTL.
      
           (*) JFFS - which uses set_bdev_super(), something it could avoid doing by
           	 taking a leaf out of JFFS2's book.
      
       (*) Makes most of the contents of linux/blkdev.h, linux/buffer_head.h and
           linux/elevator.h contingent on CONFIG_BLOCK being set.  sector_div() is,
           however, still used in places, and so is still available.
      
       (*) Also made contingent are the contents of linux/mpage.h, linux/genhd.h and
           parts of linux/fs.h.
      
       (*) Makes a number of files in fs/ contingent on CONFIG_BLOCK.
      
       (*) Makes mm/bounce.c (bounce buffering) contingent on CONFIG_BLOCK.
      
       (*) set_page_dirty() doesn't call __set_page_dirty_buffers() if CONFIG_BLOCK
           is not enabled.
      
       (*) fs/no-block.c is created to hold out-of-line stubs and things that are
           required when CONFIG_BLOCK is not set:
      
           (*) Default blockdev file operations (to give error ENODEV on opening).
      
       (*) Makes some /proc changes:
      
           (*) /proc/devices does not list any blockdevs.
      
           (*) /proc/diskstats and /proc/partitions are contingent on CONFIG_BLOCK.
      
       (*) Makes some compat ioctl handling contingent on CONFIG_BLOCK.
      
       (*) If CONFIG_BLOCK is not defined, makes sys_quotactl() return -ENODEV if
           given command other than Q_SYNC or if a special device is specified.
      
       (*) In init/do_mounts.c, no reference is made to the blockdev routines if
           CONFIG_BLOCK is not defined.  This does not prohibit NFS roots or JFFS2.
      
       (*) The bdflush, ioprio_set and ioprio_get syscalls can now be absent (return
           error ENOSYS by way of cond_syscall if so).
      
       (*) The seclvl_bd_claim() and seclvl_bd_release() security calls do nothing if
           CONFIG_BLOCK is not set, since they can't then happen.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      9361401e
  15. 30 9月, 2006 2 次提交
    • A
      [PATCH] Access Control Lists for tmpfs · 39f0247d
      Andreas Gruenbacher 提交于
      Add access control lists for tmpfs.
      Signed-off-by: NAndreas Gruenbacher <agruen@suse.de>
      Cc: Hugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      39f0247d
    • A
      [PATCH] Generic infrastructure for acls · f0c8bd16
      Andreas Gruenbacher 提交于
      The patches solve the following problem: We want to grant access to devices
      based on who is logged in from where, etc.  This includes switching back and
      forth between multiple user sessions, etc.
      
      Using ACLs to define device access for logged-in users gives us all the
      flexibility we need in order to fully solve the problem.
      
      Device special files nowadays usually live on tmpfs, hence tmpfs ACLs.
      
      Different distros have come up with solutions that solve the problem to
      different degrees: SUSE uses a resource manager which tracks login sessions
      and sets ACLs on device inodes as appropriate.  RedHat uses pam_console, which
      changes the primary file ownership to the logged-in user.  Others use a set of
      groups that users must be in in order to be granted the appropriate accesses.
      
      The freedesktop.org project plans to implement a combination of a
      console-tracker and a HAL-device-list based solution to grant access to
      devices to users, and more distros will likely follow this approach.
      
      These patches have first been posted here on 2 February 2005, and again
      on 8 January 2006. We have been shipping them in SLES9 and SLES10 with
      no problems reported.  The previous submission is archived here:
      
         http://lkml.org/lkml/2006/1/8/229
         http://lkml.org/lkml/2006/1/8/230
         http://lkml.org/lkml/2006/1/8/231
      
      This patch:
      
      Add some infrastructure for access control lists on in-memory
      filesystems such as tmpfs.
      Signed-off-by: NAndreas Gruenbacher <agruen@suse.de>
      Cc: Hugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f0c8bd16
  16. 27 9月, 2006 1 次提交
  17. 23 9月, 2006 1 次提交
  18. 21 9月, 2006 1 次提交
  19. 08 7月, 2006 1 次提交
  20. 30 6月, 2006 2 次提交
  21. 27 6月, 2006 2 次提交
  22. 26 6月, 2006 3 次提交
  23. 23 6月, 2006 1 次提交
  24. 20 6月, 2006 1 次提交
  25. 18 6月, 2006 1 次提交
  26. 02 6月, 2006 1 次提交
  27. 01 6月, 2006 1 次提交
  28. 13 5月, 2006 1 次提交
    • K
      [JFFS2][XATTR] XATTR support on JFFS2 (version. 5) · aa98d7cf
      KaiGai Kohei 提交于
      This attached patches provide xattr support including POSIX-ACL and
      SELinux support on JFFS2 (version.5).
      
      There are some significant differences from previous version posted
      at last December.
      The biggest change is addition of EBS(Erase Block Summary) support.
      Currently, both kernel and usermode utility (sumtool) can recognize
      xattr nodes which have JFFS2_NODETYPE_XATTR/_XREF nodetype.
      
      In addition, some bugs are fixed.
      - A potential race condition was fixed.
      - Unexpected fail when updating a xattr by same name/value pair was fixed.
      - A bug when removing xattr name/value pair was fixed.
      
      The fundamental structures (such as using two new nodetypes and exclusion
      mechanism by rwsem) are unchanged. But most of implementation were reviewed
      and updated if necessary.
      Espacially, we had to change several internal implementations related to
      load_xattr_datum() to avoid a potential race condition.
      
      [1/2] xattr_on_jffs2.kernel.version-5.patch
      [2/2] xattr_on_jffs2.utils.version-5.patch
      Signed-off-by: NKaiGai Kohei <kaigai@ak.jp.nec.com>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      aa98d7cf