1. 20 Jun, 2023 1 commit
    • 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@braunerSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      b36a5780
  2. 19 Jun, 2023 23 commits
  3. 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
  4. 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
  5. 09 Jun, 2023 10 commits