1. 12 Jun, 2023 6 commits
    • Mickaël Salaün's avatar
      selftests/landlock: Add hostfs tests · 35ca4239
      Mickaël Salaün authored
      Add tests for the hostfs filesystems to make sure it has a consistent
      inode management, which is required for Landlock's file hierarchy
      identification.  This adds 5 new tests for layout3_fs with the hostfs
      variant.
      
      Add hostfs to the new (architecture-specific) config.um file.
      
      The hostfs filesystem, only available for an User-Mode Linux kernel, is
      special because we cannot explicitly mount it.  The layout3_fs.hostfs
      variant tests are skipped if the current test directory is not backed by
      this filesystem.
      
      The layout3_fs.hostfs.tag_inode_dir_child and
      layout3_fs.hostfs.tag_inode_file tests pass thanks to a previous commit
      fixing hostfs inode management.  Without this fix, the deny-by-default
      policy would apply and all access requests would be denied.
      
      Link: https://lore.kernel.org/r/20230612191430.339153-7-mic@digikod.netSigned-off-by: default avatarMickaël Salaün <mic@digikod.net>
      35ca4239
    • Mickaël Salaün's avatar
      selftests/landlock: Add tests for pseudo filesystems · 04f9070e
      Mickaël Salaün authored
      Add generic and read-only tests for 6 pseudo filesystems to make sure
      they have a consistent inode management, which is required for
      Landlock's file hierarchy identification:
      - tmpfs
      - ramfs
      - cgroup2
      - proc
      - sysfs
      
      Update related kernel configuration to support these new filesystems,
      remove useless CONFIG_SECURITY_PATH, and sort all entries.  If these
      filesystems are not supported by the kernel running tests, the related
      tests are skipped.
      
      Expanding variants, this adds 25 new tests for layout3_fs:
      - tag_inode_dir_parent
      - tag_inode_dir_mnt
      - tag_inode_dir_child
      - tag_inode_dir_file
      - release_inodes
      
      Test coverage for security/landlock with kernel debug code:
      - 94.7% of 835 lines according to gcc/gcov-12
      - 93.0% of 852 lines according to gcc/gcov-13
      
      Test coverage for security/landlock without kernel debug code:
      - 95.5% of 624 lines according to gcc/gcov-12
      - 93.1% of 641 lines according to gcc/gcov-13
      
      Link: https://lore.kernel.org/r/20230612191430.339153-6-mic@digikod.netSigned-off-by: default avatarMickaël Salaün <mic@digikod.net>
      04f9070e
    • Mickaël Salaün's avatar
      selftests/landlock: Make mounts configurable · 55ab3fbe
      Mickaël Salaün authored
      Add a new struct mnt_opt to define a mount point with the mount_opt()
      helper.  This doesn't change tests but prepare for the next commit.
      
      Link: https://lore.kernel.org/r/20230612191430.339153-5-mic@digikod.netSigned-off-by: default avatarMickaël Salaün <mic@digikod.net>
      55ab3fbe
    • Mickaël Salaün's avatar
      selftests/landlock: Add supports_filesystem() helper · 3de64b65
      Mickaël Salaün authored
      Replace supports_overlayfs() with supports_filesystem() to be able to
      check several filesystems.  This will be useful in a following commit.
      
      Only check for overlay filesystem once in the setup step, and then rely
      on self->skip_test.
      
      Cc: Guenter Roeck <groeck@chromium.org>
      Cc: Jeff Xu <jeffxu@google.com>
      Link: https://lore.kernel.org/r/20230612191430.339153-4-mic@digikod.netSigned-off-by: default avatarMickaël Salaün <mic@digikod.net>
      3de64b65
    • Mickaël Salaün's avatar
      selftests/landlock: Don't create useless file layouts · 592efeb4
      Mickaël Salaün authored
      Add and use a layout0 test fixture to not populate the tmpfs filesystem
      if it is not required for tests: unknown_access_rights, proc_nsfs,
      unpriv and max_layers.
      
      This doesn't change these tests but it speeds up their setup and makes
      them less prone to error.  This prepare the ground for a next commit.
      
      Link: https://lore.kernel.org/r/20230612191430.339153-3-mic@digikod.netSigned-off-by: default avatarMickaël Salaün <mic@digikod.net>
      592efeb4
    • Mickaël Salaün's avatar
      hostfs: Fix ephemeral inodes · 74ce793b
      Mickaël Salaün authored
      hostfs creates a new inode for each opened or created file, which
      created useless inode allocations and forbade identifying a host file
      with a kernel inode.
      
      Fix this uncommon filesystem behavior by tying kernel inodes to host
      file's inode and device IDs.  Even if the host filesystem inodes may be
      recycled, this cannot happen while a file referencing it is opened,
      which is the case with hostfs.  It should be noted that hostfs inode IDs
      may not be unique for the same hostfs superblock because multiple host's
      (backed) superblocks may be used.
      
      Delete inodes when dropping them to force backed host's file descriptors
      closing.
      
      This enables to entirely remove ARCH_EPHEMERAL_INODES, and then makes
      Landlock fully supported by UML.  This is very useful for testing
      changes.
      
      These changes also factor out and simplify some helpers thanks to the
      new hostfs_inode_update() and the hostfs_iget() revamp: read_name(),
      hostfs_create(), hostfs_lookup(), hostfs_mknod(), and
      hostfs_fill_sb_common().
      
      A following commit with new Landlock tests check this new hostfs inode
      consistency.
      
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Acked-by: default avatarRichard Weinberger <richard@nod.at>
      Link: https://lore.kernel.org/r/20230612191430.339153-2-mic@digikod.netSigned-off-by: default avatarMickaël Salaün <mic@digikod.net>
      74ce793b
  2. 11 Jun, 2023 3 commits
    • 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
  3. 10 Jun, 2023 3 commits
    • 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
  4. 09 Jun, 2023 23 commits
  5. 08 Jun, 2023 5 commits
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-6.4-2023-06-07' of... · b1913ff4
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-6.4-2023-06-07' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-6.4-2023-06-07:
      
      amdgpu:
      - S0ix fixes
      - GPU reset fixes
      - SMU13 fixes
      - SMU11 fixes
      - Misc Display fixes
      - Revert RV/RV2/PCO clock counter changes
      - Fix Stoney xclk value
      - Fix reserved vram debug info
      
      radeon:
      - Fix a potential use after free
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230607213740.7723-1-alexander.deucher@amd.com
      b1913ff4
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 8d15d5e1
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "Two tiny arm64 fixes for -rc6.
      
        One fixes a build breakage when MAX_ORDER can be nonsensical if
        CONFIG_EXPERT=y and the other fixes the address masking for perf's
        page fault software events so that it is consistent amongst them:
      
         - Fix build breakage due to bogus MAX_ORDER definitions on !4k pages
      
         - Avoid masking fault address for perf software events"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: mm: pass original fault address to handle_mm_fault() in PER_VMA_LOCK block
        arm64: Remove the ARCH_FORCE_MAX_ORDER config input prompt
      8d15d5e1
    • Mike Christie's avatar
      vhost: Fix worker hangs due to missed wake up calls · 4b13cbef
      Mike Christie authored
      We can race where we have added work to the work_list, but
      vhost_task_fn has passed that check but not yet set us into
      TASK_INTERRUPTIBLE. wake_up_process will see us in TASK_RUNNING and
      just return.
      
      This bug was intoduced in commit f9010dbd ("fork, vhost: Use
      CLONE_THREAD to fix freezer/ps regression") when I moved the setting
      of TASK_INTERRUPTIBLE to simplfy the code and avoid get_signal from
      logging warnings about being in the wrong state. This moves the setting
      of TASK_INTERRUPTIBLE back to before we test if we need to stop the
      task to avoid a possible race there as well. We then have vhost_worker
      set TASK_RUNNING if it finds work similar to before.
      
      Fixes: f9010dbd ("fork, vhost: Use CLONE_THREAD to fix freezer/ps regression")
      Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
      Message-Id: <20230607192338.6041-3-michael.christie@oracle.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      4b13cbef
    • Mike Christie's avatar
      vhost: Fix crash during early vhost_transport_send_pkt calls · a284f09e
      Mike Christie authored
      If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we
      can race where:
      1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue
      2. thread1 does VHOST_SET_OWNER which calls vhost_worker_create.
      3. vhost_worker_create will set the dev->worker pointer before setting
      the worker->vtsk pointer.
      4. thread0's vhost_work_queue will see the dev->worker pointer is
      set and try to call vhost_task_wake using not yet set worker->vtsk
      pointer.
      5. We then crash since vtsk is NULL.
      
      Before commit 6e890c5d ("vhost: use vhost_tasks for worker
      threads"), we only had the worker pointer so we could just check it to
      see if VHOST_SET_OWNER has been done. After that commit we have the
      vhost_worker and vhost_task pointer, so we can now hit the bug above.
      
      This patch embeds the vhost_worker in the vhost_dev and moves the work
      list initialization back to vhost_dev_init, so we can just check the
      worker.vtsk pointer to check if VHOST_SET_OWNER has been done like
      before.
      
      Fixes: 6e890c5d ("vhost: use vhost_tasks for worker threads")
      Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
      Message-Id: <20230607192338.6041-2-michael.christie@oracle.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reported-by: syzbot+d0d442c22fa8db45ff0e@syzkaller.appspotmail.com
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      a284f09e
    • Andrey Smetanin's avatar
      vhost_net: revert upend_idx only on retriable error · 1f5d2e3b
      Andrey Smetanin authored
      Fix possible virtqueue used buffers leak and corresponding stuck
      in case of temporary -EIO from sendmsg() which is produced by
      tun driver while backend device is not up.
      
      In case of no-retriable error and zcopy do not revert upend_idx
      to pass packet data (that is update used_idx in corresponding
      vhost_zerocopy_signal_used()) as if packet data has been
      transferred successfully.
      
      v2: set vq->heads[ubuf->desc].len equal to VHOST_DMA_DONE_LEN
      in case of fake successful transmit.
      Signed-off-by: default avatarAndrey Smetanin <asmetanin@yandex-team.ru>
      Message-Id: <20230424204411.24888-1-asmetanin@yandex-team.ru>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarAndrey Smetanin <asmetanin@yandex-team.ru>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      1f5d2e3b