1. 20 Jan, 2017 1 commit
    • Linus Torvalds's avatar
      Merge tag 'xfs-for-linux-4.10-rc5-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 6e0362b3
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "I have a few more patches this week -- one to make the behavior of a
        quota id ioctl consistent with the other filesystems, and the rest
        improve validation of i_mode & i_size values coming into xfs so that
        we don't read off the ends of arrays or crash when handed garbage disk
        data.
      
        Summary:
         - inode i_mode sanitization
         - prevent overflows in getnextquota
         - minor build fixes"
      
      * tag 'xfs-for-linux-4.10-rc5-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: fix xfs_mode_to_ftype() prototype
        xfs: don't wrap ID in xfs_dq_get_next_id
        xfs: sanity check inode di_mode
        xfs: sanity check inode mode when creating new dentry
        xfs: replace xfs_mode_to_ftype table with switch statement
        xfs: add missing include dependencies to xfs_dir2.h
        xfs: sanity check directory inode di_size
        xfs: make the ASSERT() condition likely
      6e0362b3
  2. 19 Jan, 2017 5 commits
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.10-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 81aaeaac
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - recognize that a PCI-to-PCIe bridge originates a PCIe hierarchy, so
         we enumerate that hierarchy correctly
      
       - X-Gene: fix a change merged for v4.10 that broke MSI
      
       - Keystone: avoid reading undefined registers, which can cause
         asynchronous external aborts
      
       - Supermicro X8DTH-i/6/iF/6F: ignore broken _CRS that caused us to
         change (and break) existing I/O port assignments
      
      * tag 'pci-v4.10-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI/MSI: pci-xgene-msi: Fix CPU hotplug registration handling
        PCI: Enumerate switches below PCI-to-PCIe bridges
        x86/PCI: Ignore _CRS on Supermicro X8DTH-i/6/iF/6F
        PCI: designware: Check for iATU unroll only on platforms that use ATU
      81aaeaac
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · 2ed5e5af
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - regression fix for generic Wacom devices, from Jason Gerecke
      
       - DMA-on-stack fixes for hid-corsair driver, from Johan Hovold
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        HID: wacom: Fix sibling detection regression
        HID: corsair: fix control-transfer error handling
        HID: corsair: fix DMA buffers on stack
      2ed5e5af
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 4a1cc2e8
      Linus Torvalds authored
      Pull two s390 bug fixes from Martin Schwidefsky:
       "Two changes, the first is a fix to add a missing memory clobber to the
        inline assembly to load control registers. This has not caused any
        issues so far, but who knows what code gcc will generate in future
        versions.
      
        The second change is an update for the default configurations. This
        includes CONFIG_BUG_ON_DATA_CORRUPTION=y, we want this to be enabled
        for s390. The usual approach to debug problems on production systems
        is to use crash on a system dump and for us avoiding data corruptions
        is priority one"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: update defconfigs
        s390/ctl_reg: make __ctl_load a full memory barrier
      4a1cc2e8
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.10-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 08667577
      Linus Torvalds authored
      Pull xen fix from Juergen Gross:
       "A fix for Xen running in nested virtualization environment"
      
      * tag 'for-linus-4.10-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        partially revert "xen: Remove event channel notification through Xen PCI platform device"
      08667577
    • Jason Gerecke's avatar
      HID: wacom: Fix sibling detection regression · a9ce7856
      Jason Gerecke authored
      Commit 345857bb ("HID: wacom: generic: Add support for sensor offsets") included
      a change to the operation and location of the call to 'wacom_add_shared_data'
      in 'wacom_parse_and_register'. The modifications included moving it higher up
      so that it would occur before the call to 'wacom_retrieve_hid_descriptor'. This
      was done to prevent a crash that would have occured when the report containing
      tablet offsets was fed into the driver with 'wacom_hid_report_raw_event'
      (specifically: the various 'wacom_wac_*_report' functions were written with the
      assumption that they would only be called once tablet setup had completed;
      'wacom_wac_pen_report' in particular dereferences 'shared' which wasn't yet
      allocated).
      
      Moving the call to 'wacom_add_shared_data' effectively prevented the crash but
      also broke the sibiling detection code which assumes that the HID descriptor
      has been read and the various device_type flags set.
      
      To fix this situation, we restore the original 'wacom_add_shared_data'
      operation and location and instead implement an alternative change that can
      also prevent the crash. Specifically, we notice that the report functions
      mentioned above expect to be called only for input reports.  By adding a check,
      we can prevent feature reports (such as the offset report) from
      causing trouble.
      
      Fixes: 345857bb ("HID: wacom: generic: Add support for sensor offsets")
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      Tested-by: default avatarPing Cheng <pingc@wacom.com>
      Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      a9ce7856
  3. 18 Jan, 2017 7 commits
  4. 17 Jan, 2017 24 commits
    • Linus Torvalds's avatar
      Merge tag 'modules-for-v4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux · 0aa0313f
      Linus Torvalds authored
      Pull modules fix from Jessica Yu:
      
       - fix out-of-tree module breakage when it supplies its own definitions
         of true and false
      
      * tag 'modules-for-v4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
        taint/module: Fix problems when out-of-kernel driver defines true or false
      0aa0313f
    • Eric Sandeen's avatar
      xfs: don't wrap ID in xfs_dq_get_next_id · 657bdfb7
      Eric Sandeen authored
      The GETNEXTQOTA ioctl takes whatever ID is sent in,
      and looks for the next active quota for an user
      equal or higher to that ID.
      
      But if we are at the maximum ID and then ask for the "next"
      one, we may wrap back to zero.  In this case, userspace
      may loop forever, because it will start querying again
      at zero.
      
      We'll fix this in userspace as well, but for the kernel,
      return -ENOENT if we ask for the next quota ID
      past UINT_MAX so the caller knows to stop.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      657bdfb7
    • Amir Goldstein's avatar
      xfs: sanity check inode di_mode · a324cbf1
      Amir Goldstein authored
      Check for invalid file type in xfs_dinode_verify()
      and fail to load the inode structure from disk.
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      a324cbf1
    • Amir Goldstein's avatar
      xfs: sanity check inode mode when creating new dentry · fab8eef8
      Amir Goldstein authored
      The helper xfs_dentry_to_name() is used by 2 different
      classes of callers: Callers that pass zero mode and don't care
      about the returned name.type field and Callers that pass
      non zero mode and do care about the name.type field.
      
      Change xfs_dentry_to_name() to not take the mode argument and
      change the call sites of the first class to not pass the mode
      argument.
      
      Create a new helper xfs_dentry_mode_to_name() which does pass
      the mode argument and returns -EFSCORRUPTED if mode is invalid.
      Callers that translate non zero mode to on-disk file type now
      check the return value and will export the error to user instead
      of staging an invalid file type to be written to directory entry.
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      fab8eef8
    • Amir Goldstein's avatar
      xfs: replace xfs_mode_to_ftype table with switch statement · 1fc4d33f
      Amir Goldstein authored
      The size of the xfs_mode_to_ftype[] conversion table
      was too small to handle an invalid value of mode=S_IFMT.
      
      Instead of fixing the table size, replace the conversion table
      with a conversion helper that uses a switch statement.
      Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      1fc4d33f
    • Amir Goldstein's avatar
      xfs: add missing include dependencies to xfs_dir2.h · b597dd53
      Amir Goldstein authored
      xfs_dir2.h dereferences some data types in inline functions
      and fails to include those type definitions, e.g.:
      xfs_dir2_data_aoff_t, struct xfs_da_geometry.
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      b597dd53
    • Amir Goldstein's avatar
      xfs: sanity check directory inode di_size · 3c6f46ea
      Amir Goldstein authored
      This changes fixes an assertion hit when fuzzing on-disk
      i_mode values.
      
      The easy case to fix is when changing an empty file
      i_mode to S_IFDIR. In this case, xfs_dinode_verify()
      detects an illegal zero size for directory and fails
      to load the inode structure from disk.
      
      For the case of non empty file whose i_mode is changed
      to S_IFDIR, the ASSERT() statement in xfs_dir2_isblock()
      is replaced with return -EFSCORRUPTED, to avoid interacting
      with corrupted jusk also when XFS_DEBUG is disabled.
      Suggested-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      3c6f46ea
    • Amir Goldstein's avatar
      xfs: make the ASSERT() condition likely · bf46ecc3
      Amir Goldstein authored
      The ASSERT() condition is the normal case, not the exception,
      so testing the condition should be likely(), not unlikely().
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      bf46ecc3
    • Larry Finger's avatar
      taint/module: Fix problems when out-of-kernel driver defines true or false · 5eb7c0d0
      Larry Finger authored
      Commit 7fd8329b ("taint/module: Clean up global and module taint
      flags handling") used the key words true and false as character members
      of a new struct. These names cause problems when out-of-kernel modules
      such as VirtualBox include their own definitions of true and false.
      
      Fixes: 7fd8329b ("taint/module: Clean up global and module taint flags handling")
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Jessica Yu <jeyu@redhat.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Reported-by: default avatarValdis Kletnieks <Valdis.Kletnieks@vt.edu>
      Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
      Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarJessica Yu <jeyu@redhat.com>
      5eb7c0d0
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 4b19a9e2
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Handle multicast packets properly in fast-RX path of mac80211, from
          Johannes Berg.
      
       2) Because of a logic bug, the user can't actually force SW
          checksumming on r8152 devices. This makes diagnosis of hw
          checksumming bugs really annoying. Fix from Hayes Wang.
      
       3) VXLAN route lookup does not take the source and destination ports
          into account, which means IPSEC policies cannot be matched properly.
          Fix from Martynas Pumputis.
      
       4) Do proper RCU locking in netvsc callbacks, from Stephen Hemminger.
      
       5) Fix SKB leaks in mlxsw driver, from Arkadi Sharshevsky.
      
       6) If lwtunnel_fill_encap() fails, we do not abort the netlink message
          construction properly in fib_dump_info(), from David Ahern.
      
       7) Do not use kernel stack for DMA buffers in atusb driver, from Stefan
          Schmidt.
      
       8) Openvswitch conntack actions need to maintain a correct checksum,
          fix from Lance Richardson.
      
       9) ax25_disconnect() is missing a check for ax25->sk being NULL, in
          fact it already checks this, but not in all of the necessary spots.
          Fix from Basil Gunn.
      
      10) Action GET operations in the packet scheduler can erroneously bump
          the reference count of the entry, making it unreleasable. Fix from
          Jamal Hadi Salim. Jamal gives a great set of example command lines
          that trigger this in the commit message.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (46 commits)
        net sched actions: fix refcnt when GETing of action after bind
        net/mlx4_core: Eliminate warning messages for SRQ_LIMIT under SRIOV
        net/mlx4_core: Fix when to save some qp context flags for dynamic VST to VGT transitions
        net/mlx4_core: Fix racy CQ (Completion Queue) free
        net: stmmac: don't use netdev_[dbg, info, ..] before net_device is registered
        net/mlx5e: Fix a -Wmaybe-uninitialized warning
        ax25: Fix segfault after sock connection timeout
        bpf: rework prog_digest into prog_tag
        tipc: allocate user memory with GFP_KERNEL flag
        net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types
        ip6_tunnel: Account for tunnel header in tunnel MTU
        mld: do not remove mld souce list info when set link down
        be2net: fix MAC addr setting on privileged BE3 VFs
        be2net: don't delete MAC on close on unprivileged BE3 VFs
        be2net: fix status check in be_cmd_pmac_add()
        cpmac: remove hopeless #warning
        ravb: do not use zero-length alignment DMA descriptor
        mlx4: do not call napi_schedule() without care
        openvswitch: maintain correct checksum state in conntrack actions
        tcp: fix tcp_fastopen unaligned access complaints on sparc
        ...
      4b19a9e2
    • Linus Torvalds's avatar
      Merge branch 'stable/for-linus-4.10' of... · 203f80f1
      Linus Torvalds authored
      Merge branch 'stable/for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb
      
      Pull swiotlb fix from Konrad Rzeszutek Wilk:
       "A tiny fix to make sure that page-sized mappings are page-aligned (and
        not say straddle two pages). This is important for some drivers (such
        as NVME)"
      
      * 'stable/for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
        swiotlb: ensure that page-sized mappings are page-aligned
      203f80f1
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 7e84b303
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - fix regressions detecting HS/HS DDR eMMC cards related to CMD6
      
        MMC host:
         - mmc: mxs-mmc: Fix additional cycles after transmission stop
         - sdhci-acpi: Only powered up enabled acpi child devices
         - meson: avoid possible NULL dereference"
      
      * tag 'mmc-v4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: core: Restore parts of the polling policy when switch to HS/HS DDR
        mmc: mxs-mmc: Fix additional cycles after transmission stop
        mmc: sdhci-acpi: Only powered up enabled acpi child devices
        MMC: meson: avoid possible NULL dereference
      7e84b303
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20170116' of git://git.infradead.org/linux-mtd · 7d8b8c09
      Linus Torvalds authored
      Pull MTD fixes from Brian Norris:
       "Just NAND updates from Boris:
      
         - avoid compiling xway NAND controller driver as a module (which
           didn't work)
      
         - fix tango NAND DT binding and make sure the controller is in a
           clean state at probe time
      
         - add dependency on HAS_IOMEM to the oxnas NAND driver
      
         - fix irq number validity check in the lpc32xx driver"
      
      * tag 'for-linus-20170116' of git://git.infradead.org/linux-mtd:
        mtd: nand: lpc32xx: fix invalid error handling of a requested irq
        mtd: nand: tango: Reset pbus to raw mode in probe
        mtd: nand: tango: Update DT binding description
        mtd: nand: oxnas_nand: fix build errors on arch/um, require HAS_IOMEM
        mtd: nand: xway: fix build because of module functions
        mtd: nand: xway: disable module support
      7d8b8c09
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo-4.10-20170117' of... · 31f5260a
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo-4.10-20170117' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull 'perf probe' fixes from Arnaldo Carvalho de Melo <acme@redhat.com>
      
        - Show correct locations for 'perf probe' on modules (Masami Hiramatsu)
      
        - Correctly handle 'perf probe's on GCC generated functions in modules (Masami Hiramatsu)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      31f5260a
    • Marc Zyngier's avatar
      PCI/MSI: pci-xgene-msi: Fix CPU hotplug registration handling · 4d191b1b
      Marc Zyngier authored
      The conversion to the new hotplug state machine introduced a regression
      where a successful hotplug registration would be treated as an error,
      effectively disabling the MSI driver forever.
      
      Fix it by doing the proper check on the return value.
      
      Fixes: 9c248f88 ("PCI/xgene-msi: Convert to hotplug state machine")
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Tested-by: default avatarDuc Dang <dhdang@apm.com>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: stable@vger.kernel.org
      4d191b1b
    • Richard Weinberger's avatar
      ubifs: Fix journal replay wrt. xattr nodes · 1cb51a15
      Richard Weinberger authored
      When replaying the journal it can happen that a journal entry points to
      a garbage collected node.
      This is the case when a power-cut occurred between a garbage collect run
      and a commit. In such a case nodes have to be read using the failable
      read functions to detect whether the found node matches what we expect.
      
      One corner case was forgotten, when the journal contains an entry to
      remove an inode all xattrs have to be removed too. UBIFS models xattr
      like directory entries, so the TNC code iterates over
      all xattrs of the inode and removes them too. This code re-uses the
      functions for walking directories and calls ubifs_tnc_next_ent().
      ubifs_tnc_next_ent() expects to be used only after the journal and
      aborts when a node does not match the expected result. This behavior can
      render an UBIFS volume unmountable after a power-cut when xattrs are
      used.
      
      Fix this issue by using failable read functions in ubifs_tnc_next_ent()
      too when replaying the journal.
      Cc: stable@vger.kernel.org
      Fixes: 1e51764a ("UBIFS: add new flash file system")
      Reported-by: default avatarRock Lee <rockdotlee@gmail.com>
      Reviewed-by: default avatarDavid Gstir <david@sigma-star.at>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      1cb51a15
    • Eric Biggers's avatar
      ubifs: remove redundant checks for encryption key · 3d4b2fcb
      Eric Biggers authored
      In several places, ubifs checked for an encryption key before creating a
      file in an encrypted directory.  This was redundant with
      fscrypt_setup_filename() or ubifs_new_inode(), and in the case of
      ubifs_link() it broke linking to special files.  So remove the extra
      checks.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      3d4b2fcb
    • Eric Biggers's avatar
      ubifs: allow encryption ioctls in compat mode · a75467d9
      Eric Biggers authored
      The ubifs encryption ioctls did not work when called by a 32-bit program
      on a 64-bit kernel.  Since 'struct fscrypt_policy' is not affected by
      the word size, ubifs just needs to allow these ioctls through, like what
      ext4 and f2fs do.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      a75467d9
    • Arnd Bergmann's avatar
      ubifs: add CONFIG_BLOCK dependency for encryption · 404e0b63
      Arnd Bergmann authored
      This came up during the v4.10 merge window:
      
      warning: (UBIFS_FS_ENCRYPTION) selects FS_ENCRYPTION which has unmet direct dependencies (BLOCK)
      fs/crypto/crypto.c: In function 'fscrypt_zeroout_range':
      fs/crypto/crypto.c:355:9: error: implicit declaration of function 'bio_alloc';did you mean 'd_alloc'? [-Werror=implicit-function-declaration]
         bio = bio_alloc(GFP_NOWAIT, 1);
      
      The easiest way out is to limit UBIFS_FS_ENCRYPTION to configurations
      that also enable BLOCK.
      
      Fixes: d475a507 ("ubifs: Add skeleton for fscrypto")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      404e0b63
    • Peter Rosin's avatar
      ubifs: fix unencrypted journal write · 507502ad
      Peter Rosin authored
      Without this, I get the following on reboot:
      
      UBIFS error (ubi1:0 pid 703): ubifs_load_znode: bad target node (type 1) length (8240)
      UBIFS error (ubi1:0 pid 703): ubifs_load_znode: have to be in range of 48-4144
      UBIFS error (ubi1:0 pid 703): ubifs_load_znode: bad indexing node at LEB 13:11080, error 5
       magic          0x6101831
       crc            0xb1cb246f
       node_type      9 (indexing node)
       group_type     0 (no node group)
       sqnum          546
       len            128
       child_cnt      5
       level          0
       Branches:
       0: LEB 14:72088 len 161 key (133, inode)
       1: LEB 14:81120 len 160 key (134, inode)
       2: LEB 20:26624 len 8240 key (134, data, 0)
       3: LEB 14:81280 len 160 key (135, inode)
       4: LEB 20:34864 len 8240 key (135, data, 0)
      UBIFS warning (ubi1:0 pid 703): ubifs_ro_mode.part.0: switched to read-only mode, error -22
      CPU: 0 PID: 703 Comm: mount Not tainted 4.9.0-next-20161213+ #1197
      Hardware name: Atmel SAMA5
      [<c010d2ac>] (unwind_backtrace) from [<c010b250>] (show_stack+0x10/0x14)
      [<c010b250>] (show_stack) from [<c024df94>] (ubifs_jnl_update+0x2e8/0x614)
      [<c024df94>] (ubifs_jnl_update) from [<c0254bf8>] (ubifs_mkdir+0x160/0x204)
      [<c0254bf8>] (ubifs_mkdir) from [<c01a6030>] (vfs_mkdir+0xb0/0x104)
      [<c01a6030>] (vfs_mkdir) from [<c0286070>] (ovl_create_real+0x118/0x248)
      [<c0286070>] (ovl_create_real) from [<c0283ed4>] (ovl_fill_super+0x994/0xaf4)
      [<c0283ed4>] (ovl_fill_super) from [<c019c394>] (mount_nodev+0x44/0x9c)
      [<c019c394>] (mount_nodev) from [<c019c4ac>] (mount_fs+0x14/0xa4)
      [<c019c4ac>] (mount_fs) from [<c01b5338>] (vfs_kern_mount+0x4c/0xd4)
      [<c01b5338>] (vfs_kern_mount) from [<c01b6b80>] (do_mount+0x154/0xac8)
      [<c01b6b80>] (do_mount) from [<c01b782c>] (SyS_mount+0x74/0x9c)
      [<c01b782c>] (SyS_mount) from [<c0107f80>] (ret_fast_syscall+0x0/0x3c)
      UBIFS error (ubi1:0 pid 703): ubifs_mkdir: cannot create directory, error -22
      overlayfs: failed to create directory /mnt/ovl/work/work (errno: 22); mounting read-only
      
      Fixes: 7799953b ("ubifs: Implement encrypt/decrypt for all IO")
      Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
      Tested-by: default avatarKevin Hilman <khilman@baylibre.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      507502ad
    • Colin Ian King's avatar
      ubifs: ensure zero err is returned on successful return · e8f19746
      Colin Ian King authored
      err is no longer being set on a successful return path, causing
      a garbage value being returned. Fix this by setting err to zero
      for the successful return path.
      
      Found with static analysis by CoverityScan, CID 1389473
      
      Fixes: 7799953b ("ubifs: Implement encrypt/decrypt for all IO")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      e8f19746
    • Zhou Chengming's avatar
      perf/x86/intel: Handle exclusive threadid correctly on CPU hotplug · 4e71de79
      Zhou Chengming authored
      The CPU hotplug function intel_pmu_cpu_starting() sets
      cpu_hw_events.excl_thread_id unconditionally to 1 when the shared exclusive
      counters data structure is already availabe for the sibling thread.
      
      This works during the boot process because the first sibling gets threadid
      0 assigned and the second sibling which shares the data structure gets 1.
      
      But when the first thread of the core is offlined and onlined again it
      shares the data structure with the second thread and gets exclusive thread
      id 1 assigned as well.
      
      Prevent this by checking the threadid of the already online thread.
      
      [ tglx: Rewrote changelog ]
      Signed-off-by: default avatarZhou Chengming <zhouchengming1@huawei.com>
      Cc: NuoHan Qiao <qiaonuohan@huawei.com>
      Cc: ak@linux.intel.com
      Cc: peterz@infradead.org
      Cc: kan.liang@intel.com
      Cc: dave.hansen@linux.intel.com
      Cc: eranian@google.com
      Cc: qiaonuohan@huawei.com
      Cc: davidcc@google.com
      Cc: guohanjun@huawei.com
      Link: http://lkml.kernel.org/r/1484536871-3131-1-git-send-email-zhouchengming1@huawei.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      ---					---
       arch/x86/events/intel/core.c |    7 +++++--
       1 file changed, 5 insertions(+), 2 deletions(-)
      4e71de79
    • Joonyoung Shim's avatar
      clocksource/exynos_mct: Clear interrupt when cpu is shut down · bc7c36ee
      Joonyoung Shim authored
      When a CPU goes offline a potentially pending timer interrupt is not
      cleared. When the CPU comes online again then the pending interrupt is
      delivered before the per cpu clockevent device is initialized. As a
      consequence the tick interrupt handler dereferences a NULL pointer.
      
      [   51.251378] Unable to handle kernel NULL pointer dereference at virtual address 00000040
      [   51.289348] task: ee942d00 task.stack: ee960000
      [   51.293861] PC is at tick_periodic+0x38/0xb0
      [   51.298102] LR is at tick_handle_periodic+0x1c/0x90
      
      Clear the pending interrupt in the cpu dying path.
      
      Fixes: 56a94f13 ("clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier")
      Reported-by: default avatarSeung-Woo Kim <sw0312.kim@samsung.com>
      Signed-off-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
      Cc: linux-samsung-soc@vger.kernel.org
      Cc: cw00.choi@samsung.com
      Cc: daniel.lezcano@linaro.org
      Cc: stable@vger.kernel.org
      Cc: javier@osg.samsung.com
      Cc: kgene@kernel.org
      Cc: krzk@kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1484628876-22065-1-git-send-email-jy0922.shim@samsung.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      bc7c36ee
    • Jamal Hadi Salim's avatar
      net sched actions: fix refcnt when GETing of action after bind · 0faa9cb5
      Jamal Hadi Salim authored
      Demonstrating the issue:
      
      .. add a drop action
      $sudo $TC actions add action drop index 10
      
      .. retrieve it
      $ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 2 bind 0 installed 29 sec used 29 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      ... bug 1 above: reference is two.
          Reference is actually 1 but we forget to subtract 1.
      
      ... do a GET again and we see the same issue
          try a few times and nothing changes
      ~$ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 2 bind 0 installed 31 sec used 31 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      ... lets try to bind the action to a filter..
      $ sudo $TC qdisc add dev lo ingress
      $ sudo $TC filter add dev lo parent ffff: protocol ip prio 1 \
        u32 match ip dst 127.0.0.1/32 flowid 1:1 action gact index 10
      
      ... and now a few GETs:
      $ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 3 bind 1 installed 204 sec used 204 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      $ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 4 bind 1 installed 206 sec used 206 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      $ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 5 bind 1 installed 235 sec used 235 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      .... as can be observed the reference count keeps going up.
      
      After the fix
      
      $ sudo $TC actions add action drop index 10
      $ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 1 bind 0 installed 4 sec used 4 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      $ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 1 bind 0 installed 6 sec used 6 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      $ sudo $TC qdisc add dev lo ingress
      $ sudo $TC filter add dev lo parent ffff: protocol ip prio 1 \
        u32 match ip dst 127.0.0.1/32 flowid 1:1 action gact index 10
      
      $ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 2 bind 1 installed 32 sec used 32 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      $ sudo $TC -s actions get action gact index 10
      
      	action order 1: gact action drop
      	 random type none pass val 0
      	 index 10 ref 2 bind 1 installed 33 sec used 33 sec
       	Action statistics:
      	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      
      Fixes: aecc5cef ("net sched actions: fix GETing actions")
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0faa9cb5
  5. 16 Jan, 2017 3 commits