1. Dec 20, 2018
  2. Dec 19, 2018
  3. Dec 18, 2018
    • Mimi Zohar's avatar
      ima: cleanup the match_token policy code · 1a9430db
      Mimi Zohar authored
      
      
      Start the policy_tokens and the associated enumeration from zero,
      simplifying the pt macro.
      
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1a9430db
    • Linus Torvalds's avatar
      security: don't use a negative Opt_err token index · 94c13f66
      Linus Torvalds authored
      
      
      The code uses a bitmap to check for duplicate tokens during parsing, and
      that doesn't work at all for the negative Opt_err token case.
      
      There is absolutely no reason to make Opt_err be negative, and in fact
      it only confuses things, since some of the affected functions actually
      return a positive Opt_xyz enum _or_ a regular negative error code (eg
      -EINVAL), and using -1 for Opt_err makes no sense.
      
      There are similar problems in ima_policy.c and key encryption, but they
      don't have the immediate bug wrt bitmap handing, and ima_policy.c in
      particular needs a different patch to make the enum values match the
      token array index.  Mimi is sending that separately.
      
      Reported-by: default avatar <syzbot+a22e0dc07567662c50bc@syzkaller.appspotmail.com>
      Reported-by: default avatarEric Biggers <ebiggers@kernel.org>
      Fixes: 5208cc83 ("keys, trusted: fix: *do not* allow duplicate key options")
      Fixes: 00d60fd3
      
       ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]")
      Cc: James Morris James Morris <jmorris@namei.org>
      Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Cc: Peter Huewe <peterhuewe@gmx.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      94c13f66
    • Lendacky, Thomas's avatar
      dma-direct: do not include SME mask in the DMA supported check · c92a54cf
      Lendacky, Thomas authored
      The dma_direct_supported() function intends to check the DMA mask against
      specific values. However, the phys_to_dma() function includes the SME
      encryption mask, which defeats the intended purpose of the check. This
      results in drivers that support less than 48-bit DMA (SME encryption mask
      is bit 47) from being able to set the DMA mask successfully when SME is
      active, which results in the driver failing to initialize.
      
      Change the function used to check the mask from phys_to_dma() to
      __phys_to_dma() so that the SME encryption mask is not part of the check.
      
      Fixes: c1d0af1a
      
       ("kernel/dma/direct: take DMA offset into account in dma_direct_supported")
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      c92a54cf
  4. Dec 17, 2018
  5. Dec 15, 2018
  6. Dec 14, 2018