1. 06 Jun, 2018 6 commits
    • Mimi Zohar's avatar
      Revert "ima: limit file hash setting by user to fix and log modes" · 851ae480
      Mimi Zohar authored
      commit f5acb3dc upstream.
      
      Userspace applications have been modified to write security xattrs,
      but they are not context aware.  In the case of security.ima, the
      security xattr can be either a file hash or a file signature.
      Permitting writing one, but not the other requires the application to
      be context aware.
      
      In addition, userspace applications might write files to a staging
      area, which might not be in policy, and then change some file metadata
      (eg. owner) making it in policy.  As a result, these files are not
      labeled properly.
      
      This reverts commit c68ed80c, which
      prevents writing file hashes as security.ima xattrs.
      Requested-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      851ae480
    • Brian Foster's avatar
      xfs: detect agfl count corruption and reset agfl · 55ffb6ac
      Brian Foster authored
      commit a27ba260 upstream.
      
      The struct xfs_agfl v5 header was originally introduced with
      unexpected padding that caused the AGFL to operate with one less
      slot than intended. The header has since been packed, but the fix
      left an incompatibility for users who upgrade from an old kernel
      with the unpacked header to a newer kernel with the packed header
      while the AGFL happens to wrap around the end. The newer kernel
      recognizes one extra slot at the physical end of the AGFL that the
      previous kernel did not. The new kernel will eventually attempt to
      allocate a block from that slot, which contains invalid data, and
      cause a crash.
      
      This condition can be detected by comparing the active range of the
      AGFL to the count. While this detects a padding mismatch, it can
      also trigger false positives for unrelated flcount corruption. Since
      we cannot distinguish a size mismatch due to padding from unrelated
      corruption, we can't trust the AGFL enough to simply repopulate the
      empty slot.
      
      Instead, avoid unnecessarily complex detection logic and and use a
      solution that can handle any form of flcount corruption that slips
      through read verifiers: distrust the entire AGFL and reset it to an
      empty state. Any valid blocks within the AGFL are intentionally
      leaked. This requires xfs_repair to rectify (which was already
      necessary based on the state the AGFL was found in). The reset
      mitigates the side effect of the padding mismatch problem from a
      filesystem crash to a free space accounting inconsistency. The
      generic approach also means that this patch can be safely backported
      to kernels with or without a packed struct xfs_agfl.
      
      Check the AGF for an invalid freelist count on initial read from
      disk. If detected, set a flag on the xfs_perag to indicate that a
      reset is required before the AGFL can be used. In the first
      transaction that attempts to use a flagged AGFL, reset it to empty,
      warn the user about the inconsistency and allow the freelist fixup
      code to repopulate the AGFL with new blocks. The xfs_perag flag is
      cleared to eliminate the need for repeated checks on each block
      allocation operation.
      
      This allows kernels that include the packing fix commit 96f859d5
      ("libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct")
      to handle older unpacked AGFL formats without a filesystem crash.
      Suggested-by: default avatarDave Chinner <david@fromorbit.com>
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by Dave Chiluk <chiluk+linuxxfs@indeed.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDave Chiluk <chiluk+linuxxfs@indeed.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55ffb6ac
    • Yoshinori Sato's avatar
      sh: New gcc support · f8c42dfb
      Yoshinori Sato authored
      commit 940d4113 upstream.
      
      New gcc (4.8 or later) used new shift helper functions.
      So we need added new helper to private libgcc.
      Signed-off-by: default avatarYoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarRich Felker <dalias@libc.org>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f8c42dfb
    • Geert Uytterhoeven's avatar
      USB: serial: cp210x: use tcflag_t to fix incompatible pointer type · dae7ffc7
      Geert Uytterhoeven authored
      commit 009615ab upstream.
      
      On sparc32, tcflag_t is unsigned long, unlike all other architectures:
      
          drivers/usb/serial/cp210x.c: In function 'cp210x_get_termios':
          drivers/usb/serial/cp210x.c:717:3: warning: passing argument 2 of 'cp210x_get_termios_port' from incompatible pointer type
             cp210x_get_termios_port(tty->driver_data,
             ^
          drivers/usb/serial/cp210x.c:35:13: note: expected 'unsigned int *' but argument is of type 'tcflag_t *'
           static void cp210x_get_termios_port(struct usb_serial_port *port,
      		 ^
      
      Consistently use tcflag_t to fix this.
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dae7ffc7
    • Michael Neuling's avatar
      powerpc/64s: Clear PCR on boot · 783771fd
      Michael Neuling authored
      commit faf37c44 upstream.
      
      Clear the PCR (Processor Compatibility Register) on boot to ensure we
      are not running in a compatibility mode.
      
      We've seen this cause problems when a crash (and kdump) occurs while
      running compat mode guests. The kdump kernel then runs with the PCR
      set and causes problems. The symptom in the kdump kernel (also seen in
      petitboot after fast-reboot) is early userspace programs taking
      sigills on newer instructions (seen in libc).
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      783771fd
    • Will Deacon's avatar
      arm64: lse: Add early clobbers to some input/output asm operands · 55a0e02e
      Will Deacon authored
      commit 32c3fa7c upstream.
      
      For LSE atomics that read and write a register operand, we need to
      ensure that these operands are annotated as "early clobber" if the
      register is written before all of the input operands have been consumed.
      Failure to do so can result in the compiler allocating the same register
      to both operands, leading to splats such as:
      
       Unable to handle kernel paging request at virtual address 11111122222221
       [...]
       x1 : 1111111122222222 x0 : 1111111122222221
       Process swapper/0 (pid: 1, stack limit = 0x000000008209f908)
       Call trace:
        test_atomic64+0x1360/0x155c
      
      where x0 has been allocated as both the value to be stored and also the
      atomic_t pointer.
      
      This patch adds the missing clobbers.
      
      Cc: <stable@vger.kernel.org>
      Cc: Dave Martin <dave.martin@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Reported-by: default avatarMark Salter <msalter@redhat.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      55a0e02e
  2. 30 May, 2018 34 commits