1. 13 Nov, 2021 22 commits
    • Linus Torvalds's avatar
      Merge tag 'zstd-for-linus-v5.16' of git://github.com/terrelln/linux · c8c10954
      Linus Torvalds authored
      Pull zstd update from Nick Terrell:
       "Update to zstd-1.4.10.
      
        Add myself as the maintainer of zstd and update the zstd version in
        the kernel, which is now 4 years out of date, to a much more recent
        zstd release. This includes bug fixes, much more extensive fuzzing,
        and performance improvements. And generates the kernel zstd
        automatically from upstream zstd, so it is easier to keep the zstd
        verison up to date, and we don't fall so far out of date again.
      
        This includes 5 commits that update the zstd library version:
      
         - Adds a new kernel-style wrapper around zstd.
      
           This wrapper API is functionally equivalent to the subset of the
           current zstd API that is currently used. The wrapper API changes to
           be kernel style so that the symbols don't collide with zstd's
           symbols. The update to zstd-1.4.10 maintains the same API and
           preserves the semantics, so that none of the callers need to be
           updated. All callers are updated in the commit, because there are
           zero functional changes.
      
         - Adds an indirection for `lib/decompress_unzstd.c` so it doesn't
           depend on the layout of `lib/zstd/` to include every source file.
           This allows the next patch to be automatically generated.
      
         - Imports the zstd-1.4.10 source code. This commit is automatically
           generated from upstream zstd (https://github.com/facebook/zstd).
      
         - Adds me (terrelln@fb.com) as the maintainer of `lib/zstd`.
      
         - Fixes a newly added build warning for clang.
      
        The discussion around this patchset has been pretty long, so I've
        included a FAQ-style summary of the history of the patchset, and why
        we are taking this approach.
      
        Why do we need to update?
        -------------------------
      
        The zstd version in the kernel is based off of zstd-1.3.1, which is
        was released August 20, 2017. Since then zstd has seen many bug fixes
        and performance improvements. And, importantly, upstream zstd is
        continuously fuzzed by OSS-Fuzz, and bug fixes aren't backported to
        older versions. So the only way to sanely get these fixes is to keep
        up to date with upstream zstd.
      
        There are no known security issues that affect the kernel, but we need
        to be able to update in case there are. And while there are no known
        security issues, there are relevant bug fixes. For example the problem
        with large kernel decompression has been fixed upstream for over 2
        years [1]
      
        Additionally the performance improvements for kernel use cases are
        significant. Measured for x86_64 on my Intel i9-9900k @ 3.6 GHz:
      
         - BtrFS zstd compression at levels 1 and 3 is 5% faster
      
         - BtrFS zstd decompression+read is 15% faster
      
         - SquashFS zstd decompression+read is 15% faster
      
         - F2FS zstd compression+write at level 3 is 8% faster
      
         - F2FS zstd decompression+read is 20% faster
      
         - ZRAM decompression+read is 30% faster
      
         - Kernel zstd decompression is 35% faster
      
         - Initramfs zstd decompression+build is 5% faster
      
        On top of this, there are significant performance improvements coming
        down the line in the next zstd release, and the new automated update
        patch generation will allow us to pull them easily.
      
        How is the update patch generated?
        ----------------------------------
      
        The first two patches are preparation for updating the zstd version.
        Then the 3rd patch in the series imports upstream zstd into the
        kernel. This patch is automatically generated from upstream. A script
        makes the necessary changes and imports it into the kernel. The
        changes are:
      
         - Replace all libc dependencies with kernel replacements and rewrite
           includes.
      
         - Remove unncessary portability macros like: #if defined(_MSC_VER).
      
         - Use the kernel xxhash instead of bundling it.
      
        This automation gets tested every commit by upstream's continuous
        integration. When we cut a new zstd release, we will submit a patch to
        the kernel to update the zstd version in the kernel.
      
        The automated process makes it easy to keep the kernel version of zstd
        up to date. The current zstd in the kernel shares the guts of the
        code, but has a lot of API and minor changes to work in the kernel.
        This is because at the time upstream zstd was not ready to be used in
        the kernel envrionment as-is. But, since then upstream zstd has
        evolved to support being used in the kernel as-is.
      
        Why are we updating in one big patch?
        -------------------------------------
      
        The 3rd patch in the series is very large. This is because it is
        restructuring the code, so it both deletes the existing zstd, and
        re-adds the new structure. Future updates will be directly
        proportional to the changes in upstream zstd since the last import.
        They will admittidly be large, as zstd is an actively developed
        project, and has hundreds of commits between every release. However,
        there is no other great alternative.
      
        One option ruled out is to replay every upstream zstd commit. This is
        not feasible for several reasons:
      
         - There are over 3500 upstream commits since the zstd version in the
           kernel.
      
         - The automation to automatically generate the kernel update was only
           added recently, so older commits cannot easily be imported.
      
         - Not every upstream zstd commit builds.
      
         - Only zstd releases are "supported", and individual commits may have
           bugs that were fixed before a release.
      
        Another option to reduce the patch size would be to first reorganize
        to the new file structure, and then apply the patch. However, the
        current kernel zstd is formatted with clang-format to be more
        "kernel-like". But, the new method imports zstd as-is, without
        additional formatting, to allow for closer correlation with upstream,
        and easier debugging. So the patch wouldn't be any smaller.
      
        It also doesn't make sense to import upstream zstd commit by commit
        going forward. Upstream zstd doesn't support production use cases
        running of the development branch. We have a lot of post-commit
        fuzzing that catches many bugs, so indiviudal commits may be buggy,
        but fixed before a release. So going forward, I intend to import every
        (important) zstd release into the Kernel.
      
        So, while it isn't ideal, updating in one big patch is the only patch
        I see forward.
      
        Who is responsible for this code?
        ---------------------------------
      
        I am. This patchset adds me as the maintainer for zstd. Previously,
        there was no tree for zstd patches. Because of that, there were
        several patches that either got ignored, or took a long time to merge,
        since it wasn't clear which tree should pick them up. I'm officially
        stepping up as maintainer, and setting up my tree as the path through
        which zstd patches get merged. I'll make sure that patches to the
        kernel zstd get ported upstream, so they aren't erased when the next
        version update happens.
      
        How is this code tested?
        ------------------------
      
        I tested every caller of zstd on x86_64 (BtrFS, ZRAM, SquashFS, F2FS,
        Kernel, InitRAMFS). I also tested Kernel & InitRAMFS on i386 and
        aarch64. I checked both performance and correctness.
      
        Also, thanks to many people in the community who have tested these
        patches locally.
      
        Lastly, this code will bake in linux-next before being merged into
        v5.16.
      
        Why update to zstd-1.4.10 when zstd-1.5.0 has been released?
        ------------------------------------------------------------
      
        This patchset has been outstanding since 2020, and zstd-1.4.10 was the
        latest release when it was created. Since the update patch is
        automatically generated from upstream, I could generate it from
        zstd-1.5.0.
      
        However, there were some large stack usage regressions in zstd-1.5.0,
        and are only fixed in the latest development branch. And the latest
        development branch contains some new code that needs to bake in the
        fuzzer before I would feel comfortable releasing to the kernel.
      
        Once this patchset has been merged, and we've released zstd-1.5.1, we
        can update the kernel to zstd-1.5.1, and exercise the update process.
      
        You may notice that zstd-1.4.10 doesn't exist upstream. This release
        is an artifical release based off of zstd-1.4.9, with some fixes for
        the kernel backported from the development branch. I will tag the
        zstd-1.4.10 release after this patchset is merged, so the Linux Kernel
        is running a known version of zstd that can be debugged upstream.
      
        Why was a wrapper API added?
        ----------------------------
      
        The first versions of this patchset migrated the kernel to the
        upstream zstd API. It first added a shim API that supported the new
        upstream API with the old code, then updated callers to use the new
        shim API, then transitioned to the new code and deleted the shim API.
        However, Cristoph Hellwig suggested that we transition to a kernel
        style API, and hide zstd's upstream API behind that. This is because
        zstd's upstream API is supports many other use cases, and does not
        follow the kernel style guide, while the kernel API is focused on the
        kernel's use cases, and follows the kernel style guide.
      
        Where is the previous discussion?
        ---------------------------------
      
        Links for the discussions of the previous versions of the patch set
        below. The largest changes in the design of the patchset are driven by
        the discussions in v11, v5, and v1. Sorry for the mix of links, I
        couldn't find most of the the threads on lkml.org"
      
      Link: https://lkml.org/lkml/2020/9/29/27 [1]
      Link: https://www.spinics.net/lists/linux-crypto/msg58189.html [v12]
      Link: https://lore.kernel.org/linux-btrfs/20210430013157.747152-1-nickrterrell@gmail.com/ [v11]
      Link: https://lore.kernel.org/lkml/20210426234621.870684-2-nickrterrell@gmail.com/ [v10]
      Link: https://lore.kernel.org/linux-btrfs/20210330225112.496213-1-nickrterrell@gmail.com/ [v9]
      Link: https://lore.kernel.org/linux-f2fs-devel/20210326191859.1542272-1-nickrterrell@gmail.com/ [v8]
      Link: https://lkml.org/lkml/2020/12/3/1195 [v7]
      Link: https://lkml.org/lkml/2020/12/2/1245 [v6]
      Link: https://lore.kernel.org/linux-btrfs/20200916034307.2092020-1-nickrterrell@gmail.com/ [v5]
      Link: https://www.spinics.net/lists/linux-btrfs/msg105783.html [v4]
      Link: https://lkml.org/lkml/2020/9/23/1074 [v3]
      Link: https://www.spinics.net/lists/linux-btrfs/msg105505.html [v2]
      Link: https://lore.kernel.org/linux-btrfs/20200916034307.2092020-1-nickrterrell@gmail.com/ [v1]
      Signed-off-by: default avatarNick Terrell <terrelln@fb.com>
      Tested By: Paul Jones <paul@pauljones.id.au>
      Tested-by: default avatarOleksandr Natalenko <oleksandr@natalenko.name>
      Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM/Clang v13.0.0 on x86-64
      Tested-by: default avatarJean-Denis Girard <jd.girard@sysnux.pf>
      
      * tag 'zstd-for-linus-v5.16' of git://github.com/terrelln/linux:
        lib: zstd: Add cast to silence clang's -Wbitwise-instead-of-logical
        MAINTAINERS: Add maintainer entry for zstd
        lib: zstd: Upgrade to latest upstream zstd version 1.4.10
        lib: zstd: Add decompress_sources.h for decompress_unzstd
        lib: zstd: Add kernel-specific API
      c8c10954
    • Linus Torvalds's avatar
      Merge tag 'virtio-mem-for-5.16' of git://github.com/davidhildenbrand/linux · ccfff0a2
      Linus Torvalds authored
      Pull virtio-mem update from David Hildenbrand:
       "Support the VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE feature in virtio-mem,
        now that "accidential" access to logically unplugged memory inside
        added Linux memory blocks is no longer possible, because we:
      
         - Removed /dev/kmem in commit bbcd53c9 ("drivers/char: remove
           /dev/kmem for good")
      
         - Disallowed access to virtio-mem device memory via /dev/mem in
           commit 2128f4e2 ("virtio-mem: disallow mapping virtio-mem memory
           via /dev/mem")
      
         - Sanitized access to virtio-mem device memory via /proc/kcore in
           commit 0daa322b ("fs/proc/kcore: don't read offline sections,
           logically offline pages and hwpoisoned pages")
      
         - Sanitized access to virtio-mem device memory via /proc/vmcore in
           commit ce281462 ("virtio-mem: kdump mode to sanitize
           /proc/vmcore access")
      
        The new VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE feature that will be
        required by some hypervisors implementing virtio-mem in the near
        future, so let's support it now that we safely can"
      
      * tag 'virtio-mem-for-5.16' of git://github.com/davidhildenbrand/linux:
        virtio-mem: support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
      ccfff0a2
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 3ad7befd
      Linus Torvalds authored
      Pull more clk updates from Stephen Boyd:
       "This is the second batch of clk driver updates that needed a little
        more time to soak in linux-next.
      
         - Use modern i2c probe in vc5
      
         - Cleanup some includes
      
         - Update links to datasheets
      
         - Add UniPhier NX1 SoC clk support
      
         - Fix DT bindings for SiFive FU740
      
         - Revert the module platform driver support for Rockchip because it
           wasn't actually tested
      
         - Fix the composite clk code again as the previous fix had a one line
           bug that broke rate changes for clks that want to use the same
           parent still
      
         - Use the right table for a divider in ast2600 driver
      
         - Get rid of gcc_aggre1_pnoc_ahb_clk in qcom clk driver again because
           its critical but unused"
      
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: qcom: gcc-msm8996: Drop (again) gcc_aggre1_pnoc_ahb_clk
        clk: imx8m: Do not set IMX_COMPOSITE_CORE for non-regular composites
        clk/ast2600: Fix soc revision for AHB
        clk: composite: Fix 'switching' to same clock
        clk: rockchip: drop module parts from rk3399 and rk3568 drivers
        Revert "clk: rockchip: use module_platform_driver_probe"
        clk:mediatek: remove duplicate include in clk-mt8195-imp_iic_wrap.c
        dt-bindings: clock: fu740-prci: add reset-cells
        clk: uniphier: Add SoC-glue clock source selector support for Pro4
        dt-bindings: clock: uniphier: Add clock binding for SoC-glue
        clk: uniphier: Add NX1 clock support
        dt-bindings: clock: uniphier: Add NX1 clock binding
        clk: uniphier: Add audio system and video input clock control for PXs3
        clk: si5351: Update datasheet references
        clk: vc5: Use i2c .probe_new
        clk/actions/owl-factor.c: remove superfluous headers
        clk: ingenic: Fix bugs with divided dividers
      3ad7befd
    • Linus Torvalds's avatar
      Merge tag 'block-5.16-2021-11-13' of git://git.kernel.dk/linux-block · f44c7dbd
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Set of fixes that should go into this merge window:
      
         - ioctl vs read data race fixes (Shin'ichiro)
      
         - blkcg use-after-free fix (Laibin)
      
         - Last piece of the puzzle for add_disk() error handling, enable
           __must_check for (Luis)
      
         - Request allocation fixes (Ming)
      
         - Misc fixes (me)"
      
      * tag 'block-5.16-2021-11-13' of git://git.kernel.dk/linux-block:
        blk-mq: fix filesystem I/O request allocation
        blkcg: Remove extra blkcg_bio_issue_init
        block: Hold invalidate_lock in BLKRESETZONE ioctl
        blk-mq: rename blk_attempt_bio_merge
        blk-mq: don't grab ->q_usage_counter in blk_mq_sched_bio_merge
        block: fix kerneldoc for disk_register_independent_access__ranges()
        block: add __must_check for *add_disk*() callers
        block: use enum type for blk_mq_alloc_data->rq_flags
        block: Hold invalidate_lock in BLKZEROOUT ioctl
        block: Hold invalidate_lock in BLKDISCARD ioctl
      f44c7dbd
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.16-2021-11-13' of git://git.kernel.dk/linux-block · 2b7196a2
      Linus Torvalds authored
      Pull io_uring fix from Jens Axboe:
       "Just a single fix here for a buffered write hash stall, which is also
        affecting stable"
      
      * tag 'io_uring-5.16-2021-11-13' of git://git.kernel.dk/linux-block:
        io-wq: serialize hash clear with wakeup
      2b7196a2
    • Linus Torvalds's avatar
      Merge tag '5.16-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · c8103c27
      Linus Torvalds authored
      Pull more cifs updates from Steve French:
      
       - improvements to reconnect and multichannel
      
       - a performance improvement (additional use of SMB3 compounding)
      
       - DFS code cleanup and improvements
      
       - various trivial Coverity fixes
      
       - two fscache fixes
      
       - an fsync fix
      
      * tag '5.16-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: (23 commits)
        cifs: do not duplicate fscache cookie for secondary channels
        cifs: connect individual channel servers to primary channel server
        cifs: protect session channel fields with chan_lock
        cifs: do not negotiate session if session already exists
        smb3: do not setup the fscache_super_cookie until fsinfo initialized
        cifs: fix potential use-after-free bugs
        cifs: fix memory leak of smb3_fs_context_dup::server_hostname
        smb3: add additional null check in SMB311_posix_mkdir
        cifs: release lock earlier in dequeue_mid error case
        smb3: add additional null check in SMB2_tcon
        smb3: add additional null check in SMB2_open
        smb3: add additional null check in SMB2_ioctl
        smb3: remove trivial dfs compile warning
        cifs: support nested dfs links over reconnect
        smb3: do not error on fsync when readonly
        cifs: for compound requests, use open handle if possible
        cifs: set a minimum of 120s for next dns resolution
        cifs: split out dfs code from cifs_reconnect()
        cifs: convert list_for_each to entry variant
        cifs: introduce new helper for cifs_reconnect()
        ...
      c8103c27
    • Linus Torvalds's avatar
      Revert "mm: shmem: don't truncate page if memory failure happens" · d0b51bfb
      Linus Torvalds authored
      This reverts commit b9d02f1b.
      
      The error handling of that patch was fundamentally broken, and it needs
      to be entirely re-done.
      
      For example, in shmem_write_begin() it would call shmem_getpage(), then
      ignore the error return from that, and look at the page pointer contents
      instead.
      
      And in shmem_read_mapping_page_gfp(), the patch tested PageHWPoison() on
      a page pointer that two lines earlier had potentially been set as an
      error pointer.
      
      These issues could be individually fixed, but when it has this many
      issues, I'm just reverting it instead of waiting for fixes.
      
      Link: https://lore.kernel.org/linux-mm/20211111084617.6746-1-ajaygargnsit@gmail.com/Reported-by: default avatarAjay Garg <ajaygargnsit@gmail.com>
      Reported-by: default avatarJens Axboe <axboe@kernel.dk>
      Cc: Yang Shi <shy828301@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d0b51bfb
    • Linus Torvalds's avatar
      Merge tag '5.16-rc-ksmbd-fixes' of git://git.samba.org/ksmbd · a6132241
      Linus Torvalds authored
      Pull ksmbd updates from Steve French:
       "Several smb server fixes; three for stable:
      
         - important fix for negotiation info validation
      
         - fix alignment check in packet validation
      
         - cleanup of dead code (like MD4)
      
         - refactoring some protocol headers to use common code in smbfs_common"
      
      * tag '5.16-rc-ksmbd-fixes' of git://git.samba.org/ksmbd:
        ksmbd: Use the SMB3_Create definitions from the shared
        ksmbd: Move more definitions into the shared area
        ksmbd: use the common definitions for NEGOTIATE_PROTOCOL
        ksmbd: switch to use shared definitions where available
        ksmbd: change LeaseKey data type to u8 array
        ksmbd: remove smb2_buf_length in smb2_transform_hdr
        ksmbd: remove smb2_buf_length in smb2_hdr
        ksmbd: remove md4 leftovers
        ksmbd: set unique value to volume serial field in FS_VOLUME_INFORMATION
        ksmbd: don't need 8byte alignment for request length in ksmbd_check_message
        ksmbd: Fix buffer length check in fsctl_validate_negotiate_info()
        ksmbd: Remove redundant 'flush_workqueue()' calls
        ksmdb: use cmd helper variable in smb2_get_ksmbd_tcon()
        ksmbd: use ksmbd_req_buf_next() in ksmbd_smb2_check_message()
        ksmbd: use ksmbd_req_buf_next() in ksmbd_verify_smb_message()
      a6132241
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.16-rc1' of git://github.com/ceph/ceph-client · 0ecca62b
      Linus Torvalds authored
      Pull ceph updates from Ilya Dryomov:
       "One notable change here is that async creates and unlinks introduced
        in 5.7 are now enabled by default. This should greatly speed up things
        like rm, tar and rsync. To opt out, wsync mount option can be used.
      
        Other than that we have a pile of bug fixes all across the filesystem
        from Jeff, Xiubo and Kotresh and a metrics infrastructure rework from
        Luis"
      
      * tag 'ceph-for-5.16-rc1' of git://github.com/ceph/ceph-client:
        ceph: add a new metric to keep track of remote object copies
        libceph, ceph: move ceph_osdc_copy_from() into cephfs code
        ceph: clean-up metrics data structures to reduce code duplication
        ceph: split 'metric' debugfs file into several files
        ceph: return the real size read when it hits EOF
        ceph: properly handle statfs on multifs setups
        ceph: shut down mount on bad mdsmap or fsmap decode
        ceph: fix mdsmap decode when there are MDS's beyond max_mds
        ceph: ignore the truncate when size won't change with Fx caps issued
        ceph: don't rely on error_string to validate blocklisted session.
        ceph: just use ci->i_version for fscache aux info
        ceph: shut down access to inode when async create fails
        ceph: refactor remove_session_caps_cb
        ceph: fix auth cap handling logic in remove_session_caps_cb
        ceph: drop private list from remove_session_caps_cb
        ceph: don't use -ESTALE as special return code in try_get_cap_refs
        ceph: print inode numbers instead of pointer values
        ceph: enable async dirops by default
        libceph: drop ->monmap and err initialization
        ceph: convert to noop_direct_IO
      0ecca62b
    • Linus Torvalds's avatar
      Merge tag 'erofs-for-5.16-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs · a27c0858
      Linus Torvalds authored
      Pull erofs fixes from Gao Xiang:
      
       - fix unsafe pagevec reuse which could cause unexpected behaviors
      
       - get rid of the unused DELAYEDALLOC strategy that has been replaced by
         TRYALLOC
      
      * tag 'erofs-for-5.16-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
        erofs: remove useless cache strategy of DELAYEDALLOC
        erofs: fix unsafe pagevec reuse of hooked pclusters
      a27c0858
    • Linus Torvalds's avatar
      Merge tag 'f2fs-for-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs · 5664896b
      Linus Torvalds authored
      Pull f2fs updates from Jaegeuk Kim:
       "In this cycle, we've applied relatively small number of patches which
        fix subtle corner cases mainly, while introducing a new mount option
        to be able to fragment the disk intentionally for performance tests.
      
        Enhancements:
      
         - add a mount option to fragmente on-disk layout to understand the
           performance
      
         - support direct IO for multi-partitions
      
         - add a fault injection of dquot_initialize
      
        Bug fixes:
      
         - address some lockdep complaints
      
         - fix a deadlock issue with quota
      
         - fix a memory tuning condition
      
         - fix compression condition to improve the ratio
      
         - fix disabling compression on the non-empty compressed file
      
         - invalidate cached pages before IPU/DIO writes
      
        And, we've added some minor clean-ups as usual"
      
      * tag 'f2fs-for-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs:
        f2fs: fix UAF in f2fs_available_free_memory
        f2fs: invalidate META_MAPPING before IPU/DIO write
        f2fs: support fault injection for dquot_initialize()
        f2fs: fix incorrect return value in f2fs_sanity_check_ckpt()
        f2fs: compress: disallow disabling compress on non-empty compressed file
        f2fs: compress: fix overwrite may reduce compress ratio unproperly
        f2fs: multidevice: support direct IO
        f2fs: introduce fragment allocation mode mount option
        f2fs: replace snprintf in show functions with sysfs_emit
        f2fs: include non-compressed blocks in compr_written_block
        f2fs: fix wrong condition to trigger background checkpoint correctly
        f2fs: fix to use WHINT_MODE
        f2fs: fix up f2fs_lookup tracepoints
        f2fs: set SBI_NEED_FSCK flag when inconsistent node block found
        f2fs: introduce excess_dirty_threshold()
        f2fs: avoid attaching SB_ACTIVE flag during mount
        f2fs: quota: fix potential deadlock
        f2fs: should use GFP_NOFS for directory inodes
      5664896b
    • Linus Torvalds's avatar
      Merge tag 'netfs-folio-20211111' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · 0f7ddea6
      Linus Torvalds authored
      Pull netfs, 9p, afs and ceph (partial) foliation from David Howells:
       "This converts netfslib, 9p and afs to use folios. It also partially
        converts ceph so that it uses folios on the boundaries with netfslib.
      
        To help with this, a couple of folio helper functions are added in the
        first two patches.
      
        These patches don't touch fscache and cachefiles as I intend to remove
        all the code that deals with pages directly from there. Only nfs and
        cifs are using the old fscache I/O API now. The new API uses iov_iter
        instead.
      
        Thanks to Jeff Layton, Dominique Martinet and AuriStor for testing and
        retesting the patches"
      
      * tag 'netfs-folio-20211111' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Use folios in directory handling
        netfs, 9p, afs, ceph: Use folios
        folio: Add a function to get the host inode for a folio
        folio: Add a function to change the private data attached to a folio
      0f7ddea6
    • Linus Torvalds's avatar
      Merge tag 'coccinelle-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux · a9b9669d
      Linus Torvalds authored
      Pull coccinelle updates from Julia Lawall:
      
       - Update MAINTAINERS information (mailing list, web page, etc).
      
       - Add a semantic patch from Wen Yang to check for do_div calls that may
         cause truncation, motivated by commit b0ab99e7 ("sched: Fix
         possible divide by zero in avg_atom() calculation")
      
      * tag 'coccinelle-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
        coccinelle: update Coccinelle entry
        coccinelle: semantic patch to check for inappropriate do_div() calls
      a9b9669d
    • Linus Torvalds's avatar
      Merge tag 'selinux-pr-20211112' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux · 0a907292
      Linus Torvalds authored
      Pull selinux fixes from Paul Moore:
       "Unfortunately I need to request a revert for two LSM/SELinux patches
        that came in via the network tree. The two patches in question add a
        new SCTP/LSM hook as well as an SELinux implementation of that LSM
        hook. The short version of "why?" is in the commit description of the
        revert patch, but I'll copy-n-paste the important bits below to save
        some time for the curious:
      
            ... Unfortunately these two patches were merged without proper
            review (the Reviewed-by and Tested-by tags from Richard Haines
            were for previous revisions of these patches that were
            significantly different) and there are outstanding objections from
            the SELinux maintainers regarding these patches.
      
            Work is currently ongoing to correct the problems identified in
            the reverted patches, as well as others that have come up during
            review, but it is unclear at this point in time when that work
            will be ready for inclusion in the mainline kernel. In the
            interest of not keeping objectionable code in the kernel for
            multiple weeks, and potentially a kernel release, we are reverting
            the two problematic patches.
      
        As usual with these things there is plenty of context to go with this
        and I'll try to do my best to provide that now. This effort started
        with a report of SCTP client side peel-offs not working correctly with
        SELinux, Ondrej Mosnacek put forth a patch which he believed properly
        addressed the problem but upon review by the netdev folks Xin Long
        described some additional issues and submitted an improved patchset
        for review. The SELinux folks reviewed Xin Long's initial patchset and
        suggested some changes which resulted in a second patchset (v2) from
        Xin Long; this is the patchset that is currently in your tree.
        Unfortunately this v2 patchset from Xin Long was merged before it had
        spent even just 24 hours on the mailing lists during the early days of
        the merge window, a time when many of us were busy doing verification
        of the newly released v5.15 kernel as well final review and testing of
        our v5.16 pull requests. Making matters worse, upon reviewing the v2
        patchset there were both changes which were found objectionable by
        SELinux standards as well as additional outstanding SCTP/SELinux
        interaction problems. At this point we did two things: resumed working
        on a better fix for the SCTP/SELinux issue(s) - thank you Ondrej - and
        we asked the networking folks to revert the v2 patchset.
      
        The revert request was obviously rejected, but at the time I believed
        it was just going to be an issue for linux-next; I wasn't expecting
        something this significant that was merged into the networking tree
        during the merge window to make it into your tree in the same window,
        yet as of last night that is exactly what happened. While we continue
        to try and resolve the SCTP/SELinux problem I am asking once again to
        revert the v2 patches and not ship the current
        security_sctp_assoc_established() hook in a v5.16-rcX kernel. If I was
        confident that we could solve these issues in a week, maybe two, I
        would refrain from asking for the revert but our current estimate is
        for a minimum of two weeks for the next patch revision. With the
        likelihood of additional delays due to normal patch review follow-up
        and/or holidays it seems to me that the safest course of action is to
        revert the patch both to try and keep some objectionable code out of a
        release kernel and limit the chances of any new breakages from such a
        change. While the SCTP/SELinux code in v5.15 and earlier has problems,
        they are known problems, and I'd like to try and avoid creating new
        and different problems while we work to fix things properly.
      
        One final thing to mention: Xin Long's v2 patchset consisted of four
        patches, yet this revert is for only the last two. We see the first
        two patches as good, reasonable, and not likely to cause an issue. In
        an attempt to create a cleaner revert patch we suggest leaving the
        first two patches in the tree as they are currently"
      
      * tag 'selinux-pr-20211112' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
        net,lsm,selinux: revert the security_sctp_assoc_established() hook
      0a907292
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 7c3737c7
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Three tracing fixes:
      
         - Make local osnoise_instances static
      
         - Copy just actual size of histogram strings
      
         - Properly check missing operands in histogram expressions"
      
      * tag 'trace-v5.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing/histogram: Fix check for missing operands in an expression
        tracing/histogram: Do not copy the fixed-size char array field over the field size
        tracing/osnoise: Make osnoise_instances static
      7c3737c7
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 4d6fe79f
      Linus Torvalds authored
      Pull more kvm updates from Paolo Bonzini:
       "New x86 features:
      
         - Guest API and guest kernel support for SEV live migration
      
         - SEV and SEV-ES intra-host migration
      
        Bugfixes and cleanups for x86:
      
         - Fix misuse of gfn-to-pfn cache when recording guest steal time /
           preempted status
      
         - Fix selftests on APICv machines
      
         - Fix sparse warnings
      
         - Fix detection of KVM features in CPUID
      
         - Cleanups for bogus writes to MSR_KVM_PV_EOI_EN
      
         - Fixes and cleanups for MSR bitmap handling
      
         - Cleanups for INVPCID
      
         - Make x86 KVM_SOFT_MAX_VCPUS consistent with other architectures
      
        Bugfixes for ARM:
      
         - Fix finalization of host stage2 mappings
      
         - Tighten the return value of kvm_vcpu_preferred_target()
      
         - Make sure the extraction of ESR_ELx.EC is limited to architected
           bits"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (34 commits)
        KVM: SEV: unify cgroup cleanup code for svm_vm_migrate_from
        KVM: x86: move guest_pv_has out of user_access section
        KVM: x86: Drop arbitrary KVM_SOFT_MAX_VCPUS
        KVM: Move INVPCID type check from vmx and svm to the common kvm_handle_invpcid()
        KVM: VMX: Add a helper function to retrieve the GPR index for INVPCID, INVVPID, and INVEPT
        KVM: nVMX: Clean up x2APIC MSR handling for L2
        KVM: VMX: Macrofy the MSR bitmap getters and setters
        KVM: nVMX: Handle dynamic MSR intercept toggling
        KVM: nVMX: Query current VMCS when determining if MSR bitmaps are in use
        KVM: x86: Don't update vcpu->arch.pv_eoi.msr_val when a bogus value was written to MSR_KVM_PV_EOI_EN
        KVM: x86: Rename kvm_lapic_enable_pv_eoi()
        KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES
        KVM: x86: Add helper to consolidate core logic of SET_CPUID{2} flows
        kvm: mmu: Use fast PF path for access tracking of huge pages when possible
        KVM: x86/mmu: Properly dereference rcu-protected TDP MMU sptep iterator
        KVM: x86: inhibit APICv when KVM_GUESTDBG_BLOCKIRQ active
        kvm: x86: Convert return type of *is_valid_rdpmc_ecx() to bool
        KVM: x86: Fix recording of guest steal time / preempted status
        selftest: KVM: Add intra host migration tests
        selftest: KVM: Add open sev dev helper
        ...
      4d6fe79f
    • Linus Torvalds's avatar
      Merge branch 'exit-cleanups-for-v5.16' of... · d4fa09e5
      Linus Torvalds authored
      Merge branch 'exit-cleanups-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull vm86 fix from Eric Biederman:
       "Just the removal of an unnecessary (and incorrect) test from a BUG_ON"
      
      * 'exit-cleanups-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        signal/vm86_32: Remove pointless test in BUG_ON
      d4fa09e5
    • Linus Torvalds's avatar
      Merge tag 's390-5.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · be427a88
      Linus Torvalds authored
      Pull more s390 updates from Vasily Gorbik:
      
       - Add PCI automatic error recovery.
      
       - Fix tape driver timer initialization broken during timers api
         cleanup.
      
       - Fix bogus CPU measurement counters values on CPUs offlining.
      
       - Check the validity of subchanel before reading other fields in the
         schib in cio code.
      
      * tag 's390-5.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/cio: check the subchannel validity for dev_busid
        s390/cpumf: cpum_cf PMU displays invalid value after hotplug remove
        s390/tape: fix timer initialization in tape_std_assign()
        s390/pci: implement minimal PCI error recovery
        PCI: Export pci_dev_lock()
        s390/pci: implement reset_slot for hotplug slot
        s390/pci: refresh function handle in iomap
      be427a88
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.16-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · b89f311d
      Linus Torvalds authored
      Pull RISC-V updates from Palmer Dabbelt:
      
       - Support for time namespaces in the VDSO, along with some associated
         cleanups.
      
       - Support for building rv32 randconfigs.
      
       - Improvements to the XIP port that allow larger kernels to function
      
       - Various device tree cleanups for both the SiFive and Microchip boards
      
       - A handful of defconfig updates, including enabling Nouveau.
      
      There are also various small cleanups.
      
      * tag 'riscv-for-linus-5.16-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: defconfig: enable DRM_NOUVEAU
        riscv/vdso: Drop unneeded part due to merge issue
        riscv: remove .text section size limitation for XIP
        riscv: dts: sifive: add missing compatible for plic
        riscv: dts: microchip: add missing compatibles for clint and plic
        riscv: dts: sifive: drop duplicated nodes and properties in sifive
        riscv: dts: sifive: fix Unleashed board compatible
        riscv: dts: sifive: use only generic JEDEC SPI NOR flash compatible
        riscv: dts: microchip: use vendor compatible for Cadence SD4HC
        riscv: dts: microchip: drop unused pinctrl-names
        riscv: dts: microchip: drop duplicated MMC/SDHC node
        riscv: dts: microchip: fix board compatible
        riscv: dts: microchip: drop duplicated nodes
        dt-bindings: mmc: cdns: document Microchip MPFS MMC/SDHCI controller
        riscv: add rv32 and rv64 randconfig build targets
        riscv: mm: don't advertise 1 num_asid for 0 asid bits
        riscv: set default pm_power_off to NULL
        riscv/vdso: Add support for time namespaces
      b89f311d
    • Linus Torvalds's avatar
      Merge tag 'mips_5.16_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · 4218a96f
      Linus Torvalds authored
      Pull more MIPS updates from Thomas Bogendoerfer:
      
       - Config updates for BMIPS platform
      
       - Build fixes
      
       - Makefile cleanups
      
      * tag 'mips_5.16_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        mips: decompressor: do not copy source files while building
        MIPS: boot/compressed/: add __bswapdi2() to target for ZSTD decompression
        MIPS: fix duplicated slashes for Platform file path
        MIPS: fix *-pkg builds for loongson2ef platform
        PCI: brcmstb: Allow building for BMIPS_GENERIC
        MIPS: BMIPS: Enable PCI Kconfig
        MIPS: VDSO: remove -nostdlib compiler flag
        mips: BCM63XX: ensure that CPU_SUPPORTS_32BIT_KERNEL is set
        MIPS: Update bmips_stb_defconfig
        MIPS: Allow modules to set board_be_handler
      4218a96f
    • Shyam Prasad N's avatar
      cifs: do not duplicate fscache cookie for secondary channels · 46bb1b94
      Shyam Prasad N authored
      We allocate index cookies for each connection from the client.
      However, we don't need this index for each channel in case of
      multichannel. So making sure that we avoid creating duplicate
      cookies by instantiating only for primary channel.
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      46bb1b94
    • Shyam Prasad N's avatar
      cifs: connect individual channel servers to primary channel server · 0f2b305a
      Shyam Prasad N authored
      Today, we don't have any way to get the smb session for any
      of the secondary channels. Introducing a pointer to the primary
      server from server struct of any secondary channel. The value will
      be NULL for the server of the primary channel. This will enable us
      to get the smb session for any channel.
      
      This will be needed for some of the changes that I'm planning
      to make soon.
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      0f2b305a
  2. 12 Nov, 2021 18 commits
    • Shyam Prasad N's avatar
      cifs: protect session channel fields with chan_lock · 724244cd
      Shyam Prasad N authored
      Introducing a new spin lock to protect all the channel related
      fields in a cifs_ses struct. This lock should be taken
      whenever dealing with the channel fields, and should be held
      only for very short intervals which will not sleep.
      
      Currently, all channel related fields in cifs_ses structure
      are protected by session_mutex. However, this mutex is held for
      long periods (sometimes while waiting for a reply from server).
      This makes the codepath quite tricky to change.
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      724244cd
    • Shyam Prasad N's avatar
      cifs: do not negotiate session if session already exists · 8e07757b
      Shyam Prasad N authored
      In cifs_get_smb_ses, if we find an existing matching session,
      we should not send a negotiate request for the session if a
      session reconnect is not necessary.
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      8e07757b
    • Eric W. Biederman's avatar
      signal/vm86_32: Remove pointless test in BUG_ON · c7a9b647
      Eric W. Biederman authored
      kernel test robot <oliver.sang@intel.com> writes[1]:
      >
      > Greeting,
      >
      > FYI, we noticed the following commit (built with gcc-9):
      >
      > commit: 1a4d21a2 ("signal/vm86_32: Replace open coded BUG_ON with an actual BUG_ON")
      > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
      >
      > in testcase: trinity
      > version: trinity-static-i386-x86_64-1c734c75-1_2020-01-06
      > with following parameters:
      >
      >
      > [ 70.645554][ T3747] kernel BUG at arch/x86/kernel/vm86_32.c:109!
      > [ 70.646185][ T3747] invalid opcode: 0000 [#1] SMP
      > [ 70.646682][ T3747] CPU: 0 PID: 3747 Comm: trinity-c6 Not tainted 5.15.0-rc1-00009-g1a4d21a2 #1
      > [ 70.647598][ T3747] EIP: save_v86_state (arch/x86/kernel/vm86_32.c:109 (discriminator 3))
      > [ 70.648113][ T3747] Code: 89 c3 64 8b 35 60 b8 25 c2 83 ec 08 89 55 f0 8b 96 10 19 00 00 89 55 ec e8 c6 2d 0c 00 fb 8b 55 ec 85 d2 74 05 83 3a 00 75 02 <0f> 0b 8b 86 10 19 00 00 8b 4b 38 8b 78 48 31 cf 89 f8 8b 7a 4c 81
      > [ 70.650136][ T3747] EAX: 00000001 EBX: f5f49fac ECX: 0000000b EDX: f610b600
      > [ 70.650852][ T3747] ESI: f5f79cc0 EDI: f5f79cc0 EBP: f5f49f04 ESP: f5f49ef0
      > [ 70.651593][ T3747] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010246
      > [ 70.652413][ T3747] CR0: 80050033 CR2: 00004000 CR3: 35fc7000 CR4: 000406d0
      > [ 70.653169][ T3747] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      > [ 70.653897][ T3747] DR6: fffe0ff0 DR7: 00000400
      > [ 70.654382][ T3747] Call Trace:
      > [ 70.654719][ T3747] arch_do_signal_or_restart (arch/x86/kernel/signal.c:792 arch/x86/kernel/signal.c:867)
      > [ 70.655288][ T3747] exit_to_user_mode_prepare (kernel/entry/common.c:174 kernel/entry/common.c:209)
      > [ 70.655854][ T3747] irqentry_exit_to_user_mode (kernel/entry/common.c:126 kernel/entry/common.c:317)
      > [ 70.656450][ T3747] irqentry_exit (kernel/entry/common.c:406)
      > [ 70.656897][ T3747] exc_page_fault (arch/x86/mm/fault.c:1535)
      > [ 70.657369][ T3747] ? sysvec_kvm_asyncpf_interrupt (arch/x86/mm/fault.c:1488)
      > [ 70.657989][ T3747] handle_exception (arch/x86/entry/entry_32.S:1085)
      
      vm86_32.c:109 is: "BUG_ON(!vm86 || !vm86->user_vm86)"
      
      When trying to understand the failure Brian Gerst pointed out[2] that
      the code does not need protection against vm86->user_vm86 being NULL.
      The copy_from_user code will already handles that case if the address
      is going to fault.
      
      Looking futher I realized that if we care about not allowing struct
      vm86plus_struct at address 0 it should be do_sys_vm86 (the system
      call) that does the filtering.  Not way down deep when the emulation
      has completed in save_v86_state.
      
      So let's just remove the silly case of attempting to filter a
      userspace address with a BUG_ON.  Existing userspace can't break and
      it won't make the kernel any more attackable as the userspace access
      helpers will handle it, if it isn't a good userspace pointer.
      
      I have run the reproducer the fuzzer gave me before I made this change
      and it reproduced, and after I made this change and I have not seen
      the reported failure.  So it does looks like this fixes the reported
      issue.
      
      [1] https://lkml.kernel.org/r/20211112074030.GB19820@xsang-OptiPlex-9020
      [2] https://lkml.kernel.org/r/CAMzpN2jkK5sAv-Kg_kVnCEyVySiqeTdUORcC=AdG1gV6r8nUew@mail.gmail.comSuggested-by: default avatarBrian Gerst <brgerst@gmail.com>
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Tested-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      c7a9b647
    • Paolo Bonzini's avatar
      Merge tag 'kvmarm-fixes-5.16-1' of... · 84886c26
      Paolo Bonzini authored
      Merge tag 'kvmarm-fixes-5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master
      
      KVM/arm64 fixes for 5.16, take #1
      
      - Fix the host S2 finalization by solely iterating over the memblocks
        instead of the whole IPA space
      
      - Tighten the return value of kvm_vcpu_preferred_target() now that
        32bit support is long gone
      
      - Make sure the extraction of ESR_ELx.EC is limited to the architected
        bits
      
      - Comment fixups
      84886c26
    • Kalesh Singh's avatar
      tracing/histogram: Fix check for missing operands in an expression · 1cab6bce
      Kalesh Singh authored
      If a binary operation is detected while parsing an expression string,
      the operand strings are deduced by splitting the experssion string at
      the position of the detected binary operator. Both operand strings are
      sub-strings (can be empty string) of the expression string but will
      never be NULL.
      
      Currently a NULL check is used for missing operands, fix this by
      checking for empty strings instead.
      
      Link: https://lkml.kernel.org/r/20211112191324.1302505-1-kaleshsingh@google.comSigned-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
      Fixes: 9710b2f3 ("tracing: Fix operator precedence for hist triggers expression")
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      1cab6bce
    • Masami Hiramatsu's avatar
      tracing/histogram: Do not copy the fixed-size char array field over the field size · 63f84ae6
      Masami Hiramatsu authored
      Do not copy the fixed-size char array field of the events over
      the field size. The histogram treats char array as a string and
      there are 2 types of char array in the event, fixed-size and
      dynamic string. The dynamic string (__data_loc) field must be
      null terminated, but the fixed-size char array field may not
      be null terminated (not a string, but just a data).
      In that case, histogram can copy the data after the field.
      This uses the original field size for fixed-size char array
      field to restrict the histogram not to access over the original
      field size.
      
      Link: https://lkml.kernel.org/r/163673292822.195747.3696966210526410250.stgit@devnote2
      
      Fixes: 02205a67 (tracing: Add support for 'field variables')
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      63f84ae6
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 66f4beaa
      Linus Torvalds authored
      Pull crypto fix from Herbert Xu:
       "This fixes a boot crash regression"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: api - Fix boot-up crash when crypto manager is disabled
      66f4beaa
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 6cbcc7ab
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "This series is all the stragglers that didn't quite make the first
        merge window pull. It's mostly minor updates and bug fixes of merge
        window code but it also has two driver updates: ufs and qla2xxx"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (46 commits)
        scsi: scsi_debug: Don't call kcalloc() if size arg is zero
        scsi: core: Remove command size deduction from scsi_setup_scsi_cmnd()
        scsi: scsi_ioctl: Validate command size
        scsi: ufs: ufshpb: Properly handle max-single-cmd
        scsi: core: Avoid leaving shost->last_reset with stale value if EH does not run
        scsi: bsg: Fix errno when scsi_bsg_register_queue() fails
        scsi: sr: Remove duplicate assignment
        scsi: ufs: ufs-exynos: Introduce ExynosAuto v9 virtual host
        scsi: ufs: ufs-exynos: Multi-host configuration for ExynosAuto v9
        scsi: ufs: ufs-exynos: Support ExynosAuto v9 UFS
        scsi: ufs: ufs-exynos: Add pre/post_hce_enable drv callbacks
        scsi: ufs: ufs-exynos: Factor out priv data init
        scsi: ufs: ufs-exynos: Add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR option
        scsi: ufs: ufs-exynos: Support custom version of ufs_hba_variant_ops
        scsi: ufs: ufs-exynos: Add setup_clocks callback
        scsi: ufs: ufs-exynos: Add refclkout_stop control
        scsi: ufs: ufs-exynos: Simplify drv_data retrieval
        scsi: ufs: ufs-exynos: Change pclk available max value
        scsi: ufs: Add quirk to enable host controller without PH configuration
        scsi: ufs: Add quirk to handle broken UIC command
        ...
      6cbcc7ab
    • Linus Torvalds's avatar
      Merge tag 'pwm/for-5.16-rc1' of... · 030c28a0
      Linus Torvalds authored
      Merge tag 'pwm/for-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
      
      Pull pwm updates from Thierry Reding:
       "This set is mostly small fixes and cleanups, so more of a janitorial
        update for this cycle"
      
      * tag 'pwm/for-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
        pwm: vt8500: Rename pwm_busy_wait() to make it obviously driver-specific
        dt-bindings: pwm: tpu: Add R-Car M3-W+ device tree bindings
        dt-bindings: pwm: tpu: Add R-Car V3U device tree bindings
        pwm: pwm-samsung: Trigger manual update when disabling PWM
        pwm: visconti: Simplify using devm_pwmchip_add()
        pwm: samsung: Describe driver in Kconfig
        pwm: Make it explicit that pwm_apply_state() might sleep
        pwm: Add might_sleep() annotations for !CONFIG_PWM API functions
        pwm: atmel: Drop unused header
      030c28a0
    • Linus Torvalds's avatar
      Merge tag 'sound-fix-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 0d5d7463
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of fixes for 5.16-rc1, notably for a few regressions that
        were found in 5.15 and pre-rc1:
      
         - revert of the unification of SG-buffer helper functions on x86 and
           the relevant fix
      
         - regression fixes for mmap after the recent code refactoring
      
         - two NULL dereference fixes in HD-audio controller driver
      
         - UAF fixes in ALSA timer core
      
         - a few usual HD-audio and FireWire quirks"
      
      * tag 'sound-fix-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: fireworks: add support for Loud Onyx 1200f quirk
        ALSA: hda: fix general protection fault in azx_runtime_idle
        ALSA: hda: Free card instance properly at probe errors
        ALSA: hda/realtek: Add quirk for HP EliteBook 840 G7 mute LED
        ALSA: memalloc: Remove a stale comment
        ALSA: synth: missing check for possible NULL after the call to kstrdup
        ALSA: memalloc: Use proper SG helpers for noncontig allocations
        ALSA: pci: rme: Fix unaligned buffer addresses
        ALSA: firewire-motu: add support for MOTU Track 16
        ALSA: PCM: Fix NULL dereference at mmap checks
        ALSA: hda/realtek: Add quirk for ASUS UX550VE
        ALSA: timer: Unconditionally unlink slave instances, too
        ALSA: memalloc: Catch call with NULL snd_dma_buffer pointer
        Revert "ALSA: memalloc: Convert x86 SG-buffer handling with non-contiguous type"
        ALSA: hda/realtek: Add a quirk for Acer Spin SP513-54N
        ALSA: firewire-motu: add support for MOTU Traveler mk3
        ALSA: hda/realtek: Headset fixup for Clevo NH77HJQ
        ALSA: timer: Fix use-after-free problem
      0d5d7463
    • Linus Torvalds's avatar
      Merge tag 'drm-next-2021-11-12' of git://anongit.freedesktop.org/drm/drm · 304ac803
      Linus Torvalds authored
      Pull more drm updates from Dave Airlie:
       "I missed a drm-misc-next pull for the main pull last week. It wasn't
        that major and isn't the bulk of this at all. This has a bunch of
        fixes all over, a lot for amdgpu and i915.
      
        bridge:
         - HPD improvments for lt9611uxc
         - eDP aux-bus support for ps8640
         - LVDS data-mapping selection support
      
        ttm:
         - remove huge page functionality (needs reworking)
         - fix a race condition during BO eviction
      
        panels:
         - add some new panels
      
        fbdev:
         - fix double-free
         - remove unused scrolling acceleration
         - CONFIG_FB dep improvements
      
        locking:
         - improve contended locking logging
         - naming collision fix
      
        dma-buf:
         - add dma_resv_for_each_fence iterator
         - fix fence refcounting bug
         - name locking fixesA
      
        prime:
         - fix object references during mmap
      
        nouveau:
         - various code style changes
         - refcount fix
         - device removal fixes
         - protect client list with a mutex
         - fix CE0 address calculation
      
        i915:
         - DP rates related fixes
         - Revert disabling dual eDP that was causing state readout problems
         - put the cdclk vtables in const data
         - Fix DVO port type for older platforms
         - Fix blankscreen by turning DP++ TMDS output buffers on encoder->shutdown
         - CCS FBs related fixes
         - Fix recursive lock in GuC submission
         - Revert guc_id from i915_request tracepoint
         - Build fix around dmabuf
      
        amdgpu:
         - GPU reset fix
         - Aldebaran fix
         - Yellow Carp fixes
         - DCN2.1 DMCUB fix
         - IOMMU regression fix for Picasso
         - DSC display fixes
         - BPC display calculation fixes
         - Other misc display fixes
         - Don't allow partial copy from user for DC debugfs
         - SRIOV fixes
         - GFX9 CSB pin count fix
         - Various IP version check fixes
         - DP 2.0 fixes
         - Limit DCN1 MPO fix to DCN1
      
        amdkfd:
         - SVM fixes
         - Fix gfx version for renoir
         - Reset fixes
      
        udl:
         - timeout fix
      
        imx:
         - circular locking fix
      
        virtio:
         - NULL ptr deref fix"
      
      * tag 'drm-next-2021-11-12' of git://anongit.freedesktop.org/drm/drm: (126 commits)
        drm/ttm: Double check mem_type of BO while eviction
        drm/amdgpu: add missed support for UVD IP_VERSION(3, 0, 64)
        drm/amdgpu: drop jpeg IP initialization in SRIOV case
        drm/amd/display: reject both non-zero src_x and src_y only for DCN1x
        drm/amd/display: Add callbacks for DMUB HPD IRQ notifications
        drm/amd/display: Don't lock connection_mutex for DMUB HPD
        drm/amd/display: Add comment where CONFIG_DRM_AMD_DC_DCN macro ends
        drm/amdkfd: Fix retry fault drain race conditions
        drm/amdkfd: lower the VAs base offset to 8KB
        drm/amd/display: fix exit from amdgpu_dm_atomic_check() abruptly
        drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov
        drm/amdgpu: fix uvd crash on Polaris12 during driver unloading
        drm/i915/adlp/fb: Prevent the mapping of redundant trailing padding NULL pages
        drm/i915/fb: Fix rounding error in subsampled plane size calculation
        drm/i915/hdmi: Turn DP++ TMDS output buffers back on in encoder->shutdown()
        drm/locking: fix __stack_depot_* name conflict
        drm/virtio: Fix NULL dereference error in virtio_gpu_poll
        drm/amdgpu: fix SI handling in amdgpu_device_asic_has_dc_support()
        drm/amdgpu: Fix dangling kfd_bo pointer for shared BOs
        drm/amd/amdkfd: Don't sent command to HWS on kfd reset
        ...
      304ac803
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · f78e9de8
      Linus Torvalds authored
      Pull input updates from Dmitry Torokhov:
       "Just one new driver (Cypress StreetFighter touchkey), and no input
        core changes this time.
      
        Plus various fixes and enhancements to existing drivers"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (54 commits)
        Input: iforce - fix control-message timeout
        Input: wacom_i2c - use macros for the bit masks
        Input: ili210x - reduce sample period to 15ms
        Input: ili210x - improve polled sample spacing
        Input: ili210x - special case ili251x sample read out
        Input: elantench - fix misreporting trackpoint coordinates
        Input: synaptics-rmi4 - Fix device hierarchy
        Input: i8042 - Add quirk for Fujitsu Lifebook T725
        Input: cap11xx - add support for cap1206
        Input: remove unused header <linux/input/cy8ctmg110_pdata.h>
        Input: ili210x - add ili251x firmware update support
        Input: ili210x - export ili251x version details via sysfs
        Input: ili210x - use resolution from ili251x firmware
        Input: pm8941-pwrkey - respect reboot_mode for warm reset
        reboot: export symbol 'reboot_mode'
        Input: max77693-haptic - drop unneeded MODULE_ALIAS
        Input: cpcap-pwrbutton - do not set input parent explicitly
        Input: max8925_onkey - don't mark comment as kernel-doc
        Input: ads7846 - do not attempt IRQ workaround when deferring probe
        Input: ads7846 - use input_set_capability()
        ...
      f78e9de8
    • Linus Torvalds's avatar
      Merge tag 'rtc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux · 3b81bf78
      Linus Torvalds authored
      Pull RTC updates from Alexandre Belloni:
       "This includes new ioctls to get and set parameters and in particular
        the backup switch mode that is needed for some RTCs to actually enable
        the backup voltage (and have a useful RTC).
      
        The same interface can also be used to get the actual features
        supported by the RTC so userspace has a better way than trying and
        failing.
      
        Summary:
      
        Subsystem:
         - Add new ioctl to get and set extra RTC parameters, this includes
           backup switch mode
         - Expose available features to userspace, in particular, when alarmas
           have a resolution of one minute instead of a second.
         - Let the core handle those alarms with a minute resolution
      
        New driver:
         - MSTAR MSC313 RTC
      
        Drivers:
         - Add SPI ID table where necessary
         - Add BSM support for rv3028, rv3032 and pcf8523
         - s3c: set RTC range
         - rx8025: set range, implement .set_offset and .read_offset"
      
      * tag 'rtc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (50 commits)
        rtc: rx8025: use .set_offset/.read_offset
        rtc: rx8025: use rtc_add_group
        rtc: rx8025: clear RTC_FEATURE_ALARM when alarm are not supported
        rtc: rx8025: set range
        rtc: rx8025: let the core handle the alarm resolution
        rtc: rx8025: switch to devm_rtc_allocate_device
        rtc: ab8500: let the core handle the alarm resolution
        rtc: ab-eoz9: support UIE when available
        rtc: ab-eoz9: use RTC_FEATURE_UPDATE_INTERRUPT
        rtc: rv3032: let the core handle the alarm resolution
        rtc: s35390a: let the core handle the alarm resolution
        rtc: handle alarms with a minute resolution
        rtc: pcf85063: silence cppcheck warning
        rtc: rv8803: fix writing back ctrl in flag register
        rtc: s3c: Add time range
        rtc: s3c: Extract read/write IO into separate functions
        rtc: s3c: Remove usage of devm_rtc_device_register()
        rtc: tps80031: Remove driver
        rtc: sun6i: Allow probing without an early clock provider
        rtc: pcf8523: add BSM support
        ...
      3b81bf78
    • Linus Torvalds's avatar
      Merge tag 'libata-5.16-rc1-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · 204d32ef
      Linus Torvalds authored
      Pull more libata updates from Damien Le Moal:
       "Second round of updates for libata for 5.16:
      
         - Fix READ LOG EXT and READ LOG DMA EXT command timeouts during disk
           revalidation after a resume or a modprobe of the LLDD (me)
      
         - Remove unnecessary error message in sata_highbank driver (Xu)
      
         - Better handling of accesses to the IDENTIFY DEVICE data log for
           drives that do not support this log page (me)
      
         - Fix ahci_shost_attr_group declaration in ahci driver (me)"
      
      * tag 'libata-5.16-rc1-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        libata: libahci: declare ahci_shost_attr_group as static
        libata: add horkage for missing Identify Device log
        ata: sata_highbank: Remove unnecessary print function dev_err()
        libata: fix read log timeout value
      204d32ef
    • Steve French's avatar
      smb3: do not setup the fscache_super_cookie until fsinfo initialized · 02102744
      Steve French authored
      We were calling cifs_fscache_get_super_cookie after tcon but before
      we queried the info (QFS_Info) we need to initialize the cookie
      properly.  Also includes an additional check suggested by Paulo
      to make sure we don't initialize super cookie twice.
      Suggested-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      02102744
    • Sasha Levin's avatar
      tools/lib/lockdep: drop liblockdep · 7246f4dc
      Sasha Levin authored
      TL;DR: While a tool like liblockdep is useful, it probably doesn't
      belong within the kernel tree.
      
      liblockdep attempts to reuse kernel code both directly (by directly
      building the kernel's lockdep code) as well as indirectly (by using
      sanitized headers). This makes liblockdep an integral part of the
      kernel.
      
      It also makes liblockdep quite unique: while other userspace code might
      use sanitized headers, it generally doesn't attempt to use kernel code
      directly which means that changes on the kernel side of things don't
      affect (and break) it directly.
      
      All our workflows and tooling around liblockdep don't support this
      uniqueness. Changes that go into the kernel code aren't validated to not
      break in-tree userspace code.
      
      liblockdep ended up being very fragile, breaking over and over, to the
      point that living in the same tree as the lockdep code lost most of it's
      value.
      
      liblockdep should continue living in an external tree, syncing with
      the kernel often, in a controllable way.
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7246f4dc
    • Paulo Alcantara's avatar
      cifs: fix potential use-after-free bugs · 7f28af9c
      Paulo Alcantara authored
      Ensure that share and prefix variables are set to NULL after kfree()
      when looping through DFS targets in __tree_connect_dfs_target().
      
      Also, get rid of @ref in __tree_connect_dfs_target() and just pass a
      boolean to indicate whether we're handling link targets or not.
      
      Fixes: c88f7dcd ("cifs: support nested dfs links over reconnect")
      Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      7f28af9c
    • Paulo Alcantara's avatar
      cifs: fix memory leak of smb3_fs_context_dup::server_hostname · 869da64d
      Paulo Alcantara authored
      Fix memory leak of smb3_fs_context_dup::server_hostname when parsing
      and duplicating fs contexts during mount(2) as reported by kmemleak:
      
        unreferenced object 0xffff888125715c90 (size 16):
          comm "mount.cifs", pid 3832, jiffies 4304535868 (age 190.094s)
          hex dump (first 16 bytes):
            7a 65 6c 64 61 2e 74 65 73 74 00 6b 6b 6b 6b a5  zelda.test.kkkk.
          backtrace:
            [<ffffffff8168106e>] kstrdup+0x2e/0x60
            [<ffffffffa027a362>] smb3_fs_context_dup+0x392/0x8d0 [cifs]
            [<ffffffffa0136353>] cifs_smb3_do_mount+0x143/0x1700 [cifs]
            [<ffffffffa02795e8>] smb3_get_tree+0x2e8/0x520 [cifs]
            [<ffffffff817a19aa>] vfs_get_tree+0x8a/0x2d0
            [<ffffffff8181e3e3>] path_mount+0x423/0x1a10
            [<ffffffff8181fbca>] __x64_sys_mount+0x1fa/0x270
            [<ffffffff83ae364b>] do_syscall_64+0x3b/0x90
            [<ffffffff83c0007c>] entry_SYSCALL_64_after_hwframe+0x44/0xae
        unreferenced object 0xffff888111deed20 (size 32):
          comm "mount.cifs", pid 3832, jiffies 4304536044 (age 189.918s)
          hex dump (first 32 bytes):
            44 46 53 52 4f 4f 54 31 2e 5a 45 4c 44 41 2e 54  DFSROOT1.ZELDA.T
            45 53 54 00 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5  EST.kkkkkkkkkkk.
          backtrace:
            [<ffffffff8168118d>] kstrndup+0x2d/0x90
            [<ffffffffa027ab2e>] smb3_parse_devname+0x9e/0x360 [cifs]
            [<ffffffffa01870c8>] cifs_setup_volume_info+0xa8/0x470 [cifs]
            [<ffffffffa018c469>] connect_dfs_target+0x309/0xc80 [cifs]
            [<ffffffffa018d6cb>] cifs_mount+0x8eb/0x17f0 [cifs]
            [<ffffffffa0136475>] cifs_smb3_do_mount+0x265/0x1700 [cifs]
            [<ffffffffa02795e8>] smb3_get_tree+0x2e8/0x520 [cifs]
            [<ffffffff817a19aa>] vfs_get_tree+0x8a/0x2d0
            [<ffffffff8181e3e3>] path_mount+0x423/0x1a10
            [<ffffffff8181fbca>] __x64_sys_mount+0x1fa/0x270
            [<ffffffff83ae364b>] do_syscall_64+0x3b/0x90
            [<ffffffff83c0007c>] entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: 7be3248f ("cifs: To match file servers, make sure the server hostname matches")
      Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      869da64d