Skip to content
  1. Jun 15, 2019
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 1ed1fa5f
      Linus Torvalds authored
      Pull SCSI fix from James Bottomley:
       "A single bug fix for hpsa.
      
        The user visible consequences aren't clear, but the ioaccel2 raid
        acceleration may misfire on the malformed request assuming the payload
        is big enough to require chaining (more than 31 sg entries)"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: hpsa: correct ioaccel2 chaining
      1ed1fa5f
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20190614' of git://git.kernel.dk/linux-block · 7b103151
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Remove references to old schedulers for the scheduler switching and
         blkio controller documentation (Andreas)
      
       - Kill duplicate check for report zone for null_blk (Chaitanya)
      
       - Two bcache fixes (Coly)
      
       - Ensure that mq-deadline is selected if zoned block device is enabled,
         as we need that to support them (Damien)
      
       - Fix io_uring memory leak (Eric)
      
       - ps3vram fallout from LBDAF removal (Geert)
      
       - Redundant blk-mq debugfs debugfs_create return check cleanup (Greg)
      
       - Extend NOPLM quirk for ST1000LM024 drives (Hans)
      
       - Remove error path warning that can now trigger after the queue
         removal/addition fixes (Ming)
      
      * tag 'for-linus-20190614' of git://git.kernel.dk/linux-block:
        block/ps3vram: Use %llu to format sector_t after LBDAF removal
        libata: Extend quirks for the ST1000LM024 drives with NOLPM quirk
        bcache: only set BCACHE_DEV_WB_RUNNING when cached device attached
        bcache: fix stack corruption by PRECEDING_KEY()
        blk-mq: remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests
        blkio-controller.txt: Remove references to CFQ
        block/switching-sched.txt: Update to blk-mq schedulers
        null_blk: remove duplicate check for report zone
        blk-mq: no need to check return value of debugfs_create functions
        io_uring: fix memory leak of UNIX domain socket inode
        block: force select mq-deadline for zoned block devices
      7b103151
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 5dcedf46
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "I2C has two simple but wanted driver fixes for you"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: pca-platform: Fix GPIO lookup code
        i2c: acorn: fix i2c warning
      5dcedf46
    • Casey Schaufler's avatar
      Smack: Restore the smackfsdef mount option and add missing prefixes · 6e7739fc
      Casey Schaufler authored
      The 5.1 mount system rework changed the smackfsdef mount option to
      smackfsdefault.  This fixes the regression by making smackfsdef treated
      the same way as smackfsdefault.
      
      Also fix the smack_param_specs[] to have "smack" prefixes on all the
      names.  This isn't visible to a user unless they either:
      
       (a) Try to mount a filesystem that's converted to the internal mount API
           and that implements the ->parse_monolithic() context operation - and
           only then if they call security_fs_context_parse_param() rather than
           security_sb_eat_lsm_opts().
      
           There are no examples of this upstream yet, but nfs will probably want
           to do this for nfs2 or nfs3.
      
       (b) Use fsconfig() to configure the filesystem - in which case
           security_fs_context_parse_param() will be called.
      
      This issue is that smack_sb_eat_lsm_opts() checks for the "smack" prefix
      on the options, but smack_fs_context_parse_param() does not.
      
      Fixes: c3300aaf ("smack: get rid of match_token()")
      Fixes: 2febd254
      
       ("smack: Implement filesystem context security hooks")
      Cc: stable@vger.kernel.org
      Reported-by: default avatarJose Bollo <jose.bollo@iot.bzh>
      Signed-off-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6e7739fc
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 72a20cee
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "Here are some arm64 fixes for -rc5.
      
        The only non-trivial change (in terms of the diffstat) is fixing our
        SVE ptrace API for big-endian machines, but the majority of this is
        actually the addition of much-needed comments and updates to the
        documentation to try to avoid this mess biting us again in future.
      
        There are still a couple of small things on the horizon, but nothing
        major at this point.
      
        Summary:
      
         - Fix broken SVE ptrace API when running in a big-endian configuration
      
         - Fix performance regression due to off-by-one in TLBI range checking
      
         - Fix build regression when using Clang"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64/sve: Fix missing SVE/FPSIMD endianness conversions
        arm64: tlbflush: Ensure start/end of address range are aligned to stride
        arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGS
      72a20cee
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · fd6b99fa
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "16 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm/devm_memremap_pages: fix final page put race
        PCI/P2PDMA: track pgmap references per resource, not globally
        lib/genalloc: introduce chunk owners
        PCI/P2PDMA: fix the gen_pool_add_virt() failure path
        mm/devm_memremap_pages: introduce devm_memunmap_pages
        drivers/base/devres: introduce devm_release_action()
        mm/vmscan.c: fix trying to reclaim unevictable LRU page
        coredump: fix race condition between collapse_huge_page() and core dumping
        mm/mlock.c: change count_mm_mlocked_page_nr return type
        mm: mmu_gather: remove __tlb_reset_range() for force flush
        fs/ocfs2: fix race in ocfs2_dentry_attach_lock()
        mm/vmscan.c: fix recent_rotated history
        mm/mlock.c: mlockall error for flag MCL_ONFAULT
        scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE
        mm/list_lru.c: fix memory leak in __memcg_init_list_lru_node
        mm: memcontrol: don't batch updates of local VM stats and events
      fd6b99fa
  2. Jun 14, 2019
  3. Jun 13, 2019
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · c11fb13a
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - regression fixes (reverts) for module loading changes that turned out
         to be incompatible with some userspace, from Benjamin Tissoires
      
       - regression fix for special Logitech unifiying receiver 0xc52f, from
         Hans de Goede
      
       - a few device ID additions to logitech driver, from Hans de Goede
      
       - fix for Bluetooth support on 2nd-gen Wacom Intuos Pro, from Jason
         Gerecke
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: logitech-dj: Fix 064d:c52f receiver support
        Revert "HID: core: Call request_module before doing device_add"
        Revert "HID: core: Do not call request_module() in async context"
        Revert "HID: Increase maximum report size allowed by hid_field_extract()"
        HID: a4tech: fix horizontal scrolling
        HID: hyperv: Add a module description line
        HID: logitech-hidpp: Add support for the S510 remote control
        HID: multitouch: handle faulty Elo touch device
        HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary
        HID: wacom: Correct button numbering 2nd-gen Intuos Pro over Bluetooth
        HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact
        HID: wacom: Don't report anything prior to the tool entering range
        HID: wacom: Don't set tool type until we're in range
        HID: rmi: Use SET_REPORT request on control endpoint for Acer Switch 3 and 5
        HID: logitech-hidpp: add support for the MX5500 keyboard
        HID: logitech-dj: add support for the Logitech MX5500's Bluetooth Mini-Receiver
        HID: i2c-hid: add iBall Aer3 to descriptor override
      c11fb13a
    • Takashi Iwai's avatar
      Merge tag 'asoc-fix-v5.2-rc4' of... · 84396d14
      Takashi Iwai authored
      Merge tag 'asoc-fix-v5.2-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v5.2
      
      There's an awful lot of fixes here, almost all for the newly introduced
      SoF DSP drivers (including a few things it turned up in shared code).
      This is a large and complex piece of code so it's not surprising that
      there have been quite a few issues here, fortunately things seem to have
      mostly calmed down now.  Otherwise there's just a smattering of small fixes.
      84396d14
    • Geert Uytterhoeven's avatar
      block/ps3vram: Use %llu to format sector_t after LBDAF removal · 1d0c0651
      Geert Uytterhoeven authored
      The removal of CONFIG_LBDAF changed the type of sector_t from "unsigned
      long" to "u64" aka "unsigned long long" on 64-bit platforms, leading to
      a compiler warning regression:
      
          drivers/block/ps3vram.c: In function ‘ps3vram_probe’:
          drivers/block/ps3vram.c:770:23: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘sector_t {aka long long unsigned int}’ [-Wformat=]
      
      Fix this by using "%llu" instead.
      
      Fixes: 72deb455
      
       ("block: remove CONFIG_LBDAF")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      1d0c0651
    • Hans de Goede's avatar
      libata: Extend quirks for the ST1000LM024 drives with NOLPM quirk · 31f6264e
      Hans de Goede authored
      We've received a bugreport that using LPM with ST1000LM024 drives leads
      to system lockups. So it seems that these models are buggy in more then
      1 way. Add NOLPM quirk to the existing quirks entry for BROKEN_FPDMA_AA.
      
      BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1571330
      
      
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      31f6264e
    • Coly Li's avatar
      bcache: only set BCACHE_DEV_WB_RUNNING when cached device attached · 1f0ffa67
      Coly Li authored
      When people set a writeback percent via sysfs file,
        /sys/block/bcache<N>/bcache/writeback_percent
      current code directly sets BCACHE_DEV_WB_RUNNING to dc->disk.flags
      and schedules kworker dc->writeback_rate_update.
      
      If there is no cache set attached to, the writeback kernel thread is
      not running indeed, running dc->writeback_rate_update does not make
      sense and may cause NULL pointer deference when reference cache set
      pointer inside update_writeback_rate().
      
      This patch checks whether the cache set point (dc->disk.c) is NULL in
      sysfs interface handler, and only set BCACHE_DEV_WB_RUNNING and
      schedule dc->writeback_rate_update when dc->disk.c is not NULL (it
      means the cache device is attached to a cache set).
      
      This problem might be introduced from initial bcache commit, but
      commit 3fd47bfe ("bcache: stop dc->writeback_rate_update properly")
      changes part of the original code piece, so I add 'Fixes: 3fd47bfe'
      to indicate from which commit this patch can be applied.
      
      Fixes: 3fd47bfe
      
       ("bcache: stop dc->writeback_rate_update properly")
      Reported-by: default avatarBjørn Forsman <bjorn.forsman@gmail.com>
      Signed-off-by: default avatarColy Li <colyli@suse.de>
      Reviewed-by: default avatarBjørn Forsman <bjorn.forsman@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      1f0ffa67
    • Coly Li's avatar
      bcache: fix stack corruption by PRECEDING_KEY() · 31b90956
      Coly Li authored
      Recently people report bcache code compiled with gcc9 is broken, one of
      the buggy behavior I observe is that two adjacent 4KB I/Os should merge
      into one but they don't. Finally it turns out to be a stack corruption
      caused by macro PRECEDING_KEY().
      
      See how PRECEDING_KEY() is defined in bset.h,
      437 #define PRECEDING_KEY(_k)                                       \
      438 ({                                                              \
      439         struct bkey *_ret = NULL;                               \
      440                                                                 \
      441         if (KEY_INODE(_k) || KEY_OFFSET(_k)) {                  \
      442                 _ret = &KEY(KEY_INODE(_k), KEY_OFFSET(_k), 0);  \
      443                                                                 \
      444                 if (!_ret->low)                                 \
      445                         _ret->high--;                           \
      446                 _ret->low--;                                    \
      447         }                                                       \
      448                                                                 \
      449         _ret;                                                   \
      450 })
      
      At line 442, _ret points to address of a on-stack variable combined by
      KEY(), the life range of this on-stack variable is in line 442-446,
      once _ret is returned to bch_btree_insert_key(), the returned address
      points to an invalid stack address and this address is overwritten in
      the following called bch_btree_iter_init(). Then argument 'search' of
      bch_btree_iter_init() points to some address inside stackframe of
      bch_btree_iter_init(), exact address depends on how the compiler
      allocates stack space. Now the stack is corrupted.
      
      Fixes: 0eacac22
      
       ("bcache: PRECEDING_KEY()")
      Signed-off-by: default avatarColy Li <colyli@suse.de>
      Reviewed-by: default avatarRolf Fokkens <rolf@rolffokkens.nl>
      Reviewed-by: default avatarPierre JUHEN <pierre.juhen@orange.fr>
      Tested-by: default avatarShenghui Wang <shhuiw@foxmail.com>
      Tested-by: default avatarPierre JUHEN <pierre.juhen@orange.fr>
      Cc: Kent Overstreet <kent.overstreet@gmail.com>
      Cc: Nix <nix@esperi.org.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      31b90956
    • Dave Martin's avatar
      arm64/sve: Fix missing SVE/FPSIMD endianness conversions · 41040cf7
      Dave Martin authored
      The in-memory representation of SVE and FPSIMD registers is
      different: the FPSIMD V-registers are stored as single 128-bit
      host-endian values, whereas SVE registers are stored in an
      endianness-invariant byte order.
      
      This means that the two representations differ when running on a
      big-endian host.  But we blindly copy data from one representation
      to another when converting between the two, resulting in the
      register contents being unintentionally byteswapped in certain
      situations.  Currently this can be triggered by the first SVE
      instruction after a syscall, for example (though the potential
      trigger points may vary in future).
      
      So, fix the conversion functions fpsimd_to_sve(), sve_to_fpsimd()
      and sve_sync_from_fpsimd_zeropad() to swab where appropriate.
      
      There is no common swahl128() or swab128() that we could use here.
      Maybe it would be worth making this generic, but for now add a
      simple local hack.
      
      Since the byte order differences are exposed in ABI, also clarify
      the documentation.
      
      Cc: Alex Bennée <alex.bennee@linaro.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Alan Hayward <alan.hayward@arm.com>
      Cc: Julien Grall <julien.grall@arm.com>
      Fixes: bc0ee476 ("arm64/sve: Core task context handling")
      Fixes: 8cd969d2 ("arm64/sve: Signal handling support")
      Fixes: 43d4da2c
      
       ("arm64/sve: ptrace and ELF coredump support")
      Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
      [will: Fix typos in comments and docs spotted by Julien]
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      41040cf7
    • Ming Lei's avatar
      blk-mq: remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests · c326f846
      Ming Lei authored
      blk_mq_sched_free_requests() may be called in failure path in which
      q->elevator may not be setup yet, so remove WARN_ON(!q->elevator) from
      blk_mq_sched_free_requests for avoiding the false positive.
      
      This function is actually safe to call in case of !q->elevator because
      hctx->sched_tags is checked.
      
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Yi Zhang <yi.zhang@redhat.com>
      Fixes: c3e22192
      
       ("block: free sched's request pool in blk_cleanup_queue")
      Reported-by: default avatar <syzbot+b9d0d56867048c7bcfde@syzkaller.appspotmail.com>
      Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      c326f846
    • Andreas Herrmann's avatar
      blkio-controller.txt: Remove references to CFQ · fb5772cb
      Andreas Herrmann authored
      
      
      CFQ is gone. No need anymore to document its "proportional weight time
      based division of disk policy".
      
      Signed-off-by: default avatarAndreas Herrmann <aherrmann@suse.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      fb5772cb
    • Andreas Herrmann's avatar
      block/switching-sched.txt: Update to blk-mq schedulers · 8614b008
      Andreas Herrmann authored
      
      
      Remove references to CFQ and legacy block layer which are gone.
      Update example with what's available under blk-mq.
      
      Signed-off-by: default avatarAndreas Herrmann <aherrmann@suse.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      8614b008
    • Chaitanya Kulkarni's avatar
      null_blk: remove duplicate check for report zone · 154085ff
      Chaitanya Kulkarni authored
      
      
      This patch removes the check in the null_blk_zoned for report zone
      command, where it checks for the dev-,>zoned before executing the report
      zone.
      
      The null_zone_report() function is a block_device operation callback
      which is initialized in the null_blk_main.c and gets called as a part
      of blkdev for report zone IOCTL (BLKREPORTZONE).
      
      blkdev_ioctl()
      blkdev_report_zones_ioctl()
              blkdev_report_zones()
                      blk_report_zones()
                              disk->fops->report_zones()
                                      nullb_zone_report();
      
      The null_zone_report() will never get executed on the non-zoned block
      device, in the non zoned block device blk_queue_is_zoned() will always
      be false which is first check the blkdev_report_zones_ioctl()
      before actual low level driver report zone callback is executed.
      
      Here is the detailed scenario:-
      
      1. modprobe null_blk
      null_init
      null_alloc_dev
              dev->zoned = 0
      null_add_dev
              dev->zoned == 0
                      so we don't set the q->limits.zoned = BLK_ZONED_HR
      
      2. blkzone report /dev/nullb0
      
      blkdev_ioctl()
      blkdev_report_zones_ioctl()
              blk_queue_is_zoned()
                      blk_queue_is_zoned
                              q->limits.zoned == 0
                              return false
              if (!blk_queue_is_zoned(q)) <--- true
                      return -ENOTTY;
      
      Reviewed-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: default avatarBob Liu <bob.liu@oracle.com>
      Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      154085ff
    • Greg Kroah-Hartman's avatar
      blk-mq: no need to check return value of debugfs_create functions · 6cfc0081
      Greg Kroah-Hartman authored
      
      
      When calling debugfs functions, there is no need to ever check the
      return value.  The function can work or not, but the code logic should
      never do something different based on this.
      
      When all of these checks are cleaned up, lots of the functions used in
      the blk-mq-debugfs code can now return void, as no need to check the
      return value of them either.
      
      Overall, this ends up cleaning up the code and making it smaller, always
      a nice win.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: linux-block@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6cfc0081
    • Eric Biggers's avatar
      io_uring: fix memory leak of UNIX domain socket inode · 355e8d26
      Eric Biggers authored
      
      
      Opening and closing an io_uring instance leaks a UNIX domain socket
      inode.  This is because the ->file of the io_uring instance's internal
      UNIX domain socket is set to point to the io_uring file, but then
      sock_release() sees the non-NULL ->file and assumes the inode reference
      is held by the file so doesn't call iput().  That's not the case here,
      since the reference is still meant to be held by the socket; the actual
      inode of the io_uring file is different.
      
      Fix this leak by NULL-ing out ->file before releasing the socket.
      
      Reported-by: default avatar <syzbot+111cb28d9f583693aefa@syzkaller.appspotmail.com>
      Fixes: 2b188cc1
      
       ("Add io_uring IO interface")
      Cc: <stable@vger.kernel.org> # v5.1+
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      355e8d26
    • Damien Le Moal's avatar
      block: force select mq-deadline for zoned block devices · b9aef63a
      Damien Le Moal authored
      
      
      In most use cases of zoned block devices (aka SMR disks), the
      mq-deadline scheduler is mandatory as it implements sequential write
      command processing guarantees with zone write locking. So make sure that
      this scheduler is always enabled if CONFIG_BLK_DEV_ZONED is selected.
      
      Tested-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b9aef63a