1. 14 Jun, 2024 5 commits
    • Linus Torvalds's avatar
      Merge tag 'iommu-fix-v6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 11100273
      Linus Torvalds authored
      Pull iommu fix from Joerg Roedel:
       "A single patch that fixes a regression which several people reported:
      
         - AMD-Vi: Fix regression causing panics"
      
      * tag 'iommu-fix-v6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/amd: Fix panic accessing amd_iommu_enable_faulting
      11100273
    • Linus Torvalds's avatar
      Merge tag 'pm-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 0cac73eb
      Linus Torvalds authored
      Pull power management fix from Rafael Wysocki:
       "Restore the behavior of the no_turbo sysfs attribute in the
        intel_pstate driver which allowed users to make the driver start using
        turbo P-states if they have been enabled on the fly by the firmware
        after OS initialization (Rafael Wysocki)"
      
      * tag 'pm-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: intel_pstate: Check turbo_is_disabled() in store_no_turbo()
      0cac73eb
    • Linus Torvalds's avatar
      Merge tag 'acpi-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 94df82fe
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix a recent regression in the ACPI EC driver and make system
        suspend work on multiple platforms where StorageD3Enable _DSD is
        missing in the ACPI tables.
      
        Specifics:
      
         - Make the ACPI EC driver directly evaluate an "orphan" _REG method
           under the EC device, if present, which stopped being evaluated
           after the driver had started to install its EC address space
           handler at the root of the ACPI namespace (Rafael Wysocki)
      
         - Make more devices put NVMe storage devices into D3 at suspend to
           work around missing StorageD3Enable _DSD in the BIOS (Mario
           Limonciello)"
      
      * tag 'acpi-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: EC: Evaluate orphan _REG under EC device
        ACPI: x86: Force StorageD3Enable on more products
      94df82fe
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · cee84c0b
      Linus Torvalds authored
      Pull thermal control fixes from Rafael Wysocki:
       "These fix three issues introduced recently, two related to defects in
        ACPI tables supplied by the platform firmware and one cause by a
        thermal core change that went too far:
      
         - Prevent the thermal core from failing the registration of a cooling
           device if its .get_cur_state() reports an incorrect state to start
           with which may happen for fans handled through firmware-supplied
           AML in ACPI tables (Rafael Wysocki)
      
         - Make the ACPI thermal zone driver initialize all trip points with
           temperature of 0 centigrade and below as invalid because such trip
           point temperatures do not make sense on systems with ACPI thermal
           control and they cause performance regressions due to permanent
           thermal mitigations to occur (Rafael Wysocki)
      
         - Restore passive polling management in the Step-Wise thermal
           governor that uses it to ensure that all cooling devices used for
           thermal mitigation will go back to their initial states eventually
           (Rafael Wysocki)"
      
      * tag 'thermal-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal: gov_step_wise: Restore passive polling management
        thermal: ACPI: Invalidate trip points with temperature of 0 or below
        thermal: core: Do not fail cdev registration because of invalid initial state
      cee84c0b
    • Rafael J. Wysocki's avatar
      Merge branch acpi-x86 · 04f82fbb
      Rafael J. Wysocki authored
      Merge a fix for a suspend issue related to storage handling on multiple
      systems based on AMD hardware:
      
       - Make more devices put NVMe storage devices into D3 at suspend to work
         around missing StorageD3Enable _DSD in the BIOS (Mario Limonciello).
      
      * branch acpi-x86:
        ACPI: x86: Force StorageD3Enable on more products
      04f82fbb
  2. 13 Jun, 2024 15 commits
  3. 12 Jun, 2024 9 commits
  4. 11 Jun, 2024 11 commits
    • Kent Overstreet's avatar
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.10-rc4.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs · 2ef5971f
      Linus Torvalds authored
      Pull vfs fixes from Christian Brauner:
       "Misc:
         - Restore debugfs behavior of ignoring unknown mount options
         - Fix kernel doc for netfs_wait_for_oustanding_io()
         - Fix struct statx comment after new addition for this cycle
         - Fix a check in find_next_fd()
      
        iomap:
         - Fix data zeroing behavior when an extent spans the block that
           contains i_size
         - Restore i_size increasing in iomap_write_end() for now to avoid
           stale data exposure on xfs with a realtime device
      
        Cachefiles:
         - Remove unneeded fdtable.h include
         - Improve trace output for cachefiles_obj_{get,put}_ondemand_fd()
         - Remove requests from the request list to prevent accessing already
           freed requests
         - Fix UAF when issuing restore command while the daemon is still
           alive by adding an additional reference count to requests
         - Fix UAF by grabbing a reference during xarray lookup with xa_lock()
           held
         - Simplify error handling in cachefiles_ondemand_daemon_read()
         - Add consistency checks read and open requests to avoid crashes
         - Add a spinlock to protect ondemand_id variable which is used to
           determine whether an anonymous cachefiles fd has already been
           closed
         - Make on-demand reads killable allowing to handle broken cachefiles
           daemon better
         - Flush all requests after the kernel has been marked dead via
           CACHEFILES_DEAD to avoid hung-tasks
         - Ensure that closed requests are marked as such to avoid reusing
           them with a reopen request
         - Defer fd_install() until after copy_to_user() succeeded and thereby
           get rid of having to use close_fd()
         - Ensure that anonymous cachefiles on-demand fds are reused while
           they are valid to avoid pinning already freed cookies"
      
      * tag 'vfs-6.10-rc4.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
        iomap: Fix iomap_adjust_read_range for plen calculation
        iomap: keep on increasing i_size in iomap_write_end()
        cachefiles: remove unneeded include of <linux/fdtable.h>
        fs/file: fix the check in find_next_fd()
        cachefiles: make on-demand read killable
        cachefiles: flush all requests after setting CACHEFILES_DEAD
        cachefiles: Set object to close if ondemand_id < 0 in copen
        cachefiles: defer exposing anon_fd until after copy_to_user() succeeds
        cachefiles: never get a new anonymous fd if ondemand_id is valid
        cachefiles: add spin_lock for cachefiles_ondemand_info
        cachefiles: add consistency check for copen/cread
        cachefiles: remove err_put_fd label in cachefiles_ondemand_daemon_read()
        cachefiles: fix slab-use-after-free in cachefiles_ondemand_daemon_read()
        cachefiles: fix slab-use-after-free in cachefiles_ondemand_get_fd()
        cachefiles: remove requests from xarray during flushing requests
        cachefiles: add output string to cachefiles_obj_[get|put]_ondemand_fd
        statx: Update offset commentary for struct statx
        netfs: fix kernel doc for nets_wait_for_outstanding_io()
        debugfs: continue to ignore unknown mount options
      2ef5971f
    • Rafael J. Wysocki's avatar
      thermal: gov_step_wise: Restore passive polling management · b6846826
      Rafael J. Wysocki authored
      Consider a thermal zone with one passive trip point, a cooling device
      with 3 states (0, 1, 2) bound to it, passive polling enabled (nonzero
      passive_delay_jiffies) and no regular polling (polling_delay_jiffies
      equal to 0) that is managed by the Step-Wise governor.  Suppose that
      the initial state of the cooling device is 0 and the zone temperature
      is below the trip point to start with.
      
      When the trip point is crossed, tz->passive is incremented by the
      thermal core and the governor's .manage() callback is invoked.  It
      sets 'throttle' to 'true' for the trip in question and
      get_target_state() returns 1 for the instance corresponding to the
      cooling device (say that 'upper' and 'lower' are set to 2 and 0 for
      it, respectively), so its state changes to 1.
      
      Passive polling is still active for the zone, so next time the
      temperature is updated, the governor's .manage() callback will be
      invoked again.  If the temperature is still rising, it will change
      the state of the cooling device to 2.
      
      Now suppose that next time the zone temperature is updated, it falls
      below the trip point, so tz->passive is decremented for the zone (say
      it becomes 0 then) and the governor's .manage() callbacks runs.
      
      It finds that the temperature trend for the zone is 'falling' and
      'throttle' will be set to 'false' for the trip in question, so the
      cooling device's state will be changed to 1.  However, because
      tz->polling is 0 for the zone, the governor's .manage() callback
      may not be invoked again for a long time and the cooling device's
      state will not be reset back to 0.
      
      This can happen because commit 042a3d80 ("thermal: core: Move
      passive polling management to the core") removed passive polling
      management from the Step-Wise governor.
      
      Before that change, thermal_zone_trip_update() would bump up
      tz->passive when changing the target state for a thermal instance
      from "no target" to a specific value and it would drop tz->passive
      when changing it back to "no target" which would cause passive
      polling to be active for the zone until the governor has reset the
      states of all cooling devices.  In particular, in the example above
      tz->passive would be incremented when changing the state of the
      cooling device from 0 to 1 and then it would be still nonzero when
      the state of the cooling device was changed from 2 to 1.
      
      To prevent this problem from occurring, restore the passive polling
      management in the Step-Wise governor by partially reverting the
      commit in question and update the comment in the restored code
      to explain its role more clearly.
      
      Fixes: 042a3d80 ("thermal: core: Move passive polling management to the core")
      Closes: https://lore.kernel.org/linux-pm/ZmVfcEOxmjUHZTSX@hovoldconsulting.comReported-by: default avatarJohan Hovold <johan+linaro@kernel.org>
      Tested-by: default avatarJohan Hovold <johan+linaro@kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b6846826
    • Florian Westphal's avatar
      netfilter: Use flowlabel flow key when re-routing mangled packets · 6f8f132c
      Florian Westphal authored
      'ip6 dscp set $v' in an nftables outpute route chain has no effect.
      While nftables does detect the dscp change and calls the reroute hook.
      But ip6_route_me_harder never sets the dscp/flowlabel:
      flowlabel/dsfield routing rules are ignored and no reroute takes place.
      
      Thanks to Yi Chen for an excellent reproducer script that I used
      to validate this change.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Reported-by: default avatarYi Chen <yiche@redhat.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      6f8f132c
    • Jozsef Kadlecsik's avatar
      netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type · 4e7aaa6b
      Jozsef Kadlecsik authored
      Lion Ackermann reported that there is a race condition between namespace cleanup
      in ipset and the garbage collection of the list:set type. The namespace
      cleanup can destroy the list:set type of sets while the gc of the set type is
      waiting to run in rcu cleanup. The latter uses data from the destroyed set which
      thus leads use after free. The patch contains the following parts:
      
      - When destroying all sets, first remove the garbage collectors, then wait
        if needed and then destroy the sets.
      - Fix the badly ordered "wait then remove gc" for the destroy a single set
        case.
      - Fix the missing rcu locking in the list:set type in the userspace test
        case.
      - Use proper RCU list handlings in the list:set type.
      
      The patch depends on c1193d9b (netfilter: ipset: Add list flush to cancel_gc).
      
      Fixes: 97f7cf1c (netfilter: ipset: fix performance regression in swap operation)
      Reported-by: default avatarLion Ackermann <nnamrec@gmail.com>
      Tested-by: default avatarLion Ackermann <nnamrec@gmail.com>
      Signed-off-by: default avatarJozsef Kadlecsik <kadlec@netfilter.org>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      4e7aaa6b
    • Davide Ornaghi's avatar
      netfilter: nft_inner: validate mandatory meta and payload · c4ab9da8
      Davide Ornaghi authored
      Check for mandatory netlink attributes in payload and meta expression
      when used embedded from the inner expression, otherwise NULL pointer
      dereference is possible from userspace.
      
      Fixes: a150d122 ("netfilter: nft_meta: add inner match support")
      Fixes: 3a07327d ("netfilter: nft_inner: support for inner tunnel header matching")
      Signed-off-by: default avatarDavide Ornaghi <d.ornaghi97@gmail.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c4ab9da8
    • Eric Dumazet's avatar
      tcp: use signed arithmetic in tcp_rtx_probe0_timed_out() · 36534d3c
      Eric Dumazet authored
      Due to timer wheel implementation, a timer will usually fire
      after its schedule.
      
      For instance, for HZ=1000, a timeout between 512ms and 4s
      has a granularity of 64ms.
      For this range of values, the extra delay could be up to 63ms.
      
      For TCP, this means that tp->rcv_tstamp may be after
      inet_csk(sk)->icsk_timeout whenever the timer interrupt
      finally triggers, if one packet came during the extra delay.
      
      We need to make sure tcp_rtx_probe0_timed_out() handles this case.
      
      Fixes: e89688e3 ("net: tcp: fix unexcepted socket die when snd_wnd is 0")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Menglong Dong <imagedong@tencent.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Reviewed-by: default avatarJason Xing <kerneljasonxing@gmail.com>
      Link: https://lore.kernel.org/r/20240607125652.1472540-1-edumazet@google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      36534d3c
    • Jakub Kicinski's avatar
      Merge branch 'mptcp-various-fixes' · 70b3c88c
      Jakub Kicinski authored
      Matthieu Baerts says:
      
      ====================
      mptcp: various fixes
      
      The different patches here are some unrelated fixes for MPTCP:
      
      - Patch 1 ensures 'snd_una' is initialised on connect in case of MPTCP
        fallback to TCP followed by retransmissions before the processing of
        any other incoming packets. A fix for v5.9+.
      
      - Patch 2 makes sure the RmAddr MIB counter is incremented, and only
        once per ID, upon the reception of a RM_ADDR. A fix for v5.10+.
      
      - Patch 3 doesn't update 'add addr' related counters if the connect()
        was not possible. A fix for v5.7+.
      
      - Patch 4 updates the mailmap file to add Geliang's new email address.
      ====================
      
      Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-0-1ab9ddfa3d00@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      70b3c88c
    • Geliang Tang's avatar
      mailmap: map Geliang's new email address · 74acb250
      Geliang Tang authored
      Just like my other email addresses, map my new one to kernel.org
      account too.
      
      My new email address uses "last name, first name" format, which is
      different from my other email addresses. This mailmap is also used
      to indicate that it is actually the same person.
      Suggested-by: default avatarMat Martineau <martineau@kernel.org>
      Suggested-by: default avatarMatthieu Baerts <matttbe@kernel.org>
      Signed-off-by: default avatarGeliang Tang <geliang@kernel.org>
      Reviewed-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-4-1ab9ddfa3d00@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      74acb250
    • YonglongLi's avatar
      mptcp: pm: update add_addr counters after connect · 40eec179
      YonglongLi authored
      The creation of new subflows can fail for different reasons. If no
      subflow have been created using the received ADD_ADDR, the related
      counters should not be updated, otherwise they will never be decremented
      for events related to this ID later on.
      
      For the moment, the number of accepted ADD_ADDR is only decremented upon
      the reception of a related RM_ADDR, and only if the remote address ID is
      currently being used by at least one subflow. In other words, if no
      subflow can be created with the received address, the counter will not
      be decremented. In this case, it is then important not to increment
      pm.add_addr_accepted counter, and not to modify pm.accept_addr bit.
      
      Note that this patch does not modify the behaviour in case of failures
      later on, e.g. if the MP Join is dropped or rejected.
      
      The "remove invalid addresses" MP Join subtest has been modified to
      validate this case. The broadcast IP address is added before the "valid"
      address that will be used to successfully create a subflow, and the
      limit is decreased by one: without this patch, it was not possible to
      create the last subflow, because:
      
      - the broadcast address would have been accepted even if it was not
        usable: the creation of a subflow to this address results in an error,
      
      - the limit of 2 accepted ADD_ADDR would have then been reached.
      
      Fixes: 01cacb00 ("mptcp: add netlink-based PM")
      Cc: stable@vger.kernel.org
      Co-developed-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarYonglongLi <liyonglong@chinatelecom.cn>
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-3-1ab9ddfa3d00@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      40eec179
    • YonglongLi's avatar
      mptcp: pm: inc RmAddr MIB counter once per RM_ADDR ID · 6a09788c
      YonglongLi authored
      The RmAddr MIB counter is supposed to be incremented once when a valid
      RM_ADDR has been received. Before this patch, it could have been
      incremented as many times as the number of subflows connected to the
      linked address ID, so it could have been 0, 1 or more than 1.
      
      The "RmSubflow" is incremented after a local operation. In this case,
      it is normal to tied it with the number of subflows that have been
      actually removed.
      
      The "remove invalid addresses" MP Join subtest has been modified to
      validate this case. A broadcast IP address is now used instead: the
      client will not be able to create a subflow to this address. The
      consequence is that when receiving the RM_ADDR with the ID attached to
      this broadcast IP address, no subflow linked to this ID will be found.
      
      Fixes: 7a7e52e3 ("mptcp: add RM_ADDR related mibs")
      Cc: stable@vger.kernel.org
      Co-developed-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarYonglongLi <liyonglong@chinatelecom.cn>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-2-1ab9ddfa3d00@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6a09788c