Commit graph

1337087 commits

Author SHA1 Message Date
Linus Torvalds
042751d353 Miscellaneous x86 fixes:
- Fix CPUID leaf 0x2 parsing bugs
  - Sanitize very early boot parameters to avoid crash
  - Fix size overflows in the SGX code
  - Make CALL_NOSPEC use consistent
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmfK46YRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1hrTA/9EKBx/Uu+WKaVCfX/+hrdHfiMhwCFFOrT
 Aa5QEcsEcFP2QDo3M8mXj9DzNJda8L5ilBWqv+E08zYexvv5/wQ2Q7bEQthD+4Su
 hFbbTjlsF5r6D2sfzT03RuDbvTO3lv7uD/dYoE9e82GKKhvGt2mdcyQ6ZIt1Iz8R
 gIcqGBv3KMXHlx91+VeRHZmI7ZHL1lqz8SyXvnY5jCI5x44QNdlBAMSbxwkw9YzJ
 1w59Dfxz9UDHJ0vzj7OpZFL/JjABKXEIeTXHfSevd0f3V05T3hTlZUPEKvqNpHlP
 dnAHbH5HoqQpBWdt4CYmJcEhdz9fM5h0s7JBMN+0k+ORZ7J1wJ+tM35cm3uWpd0/
 zpDzsFU33AdVbt9ryY62kZk5Lr9Pvas5GRjhB8ZkcSjFPu03xKvZ0sFs02H4zsOc
 k5Nd8PHKRbBhoJhtBtSRMuhADKKEIA490TUz5NVCJYqVnopyotYEX74GlQhFcXf6
 qXE8wcIfpC+bYbzPEVWe0+MhqQrcuN85D+KaIUIR9EITkAQ57VEvfwRv0FB3j7zS
 //0sM1bsNJB9dbGgkL2/PqihwBtXGf8MzyDvvQPLK/DiyD32B4zgtQHYScgQZqH+
 Bze+GR33T2eifkEkBEIOjfIVc8t4iTuoni9SjLIcTTNo8kedCKkGRCEHgqWZO8ko
 a53vzAMQSv8=
 =ziXk
 -----END PGP SIGNATURE-----

Merge tag 'x86-urgent-2025-03-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 fixes from Ingo Molnar:

 - Fix CPUID leaf 0x2 parsing bugs

 - Sanitize very early boot parameters to avoid crash

 - Fix size overflows in the SGX code

 - Make CALL_NOSPEC use consistent

* tag 'x86-urgent-2025-03-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/boot: Sanitize boot params before parsing command line
  x86/sgx: Fix size overflows in sgx_encl_create()
  x86/cpu: Properly parse CPUID leaf 0x2 TLB descriptor 0x63
  x86/cpu: Validate CPUID leaf 0x2 EDX output
  x86/cacheinfo: Validate CPUID leaf 0x2 EDX output
  x86/speculation: Add a conditional CS prefix to CALL_NOSPEC
  x86/speculation: Simplify and make CALL_NOSPEC consistent
2025-03-07 10:05:32 -10:00
Linus Torvalds
8287dfc291 hwmon fixes for v6.14-rc6
- xgene-hwmon: Fix a NULL vs IS_ERR_OR_NULL() check
 
 - ad7314: Return error if leading zero bits are non-zero
 
 - ntc_thermistor: Update/fix the ncpXXxh103 sensor table
 
 - pmbus: Initialise page count in pmbus_identify()
 
 - peci/dimmtemp: Di not provide fake threshold data
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmfLCp8ACgkQyx8mb86f
 mYEX0Q/8D1ZIbBKbxLo4jEd/c8mwlcVhdzqks8N1kt98C+AH4XuzCWE1c+VXXFHA
 dJ/7CP7r0x1MfnAarkHgO81DrQpbnaqpBmsh1nm6ZshFXq1hOVLv/HDoROQiDqse
 ayftapmWmn/qkGIKR2BbyRVLH9ipMRcm3MEGe0X9SaBopbYSrCvszYTmVQ0s25Oo
 qPLY9t6QsRRB8qpmtUnRsHAF+DtndFnIEAogFxAWcgzE7uY2MF/QSESFR6KJ8G1S
 LD8mpyPtVWWwDx90yvMJjhELz/ujejrTaUCfzutwsxdk6b6i4YLovpGCAPO4mE+Q
 sJOk25VjUxtT1bpbrVhPtLQ/KY2JTAsNuD/l/ikfLAysN/yRa6ORrpLasTYL01ZH
 3lvN64BVgCZnlbrGMfuZqBjPn0uSJY0+C3X3QShh6ySjO6olQNVwOVme6FGJ5tcu
 N9wWnue0HBEsUwIUIrFGh25j81zVjtHTaHb9M9ZCr0iMdIcNlYc5/+3VtVxbUrpI
 J4E5slISinfB74LEJYW2whzohWbuvvuC/tME6V4yJ/E573xTny6LSd6DLX4r4j0r
 mzc+GVZAg6usRzGnqdHZgqGJrOp0S4B9M2R4zYAb70pwECNStQrN793L3d7O4eSW
 T1O4HsZPEpYqTKbJZ1RItwAMwRkPQ5SSEaK81eataJOZ+847SAc=
 =naYk
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - xgene-hwmon: Fix a NULL vs IS_ERR_OR_NULL() check

 - ad7314: Return error if leading zero bits are non-zero

 - ntc_thermistor: Update/fix the ncpXXxh103 sensor table

 - pmbus: Initialise page count in pmbus_identify()

 - peci/dimmtemp: Do not provide fake threshold data

* tag 'hwmon-for-v6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe()
  hwmon: (ad7314) Validate leading zero bits and return error
  hwmon: (ntc_thermistor) Fix the ncpXXxh103 sensor table
  hwmon: (pmbus) Initialise page count in pmbus_identify()
  hwmon: (peci/dimmtemp) Do not provide fake thresholds data
2025-03-07 07:51:27 -10:00
Linus Torvalds
1222390d13 gpio fixes for v6.14-rc6
- protect gpio-aggregator against module unload
 - use raw spinlock in gpio-rcar to fix a lockdep splat
 - fix OF node leak in gpio-rcar
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmfK5pEACgkQEacuoBRx
 13K2nRAA06GCuPEvSZX+cIMSI5ZQd7XwhfR6YXBS0j6PaLItUjLWENLBy+2SxpKa
 o8twuaHWnQGbRcSbGkJjF7vQ6cn6kxJsIIdJ6r2ghnEzILuxv8xcVMrfO4ulwaoZ
 hvv/cJfS1GqIzaxrGRmyWB0Kv3+hAd4juLkaPeMgxkxGTjq2iyh5oQk/1ok0Qew2
 GsoHhZ3r0AqE5JTqhnHRxtQEP2ZsBN/p1CY4WHWuvbyu6AQz4/ld5WUiCrOtADJL
 ot/s7lgPOprlbNDcwgWYc/rr2MRw1s6pdvEabi16G3CZuxS6zJnPrHegoFKcU7XO
 8Q2GxLpYya76obtcSsxRXGFZxyxPaMO47dbknyGCBH0T8VfA393i96XhoiRorvMf
 qtd8IxmWeeH8bRp3aqkKuxH7qaFTbzxLWlTAuM1Yv9cNFMnbEe6pv26i0TVzcyJD
 547CCA+FP2RH63wm0yhq1UFMp4VbDHxvQBkrO5liVCmhxX6bOVDqZS5dNuN7x10J
 1xxBNzbFujyE/TVKF/SFGcXhcrcHxazaFnEbUA14fLJ7ktP87rhQcla66l9pXwjG
 qZS876oci8y1fkJ/f3JMFf5vgUrdt+QpECPfmUaL/ZCNHvE0YThsX88GYPPP3Xdg
 Pds43hU99kHmKP9RicmuuEnwoAm9JjLkVln6zRTxPvGDNBePFKk=
 =MgMW
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - protect gpio-aggregator against module unload

 - use raw spinlock in gpio-rcar to fix a lockdep splat

 - fix OF node leak in gpio-rcar

* tag 'gpio-fixes-for-v6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: rcar: Fix missing of_node_put() call
  gpio: rcar: Use raw_spinlock to protect register access
  gpio: aggregator: protect driver attr handlers against module unload
2025-03-07 07:49:23 -10:00
Linus Torvalds
8aed61b833 platform-drivers-x86 for v6.14-4
Fixes and new HW support:
 
  - amd/pmf:
 
      - Initialize 'cb_mutex'
 
      - Support for new version of PMF-TA
 
  - intel-hid: Fix volume buttons on Microsoft Surface Go 4 tablet
 
  - intel/vsec: Add Diamond Rapids support
 
  - thinkpad_acpi: Add battery quirk for ThinkPad X131e
 The following is an automated shortlog grouped by driver:
 
 amd/pmf:
  -  Initialize and clean up `cb_mutex`
  -  Propagate PMF-TA return codes
  -  Update PMF Driver for Compatibility with new PMF-TA
 
 intel-hid:
  -  fix volume buttons on Microsoft Surface Go 4 tablet
 
 intel/vsec:
  -  Add Diamond Rapids support
 
 thinkpad_acpi:
  -  Add battery quirk for ThinkPad X131e
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCZ8rDZAAKCRBZrE9hU+XO
 McQhAQDw1Vf8jKrdK3X80DNSuIToO5B4dpX+PB8r4xgK96ipqgD9GKxHW1tbGqHH
 vUTEqwcpDwBMe+wDRbD31SBaZUSgXwo=
 =wZNA
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v6.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Ilpo Järvinen:

 - amd/pmf:
     - Initialize 'cb_mutex'
     - Support for new version of PMF-TA

 - intel-hid: Fix volume buttons on Microsoft Surface Go 4 tablet

 - intel/vsec: Add Diamond Rapids support

 - thinkpad_acpi: Add battery quirk for ThinkPad X131e

