1. 26 10月, 2013 8 次提交
  2. 25 7月, 2013 1 次提交
  3. 29 6月, 2013 1 次提交
  4. 20 6月, 2013 2 次提交
  5. 18 4月, 2013 1 次提交
  6. 28 2月, 2013 1 次提交
    • S
      hlist: drop the node parameter from iterators · b67bfe0d
      Sasha Levin 提交于
      I'm not sure why, but the hlist for each entry iterators were conceived
      
              list_for_each_entry(pos, head, member)
      
      The hlist ones were greedy and wanted an extra parameter:
      
              hlist_for_each_entry(tpos, pos, head, member)
      
      Why did they need an extra pos parameter? I'm not quite sure. Not only
      they don't really need it, it also prevents the iterator from looking
      exactly like the list iterator, which is unfortunate.
      
      Besides the semantic patch, there was some manual work required:
      
       - Fix up the actual hlist iterators in linux/list.h
       - Fix up the declaration of other iterators based on the hlist ones.
       - A very small amount of places were using the 'node' parameter, this
       was modified to use 'obj->member' instead.
       - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
       properly, so those had to be fixed up manually.
      
      The semantic patch which is mostly the work of Peter Senna Tschudin is here:
      
      @@
      iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;
      
      type T;
      expression a,c,d,e;
      identifier b;
      statement S;
      @@
      
      -T b;
          <+... when != b
      (
      hlist_for_each_entry(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue(a,
      - b,
      c) S
      |
      hlist_for_each_entry_from(a,
      - b,
      c) S
      |
      hlist_for_each_entry_rcu(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_rcu_bh(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue_rcu_bh(a,
      - b,
      c) S
      |
      for_each_busy_worker(a, c,
      - b,
      d) S
      |
      ax25_uid_for_each(a,
      - b,
      c) S
      |
      ax25_for_each(a,
      - b,
      c) S
      |
      inet_bind_bucket_for_each(a,
      - b,
      c) S
      |
      sctp_for_each_hentry(a,
      - b,
      c) S
      |
      sk_for_each(a,
      - b,
      c) S
      |
      sk_for_each_rcu(a,
      - b,
      c) S
      |
      sk_for_each_from
      -(a, b)
      +(a)
      S
      + sk_for_each_from(a) S
      |
      sk_for_each_safe(a,
      - b,
      c, d) S
      |
      sk_for_each_bound(a,
      - b,
      c) S
      |
      hlist_for_each_entry_safe(a,
      - b,
      c, d, e) S
      |
      hlist_for_each_entry_continue_rcu(a,
      - b,
      c) S
      |
      nr_neigh_for_each(a,
      - b,
      c) S
      |
      nr_neigh_for_each_safe(a,
      - b,
      c, d) S
      |
      nr_node_for_each(a,
      - b,
      c) S
      |
      nr_node_for_each_safe(a,
      - b,
      c, d) S
      |
      - for_each_gfn_sp(a, c, d, b) S
      + for_each_gfn_sp(a, c, d) S
      |
      - for_each_gfn_indirect_valid_sp(a, c, d, b) S
      + for_each_gfn_indirect_valid_sp(a, c, d) S
      |
      for_each_host(a,
      - b,
      c) S
      |
      for_each_host_safe(a,
      - b,
      c, d) S
      |
      for_each_mesh_entry(a,
      - b,
      c, d) S
      )
          ...+>
      
      [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
      [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
      [akpm@linux-foundation.org: checkpatch fixes]
      [akpm@linux-foundation.org: fix warnings]
      [akpm@linux-foudnation.org: redo intrusive kvm changes]
      Tested-by: NPeter Senna Tschudin <peter.senna@gmail.com>
      Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NSasha Levin <sasha.levin@oracle.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b67bfe0d
  7. 26 2月, 2013 1 次提交
  8. 25 2月, 2013 1 次提交
  9. 23 2月, 2013 1 次提交
  10. 07 2月, 2013 1 次提交
    • D
      ima: digital signature verification using asymmetric keys · e0751257
      Dmitry Kasatkin 提交于
      Asymmetric keys were introduced in linux-3.7 to verify the signature on
      signed kernel modules. The asymmetric keys infrastructure abstracts the
      signature verification from the crypto details. This patch adds IMA/EVM
      signature verification using asymmetric keys. Support for additional
      signature verification methods can now be delegated to the asymmetric
      key infrastructure.
      
      Although the module signature header and the IMA/EVM signature header
      could use the same format, to minimize the signature length and save
      space in the extended attribute, this patch defines a new IMA/EVM
      header format.  The main difference is that the key identifier is a
      sha1[12 - 19] hash of the key modulus and exponent, similar to the
      current implementation.  The only purpose of the key identifier is to
      identify the corresponding key in the kernel keyring.  ima-evm-utils
      was updated to support the new signature format.
      
      While asymmetric signature verification functionality supports many
      different hash algorithms, the hash used in this patch is calculated
      during the IMA collection phase, based on the configured algorithm.
      The default algorithm is sha1, but for backwards compatibility md5
      is supported.  Due to this current limitation, signatures should be
      generated using a sha1 hash algorithm.
      
      Changes in this patch:
      - Functionality has been moved to separate source file in order to get rid of
        in source #ifdefs.
      - keyid is derived according to the RFC 3280. It does not require to assign
        IMA/EVM specific "description" when loading X509 certificate. Kernel
        asymmetric key subsystem automatically generate the description. Also
        loading a certificate does not require using of ima-evm-utils and can be
        done using keyctl only.
      - keyid size is reduced to 32 bits to save xattr space.  Key search is done
        using partial match functionality of asymmetric_key_match().
      - Kconfig option title was changed
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      e0751257
  11. 06 2月, 2013 4 次提交
    • D
      ima: rename hash calculation functions · 50af5544
      Dmitry Kasatkin 提交于
      Rename hash calculation functions to reflect meaning
      and change argument order in conventional way.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      50af5544
    • D
      ima: use new crypto_shash API instead of old crypto_hash · 76bb28f6
      Dmitry Kasatkin 提交于
      Old crypto hash API internally uses shash API.
      Using shash API directly is more efficient.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      76bb28f6
    • D
      ima: add policy support for file system uuid · 85865c1f
      Dmitry Kasatkin 提交于
      The IMA policy permits specifying rules to enable or disable
      measurement/appraisal/audit based on the file system magic number.
      If, for example, the policy contains an ext4 measurement rule,
      the rule is enabled for all ext4 partitions.
      
      Sometimes it might be necessary to enable measurement/appraisal/audit
      only for one partition and disable it for another partition of the
      same type.  With the existing IMA policy syntax, this can not be done.
      
      This patch provides support for IMA policy rules to specify the file
      system by its UUID (eg. fsuuid=397449cd-687d-4145-8698-7fed4a3e0363).
      
      For partitions not being appraised, it might be a good idea to mount
      file systems with the 'noexec' option to prevent executing non-verified
      binaries.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      85865c1f
    • D
      evm: add file system uuid to EVM hmac · 74de6684
      Dmitry Kasatkin 提交于
      EVM uses the same key for all file systems to calculate the HMAC,
      making it possible to paste inodes from one file system on to another
      one, without EVM being able to detect it.  To prevent such an attack,
      it is necessary to make the EVM HMAC file system specific.
      
      This patch uses the file system UUID, a file system unique identifier,
      to bind the EVM HMAC to the file system. The value inode->i_sb->s_uuid
      is used for the HMAC hash calculation, instead of using it for deriving
      the file system specific key.  Initializing the key for every inode HMAC
      calculation is a bit more expensive operation than adding the uuid to
      the HMAC hash.
      
      Changing the HMAC calculation method or adding additional info to the
      calculation, requires existing EVM labeled file systems to be relabeled.
      This patch adds a Kconfig HMAC version option for backwards compatability.
      
      Changelog v1:
      - squash "hmac version setting"
      Changelog v0:
      - add missing Kconfig depends (Mimi)
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      74de6684
  12. 23 1月, 2013 4 次提交
  13. 21 1月, 2013 1 次提交
    • D
      evm: checking if removexattr is not a NULL · a67adb99
      Dmitry Kasatkin 提交于
      The following lines of code produce a kernel oops.
      
      fd = socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
      fchmod(fd, 0666);
      
      [  139.922364] BUG: unable to handle kernel NULL pointer dereference at   (null)
      [  139.924982] IP: [<  (null)>]   (null)
      [  139.924982] *pde = 00000000
      [  139.924982] Oops: 0000 [#5] SMP
      [  139.924982] Modules linked in: fuse dm_crypt dm_mod i2c_piix4 serio_raw evdev binfmt_misc button
      [  139.924982] Pid: 3070, comm: acpid Tainted: G      D      3.8.0-rc2-kds+ #465 Bochs Bochs
      [  139.924982] EIP: 0060:[<00000000>] EFLAGS: 00010246 CPU: 0
      [  139.924982] EIP is at 0x0
      [  139.924982] EAX: cf5ef000 EBX: cf5ef000 ECX: c143d600 EDX: c15225f2
      [  139.924982] ESI: cf4d2a1c EDI: cf4d2a1c EBP: cc02df10 ESP: cc02dee4
      [  139.924982]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      [  139.924982] CR0: 80050033 CR2: 00000000 CR3: 0c059000 CR4: 000006d0
      [  139.924982] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      [  139.924982] DR6: ffff0ff0 DR7: 00000400
      [  139.924982] Process acpid (pid: 3070, ti=cc02c000 task=d7705340 task.ti=cc02c000)
      [  139.924982] Stack:
      [  139.924982]  c1203c88 00000000 cc02def4 cf4d2a1c ae21eefa 471b60d5 1083c1ba c26a5940
      [  139.924982]  e891fb5e 00000041 00000004 cc02df1c c1203964 00000000 cc02df4c c10e20c3
      [  139.924982]  00000002 00000000 00000000 22222222 c1ff2222 cf5ef000 00000000 d76efb08
      [  139.924982] Call Trace:
      [  139.924982]  [<c1203c88>] ? evm_update_evmxattr+0x5b/0x62
      [  139.924982]  [<c1203964>] evm_inode_post_setattr+0x22/0x26
      [  139.924982]  [<c10e20c3>] notify_change+0x25f/0x281
      [  139.924982]  [<c10cbf56>] chmod_common+0x59/0x76
      [  139.924982]  [<c10e27a1>] ? put_unused_fd+0x33/0x33
      [  139.924982]  [<c10cca09>] sys_fchmod+0x39/0x5c
      [  139.924982]  [<c13f4f30>] syscall_call+0x7/0xb
      [  139.924982] Code:  Bad EIP value.
      
      This happens because sockets do not define the removexattr operation.
      Before removing the xattr, verify the removexattr function pointer is
      not NULL.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJames Morris <james.l.morris@oracle.com>
      a67adb99
  14. 17 1月, 2013 9 次提交
  15. 24 12月, 2012 1 次提交
  16. 14 12月, 2012 1 次提交
    • M
      ima: support new kernel module syscall · fdf90729
      Mimi Zohar 提交于
      With the addition of the new kernel module syscall, which defines two
      arguments - a file descriptor to the kernel module and a pointer to a NULL
      terminated string of module arguments - it is now possible to measure and
      appraise kernel modules like any other file on the file system.
      
      This patch adds support to measure and appraise kernel modules in an
      extensible and consistent manner.
      
      To support filesystems without extended attribute support, additional
      patches could pass the signature as the first parameter.
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      fdf90729
  17. 05 10月, 2012 1 次提交
  18. 21 9月, 2012 1 次提交