Skip to content
  1. Jun 20, 2023
    • Christian Brauner's avatar
      ovl: modify layer parameter parsing · b36a5780
      Christian Brauner authored
      
      
      We ran into issues where mount(8) passed multiple lower layers as one
      big string through fsconfig(). But the fsconfig() FSCONFIG_SET_STRING
      option is limited to 256 bytes in strndup_user(). While this would be
      fixable by extending the fsconfig() buffer I'd rather encourage users to
      append layers via multiple fsconfig() calls as the interface allows
      nicely for this. This has also been requested as a feature before.
      
      With this port to the new mount api the following will be possible:
      
              fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir", "/lower1", 0);
      
              /* set upper layer */
              fsconfig(fs_fd, FSCONFIG_SET_STRING, "upperdir", "/upper", 0);
      
              /* append "/lower2", "/lower3", and "/lower4" */
              fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir", ":/lower2:/lower3:/lower4", 0);
      
              /* turn index feature on */
              fsconfig(fs_fd, FSCONFIG_SET_STRING, "index", "on", 0);
      
              /* append "/lower5" */
              fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir", ":/lower5", 0);
      
      Specifying ':' would have been rejected so this isn't a regression. And
      we can't simply use "lowerdir=/lower" to append on top of existing
      layers as "lowerdir=/lower,lowerdir=/other-lower" would make
      "/other-lower" the only lower layer so we'd break uapi if we changed
      this. So the ':' prefix seems a good compromise.
      
      Users can choose to specify multiple layers at once or individual
      layers. A layer is appended if it starts with ":". This requires that
      the user has already added at least one layer before. If lowerdir is
      specified again without a leading ":" then all previous layers are
      dropped and replaced with the new layers. If lowerdir is specified and
      empty than all layers are simply dropped.
      
      An additional change is that overlayfs will now parse and resolve layers
      right when they are specified in fsconfig() instead of deferring until
      super block creation. This allows users to receive early errors.
      
      It also allows users to actually use up to 500 layers something which
      was theoretically possible but ended up not working due to the mount
      option string passed via mount(2) being too large.
      
      This also allows a more privileged process to set config options for a
      lesser privileged process as the creds for fsconfig() and the creds for
      fsopen() can differ. We could restrict that they match by enforcing that
      the creds of fsopen() and fsconfig() match but I don't see why that
      needs to be the case and allows for a good delegation mechanism.
      
      Plus, in the future it means we're able to extend overlayfs mount
      options and allow users to specify layers via file descriptors instead
      of paths:
      
              fsconfig(FSCONFIG_SET_PATH{_EMPTY}, "lowerdir", "lower1", dirfd);
      
              /* append */
              fsconfig(FSCONFIG_SET_PATH{_EMPTY}, "lowerdir", "lower2", dirfd);
      
              /* append */
              fsconfig(FSCONFIG_SET_PATH{_EMPTY}, "lowerdir", "lower3", dirfd);
      
              /* clear all layers specified until now */
              fsconfig(FSCONFIG_SET_STRING, "lowerdir", NULL, 0);
      
      This would be especially nice if users create an overlayfs mount on top
      of idmapped layers or just in general private mounts created via
      open_tree(OPEN_TREE_CLONE). Those mounts would then never have to appear
      anywhere in the filesystem. But for now just do the minimal thing.
      
      We should probably aim to move more validation into ovl_fs_parse_param()
      so users get errors before fsconfig(FSCONFIG_CMD_CREATE). But that can
      be done in additional patches later.
      
      This is now also rebased on top of the lazy lowerdata lookup which
      allows the specificatin of data only layers using the new "::" syntax.
      
      The rules are simple. A data only layers cannot be followed by any
      regular layers and data layers must be preceeded by at least one regular
      layer.
      
      Parsing the lowerdir mount option must change because of this. The
      original patchset used the old lowerdir parsing function to split a
      lowerdir mount option string such as:
      
              lowerdir=/lower1:/lower2::/lower3::/lower4
      
      simply replacing each non-escaped ":" by "\0". So sequences of
      non-escaped ":" were counted as layers. For example, the previous
      lowerdir mount option above would've counted 6 layers instead of 4 and a
      lowerdir mount option such as:
      
              lowerdir="/lower1:/lower2::/lower3::/lower4:::::::::::::::::::::::::::"
      
      would be counted as 33 layers. Other than being ugly this didn't matter
      much because kern_path() would reject the first "\0" layer. However,
      this overcounting of layers becomes problematic when we base allocations
      on it where we very much only want to allocate space for 4 layers
      instead of 33.
      
      So the new parsing function rejects non-escaped sequences of colons
      other than ":" and "::" immediately instead of relying on kern_path().
      
      Link: https://github.com/util-linux/util-linux/issues/2287
      Link: https://github.com/util-linux/util-linux/issues/1992
      Link: https://bugs.archlinux.org/task/78702
      Link: https://lore.kernel.org/linux-unionfs/20230530-klagen-zudem-32c0908c2108@brauner
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      b36a5780
  2. Jun 19, 2023
  3. Jun 12, 2023
    • Linus Torvalds's avatar
      Linux 6.4-rc6 · 858fd168
      Linus Torvalds authored
      858fd168
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.4_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4c605260
      Linus Torvalds authored
      Pull x86 fix from Borislav Petkov:
      
       - Set up the kernel CS earlier in the boot process in case EFI boots
         the kernel after bypassing the decompressor and the CS descriptor
         used ends up being the EFI one which is not mapped in the identity
         page table, leading to early SEV/SNP guest communication exceptions
         resulting in the guest crashing
      
      * tag 'x86_urgent_for_v6.4_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/head/64: Switch to KERNEL_CS as soon as new GDT is installed
      4c605260
    • Linus Torvalds's avatar
      Merge tag '6.4-rc5-smb3-server-fixes' of git://git.samba.org/ksmbd · 65d7ca59
      Linus Torvalds authored
      Pull smb server fixes from Steve French:
       "Five smb3 server fixes, all also for stable:
      
         - Fix four slab out of bounds warnings: improve checks for protocol
           id, and for small packet length, and for create context parsing,
           and for negotiate context parsing
      
         - Fix for incorrect dereferencing POSIX ACLs"
      
      * tag '6.4-rc5-smb3-server-fixes' of git://git.samba.org/ksmbd:
        ksmbd: validate smb request protocol id
        ksmbd: check the validation of pdu_size in ksmbd_conn_handler_loop
        ksmbd: fix posix_acls and acls dereferencing possible ERR_PTR()
        ksmbd: fix out-of-bound read in parse_lease_state()
        ksmbd: fix out-of-bound read in deassemble_neg_contexts()
      65d7ca59
  4. Jun 11, 2023
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 022ce886
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Biggest news is that Andi Shyti steps in for maintaining the
        controller drivers. Thank you very much!
      
        Other than that, one new driver maintainer and the rest is usual
        driver bugfixes. at24 has a Kconfig dependecy fix"
      
      * tag 'i2c-for-6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        MAINTAINERS: Add entries for Renesas RZ/V2M I2C driver
        eeprom: at24: also select REGMAP
        i2c: sprd: Delete i2c adapter in .remove's error path
        i2c: mv64xxx: Fix reading invalid status value in atomic mode
        i2c: designware: fix idx_write_cnt in read loop
        i2c: mchp-pci1xxxx: Avoid cast to incompatible function type
        i2c: img-scb: Fix spelling mistake "innacurate" -> "inaccurate"
        MAINTAINERS: Add myself as I2C host drivers maintainer
      022ce886
    • Linus Torvalds's avatar
      Merge tag 'soundwire-6.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire · 6be5e47b
      Linus Torvalds authored
      Pull soundwire fixes from Vinod Koul:
       "Core fix for missing flag clear, error patch handling in qcom driver
        and BIOS quirk for HP Spectre x360:
      
         - HP Spectre x360 soundwire DMI quirk
      
         - Error path handling for qcom driver
      
         - Core fix for missing clear of alloc_slave_rt"
      
      * tag 'soundwire-6.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
        soundwire: stream: Add missing clear of alloc_slave_rt
        soundwire: qcom: add proper error paths in qcom_swrm_startup()
        soundwire: dmi-quirks: add new mapping for HP Spectre x360
      6be5e47b
    • Linus Torvalds's avatar
      Merge tag 'arm-fixes-6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 859c7459
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "Most of the changes this time are for the Qualcomm Snapdragon
        platforms.
      
        There are bug fixes for error handling in Qualcomm icc-bwmon,
        rpmh-rsc, ramp_controller and rmtfs driver as well as the AMD tee
        firmware driver and a missing initialization in the Arm ff-a firmware
        driver. The Qualcomm RPMh and EDAC drivers need some rework to work
        correctly on all supported chips.
      
        The DT fixes include:
      
         - i.MX8 fixes for gpio, pinmux and clock settings
      
         - ADS touchscreen gpio polarity settings in several machines
      
         - Address dtb warnings for caches, panel and input-enable properties
           on Qualcomm platforms
      
         - Incorrect data on qualcomm platforms fir SA8155P power domains,
           SM8550 LLCC, SC7180-lite SDRAM frequencies and SM8550 soundwire
      
         - Remoteproc firmware paths are corrected for Sony Xperia 10 IV"
      
      * tag 'arm-fixes-6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (36 commits)
        firmware: arm_ffa: Set handle field to zero in memory descriptor
        ARM: dts: Fix erroneous ADS touchscreen polarities
        arm64: dts: imx8mn-beacon: Fix SPI CS pinmux
        arm64: dts: imx8-ss-dma: assign default clock rate for lpuarts
        arm64: dts: imx8qm-mek: correct GPIOs for USDHC2 CD and WP signals
        EDAC/qcom: Get rid of hardcoded register offsets
        EDAC/qcom: Remove superfluous return variable assignment in qcom_llcc_core_setup()
        arm64: dts: qcom: sm8550: Use the correct LLCC register scheme
        dt-bindings: cache: qcom,llcc: Fix SM8550 description
        arm64: dts: qcom: sc7180-lite: Fix SDRAM freq for misidentified sc7180-lite boards
        arm64: dts: qcom: sm8550: use uint16 for Soundwire interval
        soc: qcom: rpmhpd: Add SA8155P power domains
        arm64: dts: qcom: Split out SA8155P and use correct RPMh power domains
        dt-bindings: power: qcom,rpmpd: Add SA8155P
        soc: qcom: Rename ice to qcom_ice to avoid module name conflict
        soc: qcom: rmtfs: Fix error code in probe()
        soc: qcom: ramp_controller: Fix an error handling path in qcom_ramp_controller_probe()
        ARM: dts: at91: sama7g5ek: fix debounce delay property for shdwc
        ARM: at91: pm: fix imbalanced reference counter for ethernet devices
        arm64: dts: qcom: sm6375-pdx225: Fix remoteproc firmware paths
        ...
      859c7459
  5. Jun 10, 2023
    • Linus Torvalds's avatar
      Merge tag 'block-6.4-2023-06-09' of git://git.kernel.dk/linux · 64569520
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Fix an issue with the hardware queue nr_active, causing it to become
         imbalanced (Tian)
      
       - Fix an issue with null_blk not releasing pages if configured as
         memory backed (Nitesh)
      
       - Fix a locking issue in dasd (Jan)
      
      * tag 'block-6.4-2023-06-09' of git://git.kernel.dk/linux:
        s390/dasd: Use correct lock while counting channel queue length
        null_blk: Fix: memory release when memory_backed=1
        blk-mq: fix blk_mq_hw_ctx active request accounting
      64569520
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · dbfa18c5
      Linus Torvalds authored
      Pull virtio bug fixes from Michael Tsirkin:
       "A bunch of fixes all over the place"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        tools/virtio: use canonical ftrace path
        vhost_vdpa: support PACKED when setting-getting vring_base
        vhost: support PACKED when setting-getting vring_base
        vhost: Fix worker hangs due to missed wake up calls
        vhost: Fix crash during early vhost_transport_send_pkt calls
        vhost_net: revert upend_idx only on retriable error
        vhost_vdpa: tell vqs about the negotiated
        vdpa/mlx5: Fix hang when cvq commands are triggered during device unregister
        tools/virtio: Add .gitignore for ringtest
        tools/virtio: Fix arm64 ringtest compilation error
        vduse: avoid empty string for dev name
        vhost: use kzalloc() instead of kmalloc() followed by memset()
      dbfa18c5
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-6.4-rc6' of https://github.com/ceph/ceph-client · 7e8c948b
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "A fix for a potential data corruption in differential backup and
        snapshot-based mirroring scenarios in RBD and a reference counting
        fixup to avoid use-after-free in CephFS, all marked for stable"
      
      * tag 'ceph-for-6.4-rc6' of https://github.com/ceph/ceph-client:
        ceph: fix use-after-free bug for inodes when flushing capsnaps
        rbd: get snapshot context after exclusive lock is ensured to be held
        rbd: move RBD_OBJ_FLAG_COPYUP_ENABLED flag setting
      7e8c948b
    • Jan Höppner's avatar
      s390/dasd: Use correct lock while counting channel queue length · ccc45cb4
      Jan Höppner authored
      The lock around counting the channel queue length in the BIODASDINFO
      ioctl was incorrectly changed to the dasd_block->queue_lock with commit
      583d6535 ("dasd: remove dead code"). This can lead to endless list
      iterations and a subsequent crash.
      
      The queue_lock is supposed to be used only for queue lists belonging to
      dasd_block. For dasd_device related queue lists the ccwdev lock must be
      used.
      
      Fix the mentioned issues by correctly using the ccwdev lock instead of
      the queue lock.
      
      Fixes: 583d6535
      
       ("dasd: remove dead code")
      Cc: stable@vger.kernel.org # v5.0+
      Signed-off-by: default avatarJan Höppner <hoeppner@linux.ibm.com>
      Reviewed-by: default avatarStefan Haberland <sth@linux.ibm.com>
      Signed-off-by: default avatarStefan Haberland <sth@linux.ibm.com>
      Link: https://lore.kernel.org/r/20230609153750.1258763-2-sth@linux.ibm.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ccc45cb4
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 0f506c7f
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A fix to avoid ISA-disallowed privilege mappings that can result from
         WRITE+EXEC mmap requests from userspace.
      
       - A fix for kfence to handle the huge pages.
      
       - A fix to avoid converting misaligned VAs to huge pages.
      
       - ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE has been selected so kprobe
         can understand user pointers.
      
      * tag 'riscv-for-linus-6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: fix kprobe __user string arg print fault issue
        riscv: Check the virtual alignment before choosing a map size
        riscv: Fix kfence now that the linear mapping can be backed by PUD/P4D/PGD
        riscv: mm: Ensure prot of VM_WRITE and VM_EXEC must be readable
      0f506c7f
    • Linus Torvalds's avatar
      Merge tag 's390-6.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 87aceaa7
      Linus Torvalds authored
      Pull s390 fixes from Alexander Gordeev:
      
       - Avoid linker error for randomly generated config file that has
         CONFIG_BRANCH_PROFILE_NONE enabled and make it similar to riscv, x86
         and also to commit 4bf3ec38 ("s390: disable branch profiling for
         vdso").
      
       - Currently, if the device is offline and all the channel paths are
         either configured or varied offline, the associated subchannel gets
         unregistered. Don't unregister the subchannel, instead unregister
         offline device.
      
      * tag 's390-6.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/purgatory: disable branch profiling
        s390/cio: unregister device when the only path is gone
      87aceaa7
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 92d22212
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
       "Two fixes for the GPIO testing module and one commit making Andy a
        reviewer for the GPIO subsystem:
      
         - fix a memory corruption bug in gpio-sim
      
         - fix inconsistencies in user-space configuration of gpio-sim
      
         - make Andy Shevchenko a reviewer for the GPIO subsystem"
      
      * tag 'gpio-fixes-for-v6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        MAINTAINERS: add Andy Shevchenko as reviewer for the GPIO subsystem
        gpio: sim: quietly ignore configured lines outside the bank
        gpio: sim: fix memory corruption when adding named lines and unnamed hogs
      92d22212
    • Ross Zwisler's avatar
      tools/virtio: use canonical ftrace path · 07496eea
      Ross Zwisler authored
      
      
      The canonical location for the tracefs filesystem is at /sys/kernel/tracing.
      
      But, from Documentation/trace/ftrace.rst:
      
        Before 4.1, all ftrace tracing control files were within the debugfs
        file system, which is typically located at /sys/kernel/debug/tracing.
        For backward compatibility, when mounting the debugfs file system,
        the tracefs file system will be automatically mounted at:
      
        /sys/kernel/debug/tracing
      
      A few spots in tools/virtio still refer to this older debugfs
      path, so let's update them to avoid confusion.
      
      Signed-off-by: default avatarRoss Zwisler <zwisler@google.com>
      Message-Id: <20230215223350.2658616-6-zwisler@google.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarMukesh Ojha <quic_mojha@quicinc.com>
      07496eea
    • Shannon Nelson's avatar
      vhost_vdpa: support PACKED when setting-getting vring_base · beee7fdb
      Shannon Nelson authored
      Use the right structs for PACKED or split vqs when setting and
      getting the vring base.
      
      Fixes: 4c8cf318
      
       ("vhost: introduce vDPA-based backend")
      Signed-off-by: default avatarShannon Nelson <shannon.nelson@amd.com>
      Message-Id: <20230424225031.18947-4-shannon.nelson@amd.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      beee7fdb
    • Shannon Nelson's avatar
      vhost: support PACKED when setting-getting vring_base · 55d8122f
      Shannon Nelson authored
      Use the right structs for PACKED or split vqs when setting and
      getting the vring base.
      
      Fixes: 4c8cf318
      
       ("vhost: introduce vDPA-based backend")
      Signed-off-by: default avatarShannon Nelson <shannon.nelson@amd.com>
      Message-Id: <20230424225031.18947-3-shannon.nelson@amd.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      55d8122f