* tag 'platform-drivers-x86-v6.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86/amd/pmf: Update PMF Driver for Compatibility with new PMF-TA
  platform/x86/amd/pmf: Propagate PMF-TA return codes
  platform/x86/intel/vsec: Add Diamond Rapids support
  platform/x86: thinkpad_acpi: Add battery quirk for ThinkPad X131e
  platform/x86: intel-hid: fix volume buttons on Microsoft Surface Go 4 tablet
  platform/x86/amd/pmf: Initialize and clean up `cb_mutex`
2025-03-07 07:29:13 -10:00
Linus Torvalds
2a405b36a6 sound fixes for 6.14-rc6
There is a single change in ALSA core (for sequencer code for the
 module auto-loading in a wrong timing) while the all rest are various
 HD- and USB-audio fixes.  Many of them are boring device-specific
 quirks, and should be safe to take.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmfKrWoOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8ENA//eisslsBfG3XUxsSnPIEwCxKjDPH7l9CMRTx+
 ff35fNTK4LNeueaK8aHrT3FZlc7xtNj5rx3AjvgvUG1AZgwRojjK+CYLx9gT8iXq
 peZs5A+/HdrG7UlRkNwBNHYI4fZbpbNmW6MUcx8M6ILlTmzFyr/u3g8UZUkAJj/x
 HICGGm7sZQBePjSJah25sDO8jyN9ANVfh/XcP20y63CLwIK0i7KwdQqmakYzW4zL
 OojV7/O8gaCmPCrPjc/r4KG/XpaE33c0ixPqnegd3Zae0ehGyRmwKODSLRUXIU2U
 BtcA1cAUR4SMjXBxVqNY0+h9JkP4AFVMc1DbVRyGouhVJMoQQmAeYo4RDAF+gJNA
 GGag0L4XdubndCgjAChqZ0wsPZFumBH4ZaezWKZL8UoF9QbCPhsIOh1PIXf5fj8x
 NDHgc1x0GUPmFO7hR86bJ87ddILwBlG5xQLTWEFcTH4MZvUTbQelsHQo7yTb/HbZ
 T34hSupXscts0tHuWNGd+x71TLFmj8F007kAk8EGniZPYFxycJZtzaIlCrjAGto6
 sjvHqnY5Sach6lIJMFzjMdkzAVIuggwo8Ja17knxXH449TLhN64OysvRO0yViH1J
 uHBcal7t5rC2LMCtO0CZ6+otl92zCWH98GgBsvjErtGsusc0nqE/FwPrEANlSqO2
 U2i8yw0=
 =0M0k
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "There is a single change in ALSA core (for sequencer code for the
  module auto-loading in a wrong timing) while the all rest are various
  HD- and USB-audio fixes.

  Many of them are boring device-specific quirks, and should be safe to
  take"

* tag 'sound-6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek: Add support for ASUS Zenbook UM3406KA Laptops using CS35L41 HDA
  ALSA: hda/realtek: Add support for ASUS B5405 and B5605 Laptops using CS35L41 HDA
  ALSA: hda/realtek: Add support for ASUS B3405 and B3605 Laptops using CS35L41 HDA
  ALSA: hda/realtek: Add support for various ASUS Laptops using CS35L41 HDA
  ALSA: hda/realtek: Add support for ASUS ROG Strix G614 Laptops using CS35L41 HDA
  ALSA: hda/realtek: Add support for ASUS ROG Strix GA603 Laptops using CS35L41 HDA
  ALSA: hda/realtek: Add support for ASUS ROG Strix G814 Laptop using CS35L41 HDA
  ALSA: hda: intel: Add Dell ALC3271 to power_save denylist
  ALSA: hda/realtek: update ALC222 depop optimize
  ALSA: hda: realtek: fix incorrect IS_REACHABLE() usage
  ALSA: usx2y: validate nrpacks module parameter on probe
  ALSA: hda/realtek - add supported Mic Mute LED for Lenovo platform
  ALSA: seq: Avoid module auto-load handling at event delivery
  ALSA: hda: Fix speakers on ASUS EXPERTBOOK P5405CSA 1.0
  ALSA: hda/realtek: Fix Asus Z13 2025 audio
  ALSA: hda/realtek: Remove (revert) duplicate Ally X config
2025-03-07 07:24:41 -10:00
Alexey Kardashevskiy
3e385c0d6c virt: sev-guest: Move SNP Guest Request data pages handling under snp_cmd_mutex
Compared to the SNP Guest Request, the "Extended" version adds data pages for
receiving certificates. If not enough pages provided, the HV can report to the
VM how much is needed so the VM can reallocate and repeat.

Commit

  ae596615d9 ("virt: sev-guest: Reduce the scope of SNP command mutex")

moved handling of the allocated/desired pages number out of scope of said
mutex and create a possibility for a race (multiple instances trying to
trigger Extended request in a VM) as there is just one instance of
snp_msg_desc per /dev/sev-guest and no locking other than snp_cmd_mutex.

Fix the issue by moving the data blob/size and the GHCB input struct
(snp_req_data) into snp_guest_req which is allocated on stack now and accessed
by the GHCB caller under that mutex.

Stop allocating SEV_FW_BLOB_MAX_SIZE in snp_msg_alloc() as only one of four
callers needs it. Free the received blob in get_ext_report() right after it is
copied to the userspace. Possible future users of snp_send_guest_request() are
likely to have different ideas about the buffer size anyways.

Fixes: ae596615d9 ("virt: sev-guest: Reduce the scope of SNP command mutex")
Signed-off-by: Alexey Kardashevskiy <aik@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250307013700.437505-3-aik@amd.com
2025-03-07 14:09:33 +01:00
Nikunj A Dadhania
ac7c06acaa virt: sev-guest: Allocate request data dynamically
Commit

  ae596615d9 ("virt: sev-guest: Reduce the scope of SNP command mutex")

narrowed the command mutex scope to snp_send_guest_request().  However,
GET_REPORT, GET_DERIVED_KEY, and GET_EXT_REPORT share the req structure in
snp_guest_dev. Without the mutex protection, concurrent requests can overwrite
each other's data. Fix it by dynamically allocating the request structure.

Fixes: ae596615d9 ("virt: sev-guest: Reduce the scope of SNP command mutex")
Closes: https://github.com/AMDESE/AMDSEV/issues/265
Reported-by: andreas.stuehrk@yaxi.tech
Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Signed-off-by: Alexey Kardashevskiy <aik@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250307013700.437505-2-aik@amd.com
2025-03-07 13:34:25 +01:00
Andrew Cooper
14cb5d8306 x86/amd_nb: Use rdmsr_safe() in amd_get_mmconfig_range()
Xen doesn't offer MSR_FAM10H_MMIO_CONF_BASE to all guests.  This results
in the following warning:

  unchecked MSR access error: RDMSR from 0xc0010058 at rIP: 0xffffffff8101d19f (xen_do_read_msr+0x7f/0xa0)
  Call Trace:
   xen_read_msr+0x1e/0x30
   amd_get_mmconfig_range+0x2b/0x80
   quirk_amd_mmconfig_area+0x28/0x100
   pnp_fixup_device+0x39/0x50
   __pnp_add_device+0xf/0x150
   pnp_add_device+0x3d/0x100
   pnpacpi_add_device_handler+0x1f9/0x280
   acpi_ns_get_device_callback+0x104/0x1c0
   acpi_ns_walk_namespace+0x1d0/0x260
   acpi_get_devices+0x8a/0xb0
   pnpacpi_init+0x50/0x80
   do_one_initcall+0x46/0x2e0
   kernel_init_freeable+0x1da/0x2f0
   kernel_init+0x16/0x1b0
   ret_from_fork+0x30/0x50
   ret_from_fork_asm+0x1b/0x30

based on quirks for a "PNP0c01" device.  Treating MMCFG as disabled is the
right course of action, so no change is needed there.

This was most likely exposed by fixing the Xen MSR accessors to not be
silently-safe.

Fixes: 3fac3734c4 ("xen/pv: support selecting safe/unsafe msr accesses")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250307002846.3026685-1-andrew.cooper3@citrix.com
2025-03-07 13:28:31 +01:00
Linus Torvalds
00a7d39898 fs/pipe: add simpler helpers for common cases
The fix to atomically read the pipe head and tail state when not holding
the pipe mutex has caused a number of headaches due to the size change
of the involved types.

It turns out that we don't have _that_ many places that access these
fields directly and were affected, but we have more than we strictly
should have, because our low-level helper functions have been designed
to have intimate knowledge of how the pipes work.

And as a result, that random noise of direct 'pipe->head' and
'pipe->tail' accesses makes it harder to pinpoint any actual potential
problem spots remaining.

For example, we didn't have a "is the pipe full" helper function, but
instead had a "given these pipe buffer indexes and this pipe size, is
the pipe full".  That's because some low-level pipe code does actually
want that much more complicated interface.

But most other places literally just want a "is the pipe full" helper,
and not having it meant that those places ended up being unnecessarily
much too aware of this all.

It would have been much better if only the very core pipe code that
cared had been the one aware of this all.

So let's fix it - better late than never.  This just introduces the
trivial wrappers for "is this pipe full or empty" and to get how many
pipe buffers are used, so that instead of writing

        if (pipe_full(pipe->head, pipe->tail, pipe->max_usage))

the places that literally just want to know if a pipe is full can just
say

        if (pipe_is_full(pipe))

instead.  The existing trivial cases were converted with a 'sed' script.

This cuts down on the places that access pipe->head and pipe->tail
directly outside of the pipe code (and core splice code) quite a lot.

The splice code in particular still revels in doing the direct low-level
accesses, and the fuse fuse_dev_splice_write() code also seems a bit
unnecessarily eager to go very low-level, but it's at least a bit better
than it used to be.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-03-06 18:25:35 -10:00
Linus Torvalds
28f587adb6 drm fixes for 6.14-rc6
nouveau:
 - rely on fw caching Kconfig fix
 
 imagination:
 - avoid deadlock on fence release
 - fix fence initialisation
 - fix timestamps firmware traces
 
 scheduler:
 - fix include guard
 
 bochs:
 - dpms fix
 
 i915:
 - bump max stream count to match pipes
 
 xe:
 - Remove double page flip on initial plane
 - Properly setup userptr pfn_flags_mask
 - Fix GT "for each engine" workarounds
 - Fix userptr races and missed validations
 - Userptr invalid page access fixes
 - Cleanup some style nits
 
 amdgpu:
 - Fix NULL check in DC code
 - SMU 14 fix
 
 amdkfd:
 - Fix NULL check in queue validation
 
 radeon:
 - RS400 HyperZ fix
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEEKbZHaGwW9KfbeusDHTzWXnEhr4FAmfKOTUACgkQDHTzWXnE
 hr6mFg//cHe/4P05oH+kCyqIenekz/gUs7ifgtlR845BtxvRv1H8/skte5iBta4A
 oRnTVPWzSunR1qCmSUKbSXJDfC/OYoxfWaqw8pfVPFXcGEkyqsUQa5UKWWiBGUUP
 8zii+ysitPE7y6o3TmYDKhc1lVoJFozPCXJuRUkWrNwhrJEzemV2wJ+G4TTwp6tR
 Mu1y6icqU93PeTaCCPrvE8UYy7TRH5Fg7augGPhUDCKgvYtvP228i8Ra1hANC45e
 X991GDcxzsvgIW55xpPjoxgjJDQqSyrHptnNvtvQaWwAPKfEEwqdUEInqdwEZO4x
 8YMNRB/eORm0paQEJWxSyh0+NcqLW39CRHRJQzetVyLTN3Gb3YV5AZyc0GodGCHm
 1W+DfUdG2zpECDGAlvPix89bn9bGFCz902XZUEPVhOj9MkbWjOxRgN4RQx0R4lGH
 Mq6Ff9USrt49TPuPWMduLzGL4CYnD3D89kTMBH0hRNsfL9KFWpMZ1uJi76805EL8
 eB79VWBB5UTcVh3xkrzbzlKa+nD5XFbfObcKPPsEp62DvxGMPiVtM8QaPesQ219z
 lydrmHpwh+sUhMJY9qfASIb669jHv5AiBy5umuy5Slasxhf252XxNenKutJh726w
 wz47hhV4vb4yo9DrchqxQXXSu3fwu5grSX3mRuklDGiduTX8mPQ=
 =5LPC
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2025-03-07' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
 "Fixes across the board, mostly xe and imagination with some amd and
  misc others.

  The xe fixes are mostly hmm related, though there are some others in
  there as well, nothing really stands out otherwise.

  The nouveau Kconfig to select FW_CACHE is in this, which we discussed
  a while back.

  nouveau:
   - rely on fw caching Kconfig fix

  imagination:
   - avoid deadlock on fence release
   - fix fence initialisation
   - fix timestamps firmware traces

  scheduler:
   - fix include guard

  bochs:
   - dpms fix

  i915:
   - bump max stream count to match pipes

  xe:
   - Remove double page flip on initial plane
   - Properly setup userptr pfn_flags_mask
   - Fix GT "for each engine" workarounds
   - Fix userptr races and missed validations
   - Userptr invalid page access fixes
   - Cleanup some style nits

  amdgpu:
   - Fix NULL check in DC code
   - SMU 14 fix

  amdkfd:
   - Fix NULL check in queue validation

  radeon:
   - RS400 HyperZ fix"

* tag 'drm-fixes-2025-03-07' of https://gitlab.freedesktop.org/drm/kernel: (22 commits)
  drm/bochs: Fix DPMS regression
  drm/xe/userptr: Unmap userptrs in the mmu notifier
  drm/xe/hmm: Don't dereference struct page pointers without notifier lock
  drm/xe/hmm: Style- and include fixes
  drm/xe: Add staging tree for VM binds
  drm/xe: Fix fault mode invalidation with unbind
  drm/xe/vm: Fix a misplaced #endif
  drm/xe/vm: Validate userptr during gpu vma prefetching
  drm/amd/pm: always allow ih interrupt from fw
  drm/radeon: Fix rs400_gpu_init for ATI mobility radeon Xpress 200M
  drm/amdkfd: Fix NULL Pointer Dereference in KFD queue
  drm/amd/display: Fix null check for pipe_ctx->plane_state in resource_build_scaling_params
  drm/xe: Fix GT "for each engine" workarounds
  drm/xe/userptr: properly setup pfn_flags_mask
  drm/i915/mst: update max stream count to match number of pipes
  drm/xe: Remove double pageflip
  drm/sched: Fix preprocessor guard
  drm/imagination: Fix timestamps in firmware traces
  drm/imagination: only init job done fences once
  drm/imagination: Hold drm_gem_gpuva lock for unmap
  ...
2025-03-06 17:04:25 -10:00
Breno Leitao
e7112524e5 block: Name the RQF flags enum
Commit 5f89154e8e ("block: Use enum to define RQF_x bit
indexes") converted the RQF flags to an anonymous enum, which was
a beneficial change. This patch goes one step further by naming the enum
as "rqf_flags".

This naming enables exporting these flags to BPF clients, eliminating
the need to duplicate these flags in BPF code. Instead, BPF clients can
now access the same kernel-side values through CO:RE (Compile Once, Run
Everywhere), as shown in this example:

    rqf_stats = bpf_core_enum_value(enum rqf_flags, __RQF_STATS)

Suggested-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20250306-rqf_flags-v1-1-bbd64918b406@debian.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-03-06 17:50:55 -07:00
Dave Airlie
c8bc66206a amd-drm-fixes-6.14-2025-03-06:
amdgpu:
 - Fix NULL check in DC code
 - SMU 14 fix
 
 amdkfd:
 - Fix NULL check in queue validation
 
 radeon:
 - RS400 HyperZ fix
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQgO5Idg2tXNTSZAr293/aFa7yZ2AUCZ8n32wAKCRC93/aFa7yZ
 2CbYAQDHOk3SuoZJoKZHosRoHu90hFxm9n+gkjj1TndngWGAtQD/U/PbTG9cfB0p
 Og1a+dgG1WaPhz3kTSZfYhpouue/jQI=
 =rQXH
 -----END PGP SIGNATURE-----

Merge tag 'amd-drm-fixes-6.14-2025-03-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-6.14-2025-03-06:

amdgpu:
- Fix NULL check in DC code
- SMU 14 fix

amdkfd:
- Fix NULL check in queue validation

radeon:
- RS400 HyperZ fix

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306193424.27413-1-alexander.deucher@amd.com
2025-03-07 09:54:43 +10:00
Linus Torvalds
0f52fd4f67 bcachefs fixes for 6.14-rc6
- Fix a compatibility issue: we shouldn't be setting incompat feature
   bits unless explicitly requested
 - Fix another bug where the journal alloc/resize path could spuriously
   fail with -BCH_ERR_open_buckets_empty
 - Copygc shouldn't run on read-only devices: fragmentation isn't an
   issue if we're not currently writing to a given device, and it may not
   have anywhere to move the data to.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEKnAFLkS8Qha+jvQrE6szbY3KbnYFAmfKLjoACgkQE6szbY3K
 bnZM+g//epeEpHSbQUeP7Vl7PLGuwElJPQNdzOjjcOpEms7z9uuN9gNT6TvXg7ix
 I1jvm8CKWM404Cv7THSnpinNB7Ye1JyPbOEVYLCFoSfSQlsB2yqMdnOPmGgLaJf/
 01itYGrbHrf/shJ68foLxCllCYJ8v5NyHxi+TYIporHWhGF7oC4gkBgvUG4DCbRY
 a08UcfB4AruPcC2wcJnmo4Ehi18Q8CmyLoU8T3Wo5icdeZ4qOZJfOyb/da5fNB3b
 vhyVEeMqUvQ5uzAcVgOt3zpLLVVT8pPy3o5FGB9zoNKzebJjZLep9Yf0WVfes3A+
 IwdPJRICs6xdkp5qCZOPJRNLi5ivEPb7pqjvX++3K33y3iuC6dHAphpOuNb1aVur
 dvu4X5n8h+myl0+d12f9Jo/IJNaUlM0QZFroNWxNlpu4P7u30jBNC99uaMCWH1HZ
 144s671QoevXa/eFZjBINsmJgrL/QEV071hpOl7YVbOpAkZ0BpisGhvhmPiR3i5P
 TGEWyClEXt0fHwqYKPwEX2RH+fjENRvAyulFmrpxgWV1EXU1C8tRlajiKKMBPx5r
 dLSnu5bfAqDZ950N5Kd7LP9JBKhrCrEn/f+G4Azxy20fAOIJfRKkC/lUMaKc4CAN
 RDm4E3cxKLI9XbYnlOPC9a7TEHOT5X3ucL2doMlfJSROfwS6elY=
 =rvVi
 -----END PGP SIGNATURE-----

Merge tag 'bcachefs-2025-03-06' of git://evilpiepirate.org/bcachefs

Pull bcachefs fixes from Kent Overstreet:

 - Fix a compatibility issue: we shouldn't be setting incompat feature
   bits unless explicitly requested

 - Fix another bug where the journal alloc/resize path could spuriously
   fail with -BCH_ERR_open_buckets_empty

 - Copygc shouldn't run on read-only devices: fragmentation isn't an
   issue if we're not currently writing to a given device, and it may
   not have anywhere to move the data to

* tag 'bcachefs-2025-03-06' of git://evilpiepirate.org/bcachefs:
  bcachefs: copygc now skips non-rw devices
  bcachefs: Fix bch2_dev_journal_alloc() spuriously failing
  bcachefs: Don't set BCH_FEATURE_incompat_version_field unless requested
2025-03-06 13:52:15 -10:00
Kent Overstreet
8ba73f53dc bcachefs: copygc now skips non-rw devices
There's no point in doing copygc on non-rw devices: the fragmentation
doesn't matter if we're not writing to them, and we may not have
anywhere to put the data on our other devices.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-06 18:15:01 -05:00
Kent Overstreet
33255c161a bcachefs: Fix bch2_dev_journal_alloc() spuriously failing
Previously, we fixed journal resize spuriousl failing with
-BCH_ERR_open_buckets_empty, but initial journal allocation was missed
because it didn't invoke the "block on allocator" loop at all.

Factor out the "loop on allocator" code to fix that.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-06 18:15:01 -05:00
Dave Airlie
eea6520c22 - Remove double page flip on initial plane (Maarten)
- Properly setup userptr pfn_flags_mask (Auld)
 - Fix GT "for each engine" workarounds (Tvrtko)
 - Fix userptr races and missed validations (Thomas, Brost)
 - Userptr invalid page access fixes (Thomas)
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEbSBwaO7dZQkcLOKj+mJfZA7rE8oFAmfJ4sIACgkQ+mJfZA7r
 E8rQTQf9FAfEO06akhCbW5hxLmOSy8yns1WGES5PcVAQ1DLxtu5W8X3jDIbXG0VR
 RjMVidd/jYlwpJwbOo2boXdnFGyuKM+3G6pfbo7BMKvbwalfbppIKdWajVv2wkQr
 Ye98jJUVZAnvcJJUEk1WHh0Oxr8sxidKpKg8xM0L3TUcDZx7bubyvYipv7/dF8qg
 uSbbfqua5heSrWeJV897VqbpM9f9Xzsv/Sw8/Tt4ldOOMrnlu0SU6tQHeAEHqvgM
 Vq1y8ub/JpyeQHCRdkoGJV8V8tcFVOQp488D0uJ/Z3eGUlnhWUdDOj7lj6EphSjX
 Xs0sUK0iS1MqPFuuSKu3/FD54W8kzw==
 =fJ2d
 -----END PGP SIGNATURE-----

Merge tag 'drm-xe-fixes-2025-03-06' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes

- Remove double page flip on initial plane (Maarten)
- Properly setup userptr pfn_flags_mask (Auld)
- Fix GT "for each engine" workarounds (Tvrtko)
- Fix userptr races and missed validations (Thomas, Brost)
- Userptr invalid page access fixes (Thomas)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Z8ni6w3tskCFL11O@intel.com
2025-03-07 09:03:18 +10:00
Dave Airlie
019899b551 - DP MST fix (Jani)
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEbSBwaO7dZQkcLOKj+mJfZA7rE8oFAmfJ4L0ACgkQ+mJfZA7r
 E8qzyAf/TeV+ltLLHye978FdfBQ3nNvEG1X7d42DdW8bUrHr7MXCmsBeMq/ClIJW
 cVHpFqMVz4lfbqLLqpiGjEJz0WRlNTbR7JkoF7GaePaQ0KKy1eMsOKS1MpSs+GsN
 VafFSJ5CSXmR6OZR7DB3A8/iP7i8b7rZe95ojNsuZ2ry1KkCqYBnq8SSP0of8dzl
 q6NoLbVZImkxZunIHJCKl787qhDZDfeqdBiDZZDRu5O9RVpA9wYcNOqniYlKZtFA
 47AnYAyh9nQJxpDpLnMH9lN5Y8PFEOhThboxN8a/z+JdAK7Zsj7BtQS0zPYwlzFV
 guuXHRc98AuyTXr4bVHlBs4alaJzUQ==
 =PNz+
 -----END PGP SIGNATURE-----

Merge tag 'drm-intel-fixes-2025-03-06' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes

- DP MST fix (Jani)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Z8ng8NjmRGiVcb5t@intel.com
2025-03-07 08:25:11 +10:00
Dave Airlie
ac3a75bd42 A Kconfig fix for nouveau, locking and timestamp fixes for imagination,
a header guard fix for sched and a DPMS regression fix for bochs.
 -----BEGIN PGP SIGNATURE-----
 
 iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCZ8l5igAKCRAnX84Zoj2+
 duz0AYDlXnuyvXTYxQY51KWw+4jqcbs5ehA7SvUTHfxeREW1b15VAnwp+fm/E1j5
 PaJZrDABgODcs6K/K7mLLWFbjjFOyid5EPEcQcRas4IrXwNeTlACSVXYEXkqIU36
 xZxRM2W6Lw==
 =G+Kg
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2025-03-06' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

A Kconfig fix for nouveau, locking and timestamp fixes for imagination,
a header guard fix for sched and a DPMS regression fix for bochs.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maxime Ripard <mripard@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306-antelope-of-imminent-anger-bca19e@houat
2025-03-07 07:06:34 +10:00
Ard Biesheuvel
c00b413a96 x86/boot: Sanitize boot params before parsing command line
The 5-level paging code parses the command line to look for the 'no5lvl'
string, and does so very early, before sanitize_boot_params() has been
called and has been given the opportunity to wipe bogus data from the
fields in boot_params that are not covered by struct setup_header, and
are therefore supposed to be initialized to zero by the bootloader.

This triggers an early boot crash when using syslinux-efi to boot a
recent kernel built with CONFIG_X86_5LEVEL=y and CONFIG_EFI_STUB=n, as
the 0xff padding that now fills the unused PE/COFF header is copied into
boot_params by the bootloader, and interpreted as the top half of the
command line pointer.

Fix this by sanitizing the boot_params before use. Note that there is no
harm in calling this more than once; subsequent invocations are able to
spot that the boot_params have already been cleaned up.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: <stable@vger.kernel.org> # v6.1+
Link: https://lore.kernel.org/r/20250306155915.342465-2-ardb+git@google.com
Closes: https://lore.kernel.org/all/202503041549.35913.ulrich.gemkow@ikr.uni-stuttgart.de
2025-03-06 22:02:39 +01:00
Linus Torvalds
f315296c92 We have been notified of a TLS regression that will be addressed
via the MM tree.
 
 Including fixes from bluetooth and wireless.
 
 Current release - new code bugs:
 
   - wifi: nl80211: disable multi-link reconfiguration
 
 Previous releases - regressions:
 
   - gso: fix ownership in __udp_gso_segment
 
   - wifi: iwlwifi:
     - fix A-MSDU TSO preparation
     - free pages allocated when failing to build A-MSDU
 
   - ipv6: fix dst ref loop in ila lwtunnel
 
   - mptcp: fix 'scheduling while atomic' in mptcp_pm_nl_append_new_local_addr
 
   - bluetooth: add check for mgmt_alloc_skb() in mgmt_device_connected()
 
   - ethtool: allow NULL nlattrs when getting a phy_device
 
   - eth: be2net: fix sleeping while atomic bugs in be_ndo_bridge_getlink
 
 Previous releases - always broken:
 
   - core: support TCP GSO case for a few missing flags
 
   - wifi: mac80211:
     - fix vendor-specific inheritance
     - cleanup sta TXQs on flush
 
   - llc: do not use skb_get() before dev_queue_xmit()
 
   - eth: ipa: nable checksum for IPA_ENDPOINT_AP_MODEM_{RX,TX} for v4.7
 
 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEg1AjqC77wbdLX2LbKSR5jcyPE6QFAmfJju8SHHBhYmVuaUBy
 ZWRoYXQuY29tAAoJECkkeY3MjxOkMHwP/3yeeCLI3+IFHxUowCQfltw65hxGwzK6
 2aODAtfVDZR1OervdE4iJld09cfIoopQc1Ej3hMUZ/Bsxil2ag3tQnjB4rGXQNI1
 TANp+nNfuGEpN/yeoNkymzXuMLI/RB27BByoIZdY5ArvFK3Q7pniaRMBXWkWfC5I
 2oBqZnpPwqtviTWXYa3n86oh5IY1C1n3i6Sqv6cCuu0g8ZVmgLkcDul2euNQ5ZnC
 x8p3N4EM8NYNRYFiSSU1F/hBpntfMwYA7UuAROPAY7x/11nCinoewXxAIkATw0GN
 LbDwvMqqaMykZNjM7YJouor8yUZYQdDScTQuWRqYV80xe5VUHksVZVxzMqfIS3bG
 nDuZT/buwO+wiHrW3SUa5QrVaun8HkSuVUKF8pxu0veTRDDgcGnPGZYt9v6uKJ10
 7mZqWUcjD+Hw+Tk+aLVGlaaYuIck4htOAOd/bD+RI/xEzCNjGyvhEZLTYMNA5WNR
 S9iapt+lyjvImAIAOn9C55X4x1cJ1g6qaYeRc/NXLh+XkVFG3GXPzvl07wuD7zt4
 CAM37W7zT2gyi8JgTKs2uWScVFgTQfXDW4LdGMMQrdApVk5ufPtcXWru5t3+I17k
 dyO2NbvtdaSso2LTp/RXFv7AQXz+qzX0NAi6sToijH26tiXHmYwyH6Scb8CwIQXc
 EClot5F+R7W0
 =QAYF
 -----END PGP SIGNATURE-----

Merge tag 'net-6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Paolo Abeni:
 "Including fixes from bluetooth and wireless.

  Current release - new code bugs:

   - wifi: nl80211: disable multi-link reconfiguration

  Previous releases - regressions:

   - gso: fix ownership in __udp_gso_segment

   - wifi: iwlwifi:
      - fix A-MSDU TSO preparation
      - free pages allocated when failing to build A-MSDU

   - ipv6: fix dst ref loop in ila lwtunnel

   - mptcp: fix 'scheduling while atomic' in
     mptcp_pm_nl_append_new_local_addr

   - bluetooth: add check for mgmt_alloc_skb() in
     mgmt_device_connected()

   - ethtool: allow NULL nlattrs when getting a phy_device

   - eth: be2net: fix sleeping while atomic bugs in
     be_ndo_bridge_getlink

  Previous releases - always broken:

   - core: support TCP GSO case for a few missing flags

   - wifi: mac80211:
      - fix vendor-specific inheritance
      - cleanup sta TXQs on flush

   - llc: do not use skb_get() before dev_queue_xmit()

   - eth: ipa: nable checksum for IPA_ENDPOINT_AP_MODEM_{RX,TX}
     for v4.7"

* tag 'net-6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (41 commits)
  net: ipv6: fix missing dst ref drop in ila lwtunnel
  net: ipv6: fix dst ref loop in ila lwtunnel
  mctp i3c: handle NULL header address
  net: dsa: mt7530: Fix traffic flooding for MMIO devices
  net-timestamp: support TCP GSO case for a few missing flags
  vlan: enforce underlying device type
  mptcp: fix 'scheduling while atomic' in mptcp_pm_nl_append_new_local_addr
  net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device
  ppp: Fix KMSAN uninit-value warning with bpf
  net: ipa: Enable checksum for IPA_ENDPOINT_AP_MODEM_{RX,TX} for v4.7
  net: ipa: Fix QSB data for v4.7
  net: ipa: Fix v4.7 resource group names
  net: hns3: make sure ptp clock is unregister and freed if hclge_ptp_get_cycle returns an error
  wifi: nl80211: disable multi-link reconfiguration
  net: dsa: rtl8366rb: don't prompt users for LED control
  be2net: fix sleeping while atomic bugs in be_ndo_bridge_getlink
  llc: do not use skb_get() before dev_queue_xmit()
  wifi: cfg80211: regulatory: improve invalid hints checking
  caif_virtio: fix wrong pointer check in cfv_probe()
  net: gso: fix ownership in __udp_gso_segment
  ...
2025-03-06 09:34:54 -10:00
Linus Torvalds
1238f0af13 Five SMB server fixes, two related client fixes, and minor MAINTAINERS update
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmfJNHEACgkQiiy9cAdy
 T1EChgv/UKhM3QptW++f0sVL7T7rPPpX0K18B/rrXrdKedP+MBp2BpeF+2Hm/YEQ
 VJndiltUzmOsXnO5NCqcsczHhYtn9J6oK50kCG7L/lNs1rK7BckXbaUtMyFJ1zbi
 2mjCUVJfO9bEDUfIWq27+RSoce8UDiFTqvmjJnqTU9ogL/lmRZq8TNpHdj984mCh
 XiqbSVWDbYwm7RAJovRp2WY8K2OqZ1FTpNmhjaPHAMWQ3r11Am125MLNackEg7SW
 0Zp816G02it7NKD59V860d4BDL1Qi2WBqrH1BdYcX9cfo0vScdPV9BuCGbcfKCZ3
 UHH6oJdc/kRZw8zCUHjgLZcvDJmmH5umDStfPAdCQYw9n6MoxP6gi5xldWDb9o5l
 0goN3R8afn8V27N+BRKIs+gN8qqat7Pmpl62TMSRQEMCceDc5uH+r5lgFzswwNZL
 Yc3VJRrEZmBYlHOY3uSwoqwoM0ugB27Wo0JqdH3UKB7nY616CpdJyExaW5XgUqO5
 uSekIAx6
 =/wl5
 -----END PGP SIGNATURE-----

Merge tag 'v6.14-rc5-smb3-fixes' of git://git.samba.org/ksmbd

Pull smb fixes from Steve French:
 "Five SMB server fixes, two related client fixes, and minor MAINTAINERS
  update:

   - Two SMB3 lock fixes fixes (including use after free and bug on fix)

   - Fix to race condition that can happen in processing IPC responses

   - Four ACL related fixes: one related to endianness of num_aces, and
     two related fixes to the checks for num_aces (for both client and
     server), and one fixing missing check for num_subauths which can
     cause memory corruption

   - And minor update to email addresses in MAINTAINERS file"

* tag 'v6.14-rc5-smb3-fixes' of git://git.samba.org/ksmbd:
  cifs: fix incorrect validation for num_aces field of smb_acl
  ksmbd: fix incorrect validation for num_aces field of smb_acl
  smb: common: change the data type of num_aces to le16
  ksmbd: fix bug on trap in smb2_lock
  ksmbd: fix use-after-free in smb2_lock
  ksmbd: fix type confusion via race condition when using ipc_msg_send_request
  ksmbd: fix out-of-bounds in parse_sec_desc()
  MAINTAINERS: update email address in cifs and ksmbd entry
2025-03-06 09:19:15 -10:00
Linus Torvalds
5872cca23a Description for this pull request:
- Optimize new cluster allocation by correctly find empty entry slot.
  - Add the check to prevent excessive bitmap clearing due to invalid
    data size of file/dir entry.
  - Fix incorrect error return for zero-byte writes.
 -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEE6NzKS6Uv/XAAGHgyZwv7A1FEIQgFAmfISf4WHGxpbmtpbmpl
 b25Aa2VybmVsLm9yZwAKCRBnC/sDUUQhCKd9EACSQdLgmeW12CLw55pEB75yoVwc
 Y4UMzJzS+JT/G+HFeepUi7uXO95TgydZwJ77Zrm5OWRrjhe3l22SXJnhAlPthUeB
 HR9B+igbDV4nbbNr1IyPLc9GUKWU7IxcFa1aEa4gNKScGgZgGMnnbNZfPYrI82Mo
 QNB/OAtgB30I8SOnMYAEsluzZzJIA5QgoD/5tzhxAfhu5+yPws/zC62TB8mSpOnm
 swlkl7e6onp4UBhhzEJs+1gprRwOWGqn24D9bL7jsb/zzK8i6iwLZ9J4+VyDoEIw
 AofbG0qDa7p7jowhliuUyAzoX0SFDp/jMCqvX914yCtqZrl8wezj0o5ScTDxPz5L
 q8ggCryjjNcPKvwSxNxgZv8bE+fxgV5Fln4S/TKM9A6sXLc4rHvfatdCtD9xLLPY
 mo3FzN0FYXgmbQtpJTF8gj5jtS1zBiFAUKzXHFbobSdn8eQ+k79GXA83TfgbS9zV
 x/qO3PlK4X4Ogu4OC8H110i5OfDtx3lOIPWLpdyhJfzU9aUrZ/QVPLDuLdcpkLMl
 DrBR4RzqCLrLHKx3PEy3jioM+gLhngOfitDt/x/pChHu1NeNCFMr9u75EnBbBYQ0
 YiJn6/PfSK9B8LNcUw6796YFxcbPuu5RZtUreUJSHXXNTUyENNGDNsTWY/BYTzZQ
 9dOPyBVR9O9/R7hZqg==
 =aa/n
 -----END PGP SIGNATURE-----

Merge tag 'exfat-for-6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat

Pull exfat fixes from Namjae Jeon:

 - Optimize new cluster allocation by correctly find empty entry slot

 - Add a check to prevent excessive bitmap clearing due to invalid
   data size of file/dir entry

 - Fix incorrect error return for zero-byte writes

* tag 'exfat-for-6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
  exfat: add a check for invalid data size
  exfat: short-circuit zero-byte writes in exfat_file_write_iter
  exfat: fix soft lockup in exfat_clear_bitmap
  exfat: fix just enough dentries but allocate a new cluster to dir
2025-03-06 08:18:48 -10:00
Linus Torvalds
7f0e9ee5e4 vfs-6.14-rc6.fixes
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCZ8luaQAKCRCRxhvAZXjc
 ojy2AP4uh2xDBycjRQV+YIMwbwJo7cuphZH8MuLzrUKTTH50BQEA9+tpOpvI9vW3
 326FH2wo8Hzqn3rct217/tpTCww64Qk=
 =/iqC
 -----END PGP SIGNATURE-----

Merge tag 'vfs-6.14-rc6.fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs

Pull vfs fixes from Christian Brauner:

 - Fix spelling mistakes in idmappings.rst

 - Fix RCU warnings in override_creds()/revert_creds()

 - Create new pid namespaces with default limit now that pid_max is
   namespaced

* tag 'vfs-6.14-rc6.fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs:
  pid: Do not set pid_max in new pid namespaces
  doc: correcting two prefix errors in idmappings.rst
  cred: Fix RCU warnings in override/revert_creds
2025-03-06 08:04:49 -10:00
Linus Torvalds
ebb0f38bb4 fs/pipe: fix pipe buffer index use in FUSE
This was another case that Rasmus pointed out where the direct access to
the pipe head and tail pointers broke on 32-bit configurations due to
the type changes.

As with the pipe FIONREAD case, fix it by using the appropriate helper
functions that deal with the right pipe index sizing.

Reported-by: Rasmus Villemoes <ravi@prevas.dk>
Link: https://lore.kernel.org/all/878qpi5wz4.fsf@prevas.dk/
Fixes: 3d252160b8 ("fs/pipe: Read pipe->{head,tail} atomically outside pipe->mutex")Cc: Oleg >
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Swapnil Sapkal <swapnil.sapkal@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-03-06 07:53:25 -10:00
Linus Torvalds
d810d4c27b fs/pipe: do not open-code pipe head/tail logic in FIONREAD
Rasmus points out that we do indeed have other cases of breakage from
the type changes that were introduced on 32-bit targets in order to read
the pipe head and tail values atomically (commit 3d252160b8: "fs/pipe:
Read pipe->{head,tail} atomically outside pipe->mutex").

Fix it up by using the proper helper functions that now deal with the
pipe buffer index types properly.  This makes the code simpler and more
obvious.

The compiler does the CSE and loop hoisting of the pipe ring size
masking that we used to do manually, so open-coding this was never a
good idea.

Reported-by: Rasmus Villemoes <ravi@prevas.dk>
Link: https://lore.kernel.org/all/87cyeu5zgk.fsf@prevas.dk/
Fixes: 3d252160b8 ("fs/pipe: Read pipe->{head,tail} atomically outside pipe->mutex")Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Swapnil Sapkal <swapnil.sapkal@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-03-06 07:33:58 -10:00
Linus Torvalds
74d42bdb3a fs/pipe: express 'pipe_empty()' in terms of 'pipe_occupancy()'
That's what 'pipe_full()' does, so it's more consistent. But more
importantly it gets the type limits right when the pipe head and tail
are no longer necessarily 'unsigned int'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-03-06 07:30:42 -10:00
Andrei Kuchynski
b13abcb7dd usb: typec: ucsi: Fix NULL pointer access
Resources should be released only after all threads that utilize them
have been destroyed.
This commit ensures that resources are not released prematurely by waiting
for the associated workqueue to complete before deallocating them.

Cc: stable <stable@kernel.org>
Fixes: b9aa02ca39 ("usb: typec: ucsi: Add polling mechanism for partner tasks like alt mode checking")
Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250305111739.1489003-2-akuchynski@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-06 16:55:46 +01:00
Miao Li
ff712188da usb: quirks: Add DELAY_INIT and NO_LPM for Prolific Mass Storage Card Reader
When used on Huawei hisi platforms, Prolific Mass Storage Card Reader
which the VID:PID is in 067b:2731 might fail to enumerate at boot time
and doesn't work well with LPM enabled, combination quirks:
	USB_QUIRK_DELAY_INIT + USB_QUIRK_NO_LPM
fixed the problems.

Signed-off-by: Miao Li <limiao@kylinos.cn>
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/20250304070757.139473-1-limiao870622@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-06 16:50:24 +01:00
Fabrizio Castro
391b41f983 gpio: rcar: Fix missing of_node_put() call
of_parse_phandle_with_fixed_args() requires its caller to
call into of_node_put() on the node pointer from the output
structure, but such a call is currently missing.

Call into of_node_put() to rectify that.

Fixes: 159f8a0209 ("gpio-rcar: Add DT support")
Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20250305163753.34913-2-fabrizio.castro.jz@renesas.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-03-06 15:51:27 +01:00
Haoxiang Li
35d99c68af btrfs: fix a leaked chunk map issue in read_one_chunk()
Add btrfs_free_chunk_map() to free the memory allocated
by btrfs_alloc_chunk_map() if btrfs_add_chunk_map() fails.

Fixes: 7dc66abb5a ("btrfs: use a dedicated data structure for chunk maps")
CC: stable@vger.kernel.org
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2025-03-06 14:40:09 +01:00
Jens Axboe
ca57b5bfa2 nvme fixes for Linux 6.14
- TCP use after free fix on polling (Sagi)
  - Controller memory buffer cleanup fixes (Icenowy)
  - Free leaking requests on bad user passthrough commands (Keith)
  - TCP error message fix (Maurizio)
  - TCP corruption fix on partial PDU (Maurizio)
  - TCP memory ordering fix for weakly ordered archs (Meir)
  - Type coercion fix on message error for TCP (Dan)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE3Fbyvv+648XNRdHTPe3zGtjzRgkFAmfIsKgACgkQPe3zGtjz
 Rgkhvg/8DTP/wSeUYXMY+x9vGexpqCh9tasvwl47Y3Ls5V/UTXCOh6i44fhLNgdD
 tjUkh6SZ8jk44Ra4mP5ScZ4cTGxKEqn91bNGkhmcnK4J4DlQ3mvG4Y8shuj6Pxaf
 +fAESOtmNHNFEnotMq4EmO+jl9MUxIae74mBRFj+N858lpD9Qk1PL63RcIaCNUei
 ds4s9E+aF8X3kJtXiyT5a9NO6xtAEPoc7Hv/3ZAcXTLp2DgWd5vMe/28COlI6TlF
 kQ82HuoGcVtWIiYTOpwkKmZE+WdHfkBwgRuNyI2U4Bj2tU4aWSvgBmiFIkZUMehk
 iThJvgniSEAuUPAEArOHmcyLT/xoadh6gUsx9Xl8E/6tYt8EKCspfoxid6lyYnU2
 BwNGVsF6T8+dvWQWLvyTkdQ+3iQGI9BO88Bxkfzd8iNYcRj2L7XXgH5ldUR88oj/
 CjRsvc7DA8pYMtFpB4QOyW7iI07WDa75isr7pzyD3qcjbzXLr3KafCU+HCMCrTRF
 /Vyiol61CrADSdVAV9YSjck94hAhgLDkE2l+3b++/+ikXRRbYJgvFoYvLRUGRMch
 adhWoD6mEcH8kqb4/RimkE/XxvMAYIUOXKVkulry05TXboez49dbAK29cELLX5VO
 bAYjcE5+UTg+ftzmwCQvF4WE38WtAExXroGtp7PG0UtonMi9SRg=
 =avc1
 -----END PGP SIGNATURE-----

Merge tag 'nvme-6.14-2025-03-05' of git://git.infradead.org/nvme into block-6.14

Pull NVMe fixe from Keith:

"nvme fixes for Linux 6.14

 - TCP use after free fix on polling (Sagi)
 - Controller memory buffer cleanup fixes (Icenowy)
 - Free leaking requests on bad user passthrough commands (Keith)
 - TCP error message fix (Maurizio)
 - TCP corruption fix on partial PDU (Maurizio)
 - TCP memory ordering fix for weakly ordered archs (Meir)
 - Type coercion fix on message error for TCP (Dan)"

* tag 'nvme-6.14-2025-03-05' of git://git.infradead.org/nvme:
  nvme-tcp: fix signedness bug in nvme_tcp_init_connection()
  nvmet-tcp: Fix a possible sporadic response drops in weakly ordered arch
  nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()
  nvme-tcp: Fix a C2HTermReq error message
  nvmet: remove old function prototype
  nvme-ioctl: fix leaked requests on mapping error
  nvme-pci: skip CMB blocks incompatible with PCI P2P DMA
  nvme-pci: clean up CMBMSC when registering CMB fails
  nvme-tcp: fix possible UAF in nvme_tcp_poll
2025-03-06 04:32:46 -07:00
Inochi Amaoto
b5e3956535 kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT
Since commit 5f73e7d038 ("kbuild: refactor cross-compiling
linux-headers package"), the linux-headers pacman package fails
to build when "O=" is set. The build system complains:

/mnt/chroot/linux/scripts/Makefile.build:41: mnt/chroots/linux-mainline/pacman/linux-upstream/pkg/linux-upstream-headers/usr//lib/modules/6.14.0-rc3-00350-g771dba31fffc/build/scripts/Makefile: No such file or directory

This is because the "srcroot" variable is set to "." and the
"build" variable is set to the absolute path. This makes the
"src" variables point to wrong directory.

Change the "build" variable to a relative path to "." to
fix build.

Fixes: 5f73e7d038 ("kbuild: refactor cross-compiling linux-headers package")
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-03-06 20:32:30 +09:00
Justin Iurman
5da15a9c11 net: ipv6: fix missing dst ref drop in ila lwtunnel
Add missing skb_dst_drop() to drop reference to the old dst before
adding the new dst to the skb.

Fixes: 79ff2fc31e ("ila: Cache a route to translated address")
Cc: Tom Herbert <tom@herbertland.com>
Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Link: https://patch.msgid.link/20250305081655.19032-1-justin.iurman@uliege.be
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-03-06 11:08:45 +01:00
Justin Iurman
0e7633d7b9 net: ipv6: fix dst ref loop in ila lwtunnel
This patch follows commit 92191dd107 ("net: ipv6: fix dst ref loops in
rpl, seg6 and ioam6 lwtunnels") and, on a second thought, the same patch
is also needed for ila (even though the config that triggered the issue
was pathological, but still, we don't want that to happen).

Fixes: 79ff2fc31e ("ila: Cache a route to translated address")
Cc: Tom Herbert <tom@herbertland.com>
Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Link: https://patch.msgid.link/20250304181039.35951-1-justin.iurman@uliege.be
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-03-06 10:48:57 +01:00
Matt Johnston
cf7ee25e70 mctp i3c: handle NULL header address
daddr can be NULL if there is no neighbour table entry present,
in that case the tx packet should be dropped.

saddr will usually be set by MCTP core, but check for NULL in case a
packet is transmitted by a different protocol.

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Fixes: c8755b29b5 ("mctp i3c: MCTP I3C driver")
Link: https://patch.msgid.link/20250304-mctp-i3c-null-v1-1-4416bbd56540@codeconstruct.com.au
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-03-06 10:33:07 +01:00
Shrikanth Hegde
b1536481c8 sched/rt: Update limit of sched_rt sysctl in documentation
By default fair_server dl_server allocates 5% of the bandwidth to the root
domain. Due to this writing any value less than 5% fails due to -EBUSY:

  $ cat /proc/sys/kernel/sched_rt_period_us
  1000000

  $ echo 49999 > /proc/sys/kernel/sched_rt_runtime_us
  -bash: echo: write error: Device or resource busy

  $ echo 50000 > /proc/sys/kernel/sched_rt_runtime_us
  $

Since the sched_rt_runtime_us allows -1 as the minimum, put this
restriction in the documentation.

One should check average of runtime/period in
/sys/kernel/debug/sched/fair_server/cpuX/* for exact value.

Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://lore.kernel.org/r/20250306052954.452005-3-sshegde@linux.ibm.com
2025-03-06 10:21:31 +01:00
Shrikanth Hegde
14672f059d sched/deadline: Use online cpus for validating runtime
The ftrace selftest reported a failure because writing -1 to
sched_rt_runtime_us returns -EBUSY. This happens when the possible
CPUs are different from active CPUs.

Active CPUs are part of one root domain, while remaining CPUs are part
of def_root_domain. Since active cpumask is being used, this results in
cpus=0 when a non active CPUs is used in the loop.

Fix it by looping over the online CPUs instead for validating the
bandwidth calculations.

Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://lore.kernel.org/r/20250306052954.452005-2-sshegde@linux.ibm.com
2025-03-06 10:21:31 +01:00
Michal Koutný
d385c8bceb
pid: Do not set pid_max in new pid namespaces
It is already difficult for users to troubleshoot which of multiple pid
limits restricts their workload. The per-(hierarchical-)NS pid_max would
contribute to the confusion.
Also, the implementation copies the limit upon creation from
parent, this pattern showed cumbersome with some attributes in legacy
cgroup controllers -- it's subject to race condition between parent's
limit modification and children creation and once copied it must be
changed in the descendant.

Let's do what other places do (ucounts or cgroup limits) -- create new
pid namespaces without any limit at all. The global limit (actually any
ancestor's limit) is still effectively in place, we avoid the
set/unshare race and bumps of global (ancestral) limit have the desired
effect on pid namespace that do not care.

Link: https://lore.kernel.org/r/20240408145819.8787-1-mkoutny@suse.com/
Link: https://lore.kernel.org/r/20250221170249.890014-1-mkoutny@suse.com/
Fixes: 7863dcc72d ("pid: allow pid_max to be set per pid namespace")
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Link: https://lore.kernel.org/r/20250305145849.55491-1-mkoutny@suse.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-03-06 10:18:36 +01:00
Takashi Iwai
80da96d735 drm/bochs: Fix DPMS regression
The recent rewrite with the use of regular atomic helpers broke the
DPMS unblanking on X11.  Fix it by moving the call of
bochs_hw_blank(false) from CRTC mode_set_nofb() to atomic_enable().

Fixes: 2037174993 ("drm/bochs: Use regular atomic helpers")
Link: https://bugzilla.suse.com/show_bug.cgi?id=1238209
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20250304134203.20534-1-tiwai@suse.de
2025-03-06 08:54:42 +01:00
Hao Zhang
8fe9ed44dc mm/page_alloc: fix uninitialized variable
The variable "compact_result" is not initialized in function
__alloc_pages_slowpath().  It causes should_compact_retry() to use an
uninitialized value.

Initialize variable "compact_result" with the value COMPACT_SKIPPED.

BUG: KMSAN: uninit-value in __alloc_pages_slowpath+0xee8/0x16c0 mm/page_alloc.c:4416
 __alloc_pages_slowpath+0xee8/0x16c0 mm/page_alloc.c:4416
 __alloc_frozen_pages_noprof+0xa4c/0xe00 mm/page_alloc.c:4752
 alloc_pages_mpol+0x4cd/0x890 mm/mempolicy.c:2270
 alloc_frozen_pages_noprof mm/mempolicy.c:2341 [inline]
 alloc_pages_noprof mm/mempolicy.c:2361 [inline]
 folio_alloc_noprof+0x1dc/0x350 mm/mempolicy.c:2371
 filemap_alloc_folio_noprof+0xa6/0x440 mm/filemap.c:1019
 __filemap_get_folio+0xb9a/0x1840 mm/filemap.c:1970
 grow_dev_folio fs/buffer.c:1039 [inline]
 grow_buffers fs/buffer.c:1105 [inline]
 __getblk_slow fs/buffer.c:1131 [inline]
 bdev_getblk+0x2c9/0xab0 fs/buffer.c:1431
 getblk_unmovable include/linux/buffer_head.h:369 [inline]
 ext4_getblk+0x3b7/0xe50 fs/ext4/inode.c:864
 ext4_bread_batch+0x9f/0x7d0 fs/ext4/inode.c:933
 __ext4_find_entry+0x1ebb/0x36c0 fs/ext4/namei.c:1627
 ext4_lookup_entry fs/ext4/namei.c:1729 [inline]
 ext4_lookup+0x189/0xb40 fs/ext4/namei.c:1797
 __lookup_slow+0x538/0x710 fs/namei.c:1793
 lookup_slow+0x6a/0xd0 fs/namei.c:1810
 walk_component fs/namei.c:2114 [inline]
 link_path_walk+0xf29/0x1420 fs/namei.c:2479
 path_openat+0x30f/0x6250 fs/namei.c:3985
 do_filp_open+0x268/0x600 fs/namei.c:4016
 do_sys_openat2+0x1bf/0x2f0 fs/open.c:1428
 do_sys_open fs/open.c:1443 [inline]
 __do_sys_openat fs/open.c:1459 [inline]
 __se_sys_openat fs/open.c:1454 [inline]
 __x64_sys_openat+0x2a1/0x310 fs/open.c:1454
 x64_sys_call+0x36f5/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:258
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Local variable compact_result created at:
 __alloc_pages_slowpath+0x66/0x16c0 mm/page_alloc.c:4218
 __alloc_frozen_pages_noprof+0xa4c/0xe00 mm/page_alloc.c:4752

Link: https://lkml.kernel.org/r/tencent_ED1032321D6510B145CDBA8CBA0093178E09@qq.com
Reported-by: syzbot+0cfd5e38e96a5596f2b6@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=0cfd5e38e96a5596f2b6
Signed-off-by: Hao Zhang <zhanghao1@kylinos.cn>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:20 -08:00
Haoxiang Li
e842f9a1ed rapidio: add check for rio_add_net() in rio_scan_alloc_net()
The return value of rio_add_net() should be checked.  If it fails,
put_device() should be called to free the memory and give up the reference
initialized in rio_add_net().

Link: https://lkml.kernel.org/r/20250227041131.3680761-1-haoxiang_li2024@163.com
Fixes: e6b585ca6e ("rapidio: move net allocation into core code")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:19 -08:00
Haoxiang Li
b2ef51c74b rapidio: fix an API misues when rio_add_net() fails
rio_add_net() calls device_register() and fails when device_register()
fails.  Thus, put_device() should be used rather than kfree().  Add
"mport->net = NULL;" to avoid a use after free issue.

Link: https://lkml.kernel.org/r/20250227073409.3696854-1-haoxiang_li2024@163.com
Fixes: e8de370188 ("rapidio: add mport char device driver")
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Yang Yingliang <yangyingliang@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:19 -08:00
Sumit Garg
88f5a9a945 MAINTAINERS: .mailmap: update Sumit Garg's email address
Update Sumit Garg's email address to @kernel.org.

Link: https://lkml.kernel.org/r/20250227113228.1809449-1-sumit.garg@linaro.org
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:19 -08:00
Gabriel Krisman Bertazi
eae116d1f0 Revert "mm/page_alloc.c: don't show protection in zone's ->lowmem_reserve[] for empty zone"
Commit 96a5c186ef ("mm/page_alloc.c: don't show protection in zone's
->lowmem_reserve[] for empty zone") removes the protection of lower zones
from allocations targeting memory-less high zones.  This had an unintended
impact on the pattern of reclaims because it makes the high-zone-targeted
allocation more likely to succeed in lower zones, which adds pressure to
said zones.  I.e, the following corresponding checks in
zone_watermark_ok/zone_watermark_fast are less likely to trigger:

        if (free_pages <= min + z->lowmem_reserve[highest_zoneidx])
                return false;

As a result, we are observing an increase in reclaim and kswapd scans, due
to the increased pressure.  This was initially observed as increased
latency in filesystem operations when benchmarking with fio on a machine
with some memory-less zones, but it has since been associated with
increased contention in locks related to memory reclaim.  By reverting
this patch, the original performance was recovered on that machine.

The original commit was introduced as a clarification of the
/proc/zoneinfo output, so it doesn't seem there are usecases depending on
it, making the revert a simple solution.

For reference, I collected vmstat with and without this patch on a freshly
booted system running intensive randread io from an nvme for 5 minutes.  I
got:

rpm-6.12.0-slfo.1.2 ->  pgscan_kswapd 5629543865
Patched             ->  pgscan_kswapd 33580844

33M scans is similar to what we had in kernels predating this patch. 
These numbers is fairly representative of the workload on this machine, as
measured in several runs.  So we are talking about a 2-order of magnitude
increase.

Link: https://lkml.kernel.org/r/20250226032258.234099-1-krisman@suse.de
Fixes: 96a5c186ef ("mm/page_alloc.c: don't show protection in zone's ->lowmem_reserve[] for empty zone")
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:19 -08:00
Brian Geffon
34b82f33cf mm: fix finish_fault() handling for large folios
When handling faults for anon shmem finish_fault() will attempt to install
ptes for the entire folio.  Unfortunately if it encounters a single
non-pte_none entry in that range it will bail, even if the pte that
triggered the fault is still pte_none.  When this situation happens the
fault will be retried endlessly never making forward progress.

This patch fixes this behavior and if it detects that a pte in the range
is not pte_none it will fall back to setting a single pte.

[bgeffon@google.com: tweak whitespace]
  Link: https://lkml.kernel.org/r/20250227133236.1296853-1-bgeffon@google.com
Link: https://lkml.kernel.org/r/20250226162341.915535-1-bgeffon@google.com
Fixes: 43e027e414 ("mm: memory: extend finish_fault() to support large folio")
Signed-off-by: Brian Geffon <bgeffon@google.com>
Suggested-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reported-by: Marek Maslanka <mmaslanka@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickens <hughd@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Matthew Wilcow (Oracle) <willy@infradead.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:18 -08:00
Ryan Roberts
3685024edd mm: don't skip arch_sync_kernel_mappings() in error paths
Fix callers that previously skipped calling arch_sync_kernel_mappings() if
an error occurred during a pgtable update.  The call is still required to
sync any pgtable updates that may have occurred prior to hitting the error
condition.

These are theoretical bugs discovered during code review.

Link: https://lkml.kernel.org/r/20250226121610.2401743-1-ryan.roberts@arm.com
Fixes: 2ba3e6947a ("mm/vmalloc: track which page-table levels were modified")
Fixes: 0c95cba492 ("mm: apply_to_pte_range warn and fail if a large pte is encountered")
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christop Hellwig <hch@infradead.org>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:18 -08:00
Ricardo Cañuelo Navarro
adae46ac1e mm: shmem: remove unnecessary warning in shmem_writepage()
Although the scenario where shmem_writepage() is called with info->flags &
VM_LOCKED is unlikely to happen, it's still possible, as evidenced by
syzbot [1].  However, the warning in this case isn't necessary because the
situation is already handled correctly [2].

[2] https://lore.kernel.org/lkml/8afe1f7f-31a2-4fc0-1fbd-f9ba8a116fe3@google.com/

Link: https://lkml.kernel.org/r/20250226-20250221-warning-in-shmem_writepage-v1-1-5ad19420e17e@igalia.com
Fixes: 9a976f0c84 ("shmem: skip page split if we're not reclaiming")
Signed-off-by: Ricardo Cañuelo Navarro <rcn@igalia.com>
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Closes: https://lore.kernel.org/lkml/ZZ9PShXjKJkVelNm@xpf.sh.intel.com/ [1]
Suggested-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Florent Revest <revest@chromium.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Florent Revest <revest@chromium.org>
Cc: Luis Chamberalin <mcgrof@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:18 -08:00
Suren Baghdasaryan
927e926d72 userfaultfd: fix PTE unmapping stack-allocated PTE copies
Current implementation of move_pages_pte() copies source and destination
PTEs in order to detect concurrent changes to PTEs involved in the move. 
However these copies are also used to unmap the PTEs, which will fail if
CONFIG_HIGHPTE is enabled because the copies are allocated on the stack. 
Fix this by using the actual PTEs which were kmap()ed.

Link: https://lkml.kernel.org/r/20250226185510.2732648-3-surenb@google.com
Fixes: adef440691 ("userfaultfd: UFFDIO_MOVE uABI")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reported-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Barry Song <21cnbao@gmail.com>
Cc: Barry Song <v-songbaohua@oppo.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcow (Oracle) <willy@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:18 -08:00
Suren Baghdasaryan
37b338eed1 userfaultfd: do not block on locking a large folio with raised refcount
Lokesh recently raised an issue about UFFDIO_MOVE getting into a deadlock
state when it goes into split_folio() with raised folio refcount. 
split_folio() expects the reference count to be exactly mapcount +
num_pages_in_folio + 1 (see can_split_folio()) and fails with EAGAIN
otherwise.

If multiple processes are trying to move the same large folio, they raise
the refcount (all tasks succeed in that) then one of them succeeds in
locking the folio, while others will block in folio_lock() while keeping
the refcount raised.  The winner of this race will proceed with calling
split_folio() and will fail returning EAGAIN to the caller and unlocking
the folio.  The next competing process will get the folio locked and will
go through the same flow.  In the meantime the original winner will be
retried and will block in folio_lock(), getting into the queue of waiting
processes only to repeat the same path.  All this results in a livelock.

An easy fix would be to avoid waiting for the folio lock while holding
folio refcount, similar to madvise_free_huge_pmd() where folio lock is
acquired before raising the folio refcount.  Since we lock and take a
refcount of the folio while holding the PTE lock, changing the order of
these operations should not break anything.

Modify move_pages_pte() to try locking the folio first and if that fails
and the folio is large then return EAGAIN without touching the folio
refcount.  If the folio is single-page then split_folio() is not called,
so we don't have this issue.  Lokesh has a reproducer [1] and I verified
that this change fixes the issue.

[1] https://github.com/lokeshgidra/uffd_move_ioctl_deadlock

[akpm@linux-foundation.org: reflow comment to 80 cols, s/end/end up/]
Link: https://lkml.kernel.org/r/20250226185510.2732648-2-surenb@google.com
Fixes: adef440691 ("userfaultfd: UFFDIO_MOVE uABI")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reported-by: Lokesh Gidra <lokeshgidra@google.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Barry Song <21cnbao@gmail.com>
Cc: Barry Song <v-songbaohua@oppo.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcow (Oracle) <willy@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:17 -08:00
Sun YangKai
ea6de4f8f8 mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages
This is currently the only atomic_long_t variable initialized by
ATOMIC_INIT macro found in the kernel by using `grep -r atomic_long_t |
grep ATOMIC_INIT`

This was introduced in 6e1fa555ec, in which we modified the type of
zswap_stored_pages to atomic_long_t, but didn't change the initialization.

Link: https://lkml.kernel.org/r/20250226153253.19179-1-sunk67188@gmail.com
Fixes: 6e1fa555ec ("mm: zswap: modify zswap_stored_pages to be atomic_long_t")
Signed-off-by: Sun YangKai <sunk67188@gmail.com>
Acked-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:17 -08:00