Commit Graph

103019 Commits (0dfb36b2dcb666f116ba314e631bd3bc632c44d1)

Author SHA1 Message Date
Linus Torvalds 0dfb36b2dc We have a patch that adds an initial set of tracepoints to the MDS
client from Max, a fix that hardens osdmap parsing code from myself
 (marked for stable) and a few assorted fixups.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEydHwtzie9C7TfviiSn/eOAIR84sFAmk8YxITHGlkcnlvbW92
 QGdtYWlsLmNvbQAKCRBKf944AhHzi702B/9Mfj0HQSAaWCyMz6GJAv8+1ijVTSbG
 nTFeMmipYZhPn188OvWqHsf1cw9rWY0fzenIEW05Tk3YmMvYdeRmCcOkZdeG06xw
 um8XxX4L8315E0b98CCpQpVa02ux7XoNtBPjeHccl8PEErJQgQJrQ3Cc/C8kk5U5
 a0KlfeVRXYWkOPJva3+wosOu0t9QgJ9ABt5stqcvYDfdkKfvatQMBN3N1nNRKkFH
 yhNPv+nRtypSk8jiHhKeeCVmosC0L7MnKuO593vDr761cY5mKrgKFqc2LLlPF6r0
 /p13s5SG6X38RUegWCjcK4XRJAzVcR/tyod8LkVVp8d5DC/ptcyy8H+I
 =h1gC
 -----END PGP SIGNATURE-----

Merge tag 'ceph-for-6.19-rc1' of https://github.com/ceph/ceph-client

Pull ceph updates from Ilya Dryomov:
 "We have a patch that adds an initial set of tracepoints to the MDS
  client from Max, a fix that hardens osdmap parsing code from myself
  (marked for stable) and a few assorted fixups"

* tag 'ceph-for-6.19-rc1' of https://github.com/ceph/ceph-client:
  rbd: stop selecting CRC32, CRYPTO, and CRYPTO_AES
  ceph: stop selecting CRC32, CRYPTO, and CRYPTO_AES
  libceph: make decode_pool() more resilient against corrupted osdmaps
  libceph: Amend checking to fix `make W=1` build breakage
  ceph: Amend checking to fix `make W=1` build breakage
  ceph: add trace points to the MDS client
  libceph: fix log output race condition in OSD client
2025-12-14 15:24:10 +12:00
Linus Torvalds 9d9c1cfec0 There are no significant series in this small merge. Please see the
individual changelogs for details.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCaTsgBwAKCRDdBJ7gKXxA
 jkSIAP4jD66nEC2QyKTiv9XvXi8rpKz6RGAHNZSam0ucI5WKswEAoflmlqsoD/Kk
 sN3YLwLztzCJIYU7tT3IRaPK0irwDAo=
 =nkux
 -----END PGP SIGNATURE-----

Merge tag 'mm-nonmm-stable-2025-12-11-11-47' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc updates from Andrew Morton:
 "There are no significant series in this small merge. Please see the
  individual changelogs for details"

[ Editor's note: it's mainly ocfs2 and a couple of random fixes ]

* tag 'mm-nonmm-stable-2025-12-11-11-47' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  mm: memfd_luo: add CONFIG_SHMEM dependency
  mm: shmem: avoid build warning for CONFIG_SHMEM=n
  ocfs2: fix memory leak in ocfs2_merge_rec_left()
  ocfs2: invalidate inode if i_mode is zero after block read
  ocfs2: avoid -Wflex-array-member-not-at-end warning
  ocfs2: convert remaining read-only checks to ocfs2_emergency_state
  ocfs2: add ocfs2_emergency_state helper and apply to setattr
  checkpatch: add uninitialized pointer with __free attribute check
  args: fix documentation to reflect the correct numbers
  ocfs2: fix kernel BUG in ocfs2_find_victim_chain
  liveupdate: luo_core: fix redundant bound check in luo_ioctl()
  ocfs2: validate inline xattr size and entry count in ocfs2_xattr_ibody_list
  fs/fat: remove unnecessary wrapper fat_max_cache()
  ocfs2: replace deprecated strcpy with strscpy
  ocfs2: check tl_used after reading it from trancate log inode
  liveupdate: luo_file: don't use invalid list iterator
2025-12-13 20:55:12 +12:00
Linus Torvalds ce825345dd Three ksmbd server fixes
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmk7qq0ACgkQiiy9cAdy
 T1FBYQwAsagM3pGOhSum710iGgeFAcV/UDKV7rcY3wVRvLmVTuNA4RdTeLkxMrkQ
 LW3k7xlDwveV1qmzPvbprIlOVGawWRexXpiIMqShCDH48yPrLWL4W59AlXDAudUC
 Cn6zMMLHaOg9mcOw3gzraEUFfn0WvcvdhExOLfP9nJGd1ppzqMoOUhIeqy2fOD7R
 uBaO4tBAC2400egegqnijcc+4RWMtSUi1PL3KCSjrL2wJCEFGi5RPvVc2r+3i4We
 7tJJ2jozExTZQBkRqF1qlLGbq8C2G6xWYfZ6x41zaKAjP065zpKuoGpdhPzAZfH+
 Qek2sh5b5Ofx/zZvlhrpKZ5G01LR522g4kZcIG7+qrGDDZsnWjjAnQJlfWO/ZFa4
 j9li9AsIa58qNoMD3q3OY7vaDy21x0TFwcIpXAZ9Vj9Q+/A534+kAigtx90DEbvK
 d4muR0PvUAAS2YgDVn1I9Wpeil+jqMrLoj45mKmX8qCOpbXhZI49KjYX6jZohhWh
 E6WAOCN4
 =Nxpo
 -----END PGP SIGNATURE-----

Merge tag 'v6.19-rc-smb3-server-fixes' of git://git.samba.org/ksmbd

Pull smb server fixes from Steve French:

 - minor cleanup

 - minor update to comment to avoid confusion about fs type

* tag 'v6.19-rc-smb3-server-fixes' of git://git.samba.org/ksmbd:
  smb/server: add comment to FileSystemName of FileFsAttributeInformation
  smb/server: remove unused nterr.h
  smb/server: rename include guard in smb_common.h
2025-12-12 21:59:19 +12:00
Linus Torvalds 10cc3e9a11 12 smb3 client fixes
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmk7dYEACgkQiiy9cAdy
 T1FxRQwApjZCYV2NdvIfcrvHoZJ0xn6GTA4xqbLIC4ETVj7NoyperL2NaJxgA3GV
 b++DQhsPMOnj8JL3s33+j8O6TzUOmkrW/sZp9Mm23QYHDXS5KTwFkymrzv1Kd3iz
 XFAGwTy+ToDtWaC61dExXo/pdsNpK+sMaQ4re+RTs2RGpQbXhN3TPAEhDYD5O4Z9
 2PhogsDf3/Y4gJOqtW7KwAegudLG1aRbDdpQNOvrLFVrEDGo9WeQD70xDNnYrjZl
 /YOR3EFLWEhYFTy1v/Kj/RH8Hl56lzRnj31/IwZoGuPJQLFnD8heGjG0iCtZtCgf
 Dxnb6/35R45ITdx5wErb2f2pzGd8QCd5ei3HYM+sgQyyH2T2YcDamTVODDbxrk3U
 fruHVsHh3GqM//nx1Tmxlt6lKMTKVdQ3dAJ8WHnUpOLaSSbSco8IU2L2CLjbHT4j
 62N9MQQky3k7YtoDdDFLP8hDB6EBDVqINn0Q0Rc3Za57ucXZI7yBBdoBZN3dUUOS
 5HPzItdY
 =GQrC
 -----END PGP SIGNATURE-----

Merge tag 'v6.19-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:

 - Fix incorrect error code defines

 - Add missing error code definitions

 - Add parenthesis around NT_STATUS code defines to fix checkpatch
   warnings

 - Remove some duplicated protocol definitions, moving to common code
   shared by client and server

 - Add missing protocol documentation reference (for change notify)

 - Correct struct definition (for duplicate_extents_to_file_ex)

* tag 'v6.19-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  smb/client: remove DeviceType Flags and Device Characteristics definitions
  smb: move File Attributes definitions into common/fscc.h
  smb: update struct duplicate_extents_to_file_ex
  smb: move file_notify_information to common/fscc.h
  smb: move SMB2 Notify Action Flags into common/smb2pdu.h
  smb: move notify completion filter flags into common/smb2pdu.h
  smb/client: add parentheses to NT error code definitions containing bitwise OR operator
  smb: add documentation references for smb2 change notify definitions
  smb/client: add 4 NT error code definitions
  smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
  smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
  smb/client: fix NT_STATUS_NO_DATA_DETECTED value
2025-12-12 21:56:25 +12:00
Linus Torvalds 6bb34aff1e NFS client updates for Linux 6.19
Highlights include:
 
 Bugfixes:
 - Fix 'nlink' attribute update races when unlinking a file.
 - Add missing initialisers for the directory verifier in various places.
 - Don't regress the NFSv4 open state due to misordered racing replies.
 - Ensure the NFSv4.x callback server uses the correct transport
   connection.
 - Fix potential use-after-free races when shutting down the NFSv4.x
   callback server.
 - Fix a pNFS layout commit crash.
 - Assorted fixes to ensure correct propagation of mount options when the
   client crosses a filesystem boundary and triggers the VFS automount
   code.
 - More localio fixes.
 
 Features and cleanups:
 - Add initial support for basic directory delegations.
 - SunRPC back channel code cleanups.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQR8xgHcVzJNfOYElJo6EXfx2a6V0QUCaTrPnQAKCRA6EXfx2a6V
 0aLQAPwOs+bfoaPuk/EsC87m3rAtFJNPMg65toJY/6JnXnTGXgEAs1XlCcSCgc10
 bsX+D6QIudOoWExwFfLlVlFAFikGKQc=
 =DoZq
 -----END PGP SIGNATURE-----

Merge tag 'nfs-for-6.19-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client updates from Trond Myklebust:
 "Bugfixes:
   - Fix 'nlink' attribute update races when unlinking a file
   - Add missing initialisers for the directory verifier in various
     places
   - Don't regress the NFSv4 open state due to misordered racing replies
   - Ensure the NFSv4.x callback server uses the correct transport
     connection
   - Fix potential use-after-free races when shutting down the NFSv4.x
     callback server
   - Fix a pNFS layout commit crash
   - Assorted fixes to ensure correct propagation of mount options when
     the client crosses a filesystem boundary and triggers the VFS
     automount code
   - More localio fixes

  Features and cleanups:
   - Add initial support for basic directory delegations
   - SunRPC back channel code cleanups"

* tag 'nfs-for-6.19-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (24 commits)
  NFSv4: Handle NFS4ERR_NOTSUPP errors for directory delegations
  nfs/localio: remove 61 byte hole from needless ____cacheline_aligned
  nfs/localio: remove alignment size checking in nfs_is_local_dio_possible
  NFS: Fix up the automount fs_context to use the correct cred
  NFS: Fix inheritance of the block sizes when automounting
  NFS: Automounted filesystems should inherit ro,noexec,nodev,sync flags
  Revert "nfs: ignore SB_RDONLY when mounting nfs"
  Revert "nfs: clear SB_RDONLY before getting superblock"
  Revert "nfs: ignore SB_RDONLY when remounting nfs"
  NFS: Add a module option to disable directory delegations
  NFS: Shortcut lookup revalidations if we have a directory delegation
  NFS: Request a directory delegation during RENAME
  NFS: Request a directory delegation on ACCESS, CREATE, and UNLINK
  NFS: Add support for sending GDD_GETATTR
  NFSv4/pNFS: Clear NFS_INO_LAYOUTCOMMIT in pnfs_mark_layout_stateid_invalid
  NFSv4.1: protect destroying and nullifying bc_serv structure
  SUNRPC: new helper function for stopping backchannel server
  SUNRPC: cleanup common code in backchannel request
  NFSv4.1: pass transport for callback shutdown
  NFSv4: ensure the open stateid seqid doesn't go backwards
  ...
2025-12-12 21:52:42 +12:00
ZhangGuoDong ab0347e67d smb/client: remove DeviceType Flags and Device Characteristics definitions
These definitions are already in common/smb2pdu.h, so remove the duplicated
ones from the client.

Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-11 00:53:07 -06:00
ChenXiaoSong 2b6abb893e smb: move File Attributes definitions into common/fscc.h
These definitions are specified in MS-FSCC 2.6, so move them into fscc.h.

Modify the following places:

  - FILE_ATTRIBUTE__MASK -> FILE_ATTRIBUTE_MASK
  - Update FILE_ATTRIBUTE_MASK value
  - cpu_to_le32(constant) -> cpu_to_le32(MACRO DEFINITION)

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-11 00:53:03 -06:00
ChenXiaoSong c97503321e smb: update struct duplicate_extents_to_file_ex
Add the missing field to the structure (see MS-FSCC 2.3.9.2), and correct
the section number in the documentation reference.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-11 00:52:54 -06:00
Dmitry Antipov 2214ec4bf8 ocfs2: fix memory leak in ocfs2_merge_rec_left()
In 'ocfs2_merge_rec_left()', do not reset 'left_path' to NULL after
move, thus allowing 'ocfs2_free_path()' to free it before return.

Link: https://lkml.kernel.org/r/20251205065159.392749-1-dmantipov@yandex.ru
Fixes: 677b975282 ("ocfs2: Add support for cross extent block")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reported-by: syzbot+cfc7cab3bb6eaa7c4de2@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=cfc7cab3bb6eaa7c4de2
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:43 -08:00
Ahmet Eray Karadag 7efb45f968 ocfs2: invalidate inode if i_mode is zero after block read
A panic occurs in ocfs2_unlink due to WARN_ON(inode->i_nlink == 0) when
handling a corrupted inode with i_mode=0 and i_nlink=0 in memory.

This "zombie" inode is created because ocfs2_read_locked_inode proceeds
even after ocfs2_validate_inode_block successfully validates a block that
structurally looks okay (passes checksum, signature etc.) but contains
semantically invalid data (specifically i_mode=0).  The current validation
function doesn't check for i_mode being zero.

This results in an in-memory inode with i_mode=0 being added to the VFS
cache, which later triggers the panic during unlink.

Prevent this by adding an explicit check for (i_mode == 0, i_nlink == 0,
non-orphan) within ocfs2_validate_inode_block.  If the check is true,
return -EFSCORRUPTED to signal corruption.  This causes the caller
(ocfs2_read_locked_inode) to invoke make_bad_inode(), correctly preventing
the zombie inode from entering the cache.

Link: https://lkml.kernel.org/r/20251202224507.53452-2-eraykrdg1@gmail.com
Co-developed-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Signed-off-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Signed-off-by: Ahmet Eray Karadag <eraykrdg1@gmail.com>
Reported-by: syzbot+55c40ae8a0e5f3659f2b@syzkaller.appspotmail.com
Fixes: https://syzkaller.appspot.com/bug?extid=55c40ae8a0e5f3659f2b
Link: https://lore.kernel.org/all/20251022222752.46758-2-eraykrdg1@gmail.com/T/
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: David Hunter <david.hunter.linux@gmail.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:43 -08:00
Gustavo A. R. Silva 76b9701a54 ocfs2: avoid -Wflex-array-member-not-at-end warning
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Use the new TRAILING_OVERLAP() helper to fix the following warning:

fs/ocfs2/xattr.c:52:41: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

This helper creates a union between a flexible-array member (FAM) and a
set of MEMBERS that would otherwise follow it.

This overlays the trailing MEMBER struct ocfs2_extent_rec er; onto the FAM
struct ocfs2_xattr_value_root::xr_list.l_recs[], while keeping the FAM and
the start of MEMBER aligned.

The static_assert() ensures this alignment remains, and it's intentionally
placed inmediately after the related structure --no blank line in between.

Link: https://lkml.kernel.org/r/aRKm_7aN7Smc3J5L@kspp
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:43 -08:00
Ahmet Eray Karadag 7eff54dfd2 ocfs2: convert remaining read-only checks to ocfs2_emergency_state
Now that the centralized `ocfs2_emergency_state()` helper is available,
refactor remaining filesystem-wide checks for `ocfs2_is_soft_readonly` and
`ocfs2_is_hard_readonly` to use this new function.

To ensure strict consistency with the previous behavior and guarantee no
functional changes, the call sites continue to explicitly return -EROFS
when the emergency state is detected.  This standardizes the check logic
while preserving the existing error handling flow.

Link: https://lkml.kernel.org/r/3421641b54ad6b6e4ffca052351b518eacc1bd08.1764728893.git.eraykrdg1@gmail.com
Co-developed-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Signed-off-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Signed-off-by: Ahmet Eray Karadag <eraykrdg1@gmail.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: David Hunter <david.hunter.linux@gmail.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:43 -08:00
Ahmet Eray Karadag 752ba0976b ocfs2: add ocfs2_emergency_state helper and apply to setattr
Patch series "ocfs2: Refactor read-only checks to use
ocfs2_emergency_state", v4.

Following the fix for the `make_bad_inode` validation failure (syzbot ID:
b93b65ee321c97861072), this separate series introduces a new helper
function, `ocfs2_emergency_state()`, to improve and centralize read-only
and error state checking.

This is modeled after the `ext4_emergency_state()` pattern, providing a
single, unified location for checking all filesystem-level emergency
conditions.  This makes the code cleaner and ensures that any future
checks (e.g., for fatal error states) can be added in one place.

This series is structured as follows:

1.  The first patch introduces the `ocfs2_emergency_state()` helper
    (currently checking for -EROFS) and applies it to `ocfs2_setattr`
    to provide a "fail-fast" mechanism, as suggested by Albin
    Babu Varghese.
2.  The second patch completes the refactoring by converting all
    remaining read-only checks throughout OCFS2 to use this new helper.


This patch (of 2):

To centralize error checking, follow the pattern of other filesystems like
ext4 (which uses `ext4_emergency_state()`), and prepare for future
enhancements, this patch introduces a new helper function:
`ocfs2_emergency_state()`.

The purpose of this helper is to provide a single, unified location for
checking all filesystem-level emergency conditions.  In this initial
implementation, the function only checks for the existing hard and soft
read-only modes, returning -EROFS if either is set.

This provides a foundation where future checks (e.g., for fatal error
states returning -EIO, or shutdown states) can be easily added in one
place.

This patch also adds this new check to the beginning of `ocfs2_setattr()`.
This ensures that operations like `ftruncate` (which triggered the
original BUG) fail-fast with -EROFS when the filesystem is already in a
read-only state.

Link: https://lkml.kernel.org/r/cover.1764728893.git.eraykrdg1@gmail.com
Link: https://lkml.kernel.org/r/e9e975bcaaff8dbc155b70fbc1b2798a2e36e96f.1764728893.git.eraykrdg1@gmail.com
Co-developed-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Signed-off-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Signed-off-by: Ahmet Eray Karadag <eraykrdg1@gmail.com>
Suggested-by: Heming Zhao <heming.zhao@suse.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: David Hunter <david.hunter.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:43 -08:00
Prithvi Tambewagh 039bef30e3 ocfs2: fix kernel BUG in ocfs2_find_victim_chain
syzbot reported a kernel BUG in ocfs2_find_victim_chain() because the
`cl_next_free_rec` field of the allocation chain list (next free slot in
the chain list) is 0, triggring the BUG_ON(!cl->cl_next_free_rec)
condition in ocfs2_find_victim_chain() and panicking the kernel.

To fix this, an if condition is introduced in ocfs2_claim_suballoc_bits(),
just before calling ocfs2_find_victim_chain(), the code block in it being
executed when either of the following conditions is true:

1. `cl_next_free_rec` is equal to 0, indicating that there are no free
chains in the allocation chain list
2. `cl_next_free_rec` is greater than `cl_count` (the total number of
chains in the allocation chain list)

Either of them being true is indicative of the fact that there are no
chains left for usage.

This is addressed using ocfs2_error(), which prints
the error log for debugging purposes, rather than panicking the kernel.

Link: https://lkml.kernel.org/r/20251201130711.143900-1-activprithvi@gmail.com
Signed-off-by: Prithvi Tambewagh <activprithvi@gmail.com>
Reported-by: syzbot+96d38c6e1655c1420a72@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=96d38c6e1655c1420a72
Tested-by: syzbot+96d38c6e1655c1420a72@syzkaller.appspotmail.com
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:42 -08:00
Deepanshu Kartikey 2a4f33430e ocfs2: validate inline xattr size and entry count in ocfs2_xattr_ibody_list
Add comprehensive validation of inline xattr metadata in
ocfs2_xattr_ibody_list() to prevent out-of-bounds access and
use-after-free bugs when processing corrupted inline xattrs.

The patch adds two critical validations:

1. Validates i_xattr_inline_size before use:
   - Ensures it does not exceed block size
   - Ensures it is at least large enough for xattr header
   - Prevents pointer arithmetic with corrupted size values that could
     point outside the inode block

2. Validates xattr entry count (xh_count):
   - Calculates maximum entries that can fit in the inline space
   - Rejects counts that exceed this limit
   - Prevents out-of-bounds array access in subsequent code

Without these checks, a corrupted filesystem with invalid inline xattr
metadata can cause the code to access memory beyond the allocated space.
For example:
- A corrupted i_xattr_inline_size of 0 would cause header pointer
  calculation to point past the end of the block
- A corrupted xh_count of 22 with inline_size of 256 would cause
  array access 7 entries beyond the 15 that actually fit (the syzbot
  reproducer used xh_count of 20041), leading to use-after-free when
  accessing freed memory pages

The validation uses the correct inline_size (from di->i_xattr_inline_size)
rather than block size, ensuring accurate bounds checking for inline
xattrs specifically.

Link: https://lkml.kernel.org/r/20251120041145.33176-1-kartikey406@gmail.com
Link: https://lore.kernel.org/all/20251111073831.2027072-1-kartikey406@gmail.com/ [v1]
Link: https://lore.kernel.org/all/20251117063217.5690-1-kartikey406@gmail.com/ [v2]
Link: https://lore.kernel.org/all/20251117114224.12948-1-kartikey406@gmail.com/ [v3]
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Reported-by: syzbot+ab0ad25088673470d2d9@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ab0ad25088673470d2d9
Tested-by: syzbot+ab0ad25088673470d2d9@syzkaller.appspotmail.com
Suggested-by: Heming Zhao <heming.zhao@suse.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:42 -08:00
Lalit Shankar Chowdhury acce46aaf8 fs/fat: remove unnecessary wrapper fat_max_cache()
fat_max_cache() always returned FAT_MAX_CACHE and did not use the inode
parameter. So, use the FAT_MAX_CACHE constant directly.

Link: https://lkml.kernel.org/r/20251127175431.126516-1-lalitshankarch@gmail.com
Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:42 -08:00
Thorsten Blum d86fea4294 ocfs2: replace deprecated strcpy with strscpy
strcpy() has been deprecated [1] because it performs no bounds checking on
the destination buffer, which can lead to buffer overflows.  Replace it
with the safer strscpy().  No functional changes.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
Link: https://lkml.kernel.org/r/20251126114419.92539-1-thorsten.blum@linux.dev
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:42 -08:00
Edward Adam Davis 4ac577ae74 ocfs2: check tl_used after reading it from trancate log inode
The fuzz image has a truncate log inode whose tl_used is bigger than
tl_count so it triggers the BUG in ocfs2_truncate_log_needs_flush() [1].

As what the check in ocfs2_truncate_log_needs_flush() does, just do same
check into ocfs2_get_truncate_log_info() when truncate log inode is
reading in so we can bail out earlier.

[1]
(syz.0.17,5491,0):ocfs2_truncate_log_needs_flush:5830 ERROR: bug expression: le16_to_cpu(tl->tl_used) > le16_to_cpu(tl->tl_count)
kernel BUG at fs/ocfs2/alloc.c:5830!
RIP: 0010:ocfs2_truncate_log_needs_flush fs/ocfs2/alloc.c:5827 [inline]
Call Trace:
 ocfs2_commit_truncate+0xb64/0x21d0 fs/ocfs2/alloc.c:7372
 ocfs2_truncate_file+0xca2/0x1420 fs/ocfs2/file.c:509
 ocfs2_setattr+0x1520/0x1b40 fs/ocfs2/file.c:1212
 notify_change+0xc1a/0xf40 fs/attr.c:546
 do_truncate+0x1a4/0x220 fs/open.c:68

Link: https://lkml.kernel.org/r/tencent_B24B1C1BE225DCBA44BB6933AB9E1B1B0708@qq.com
Reported-by: syzbot+f82afc4d4e74d0ef7a89@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f82afc4d4e74d0ef7a89
Tested-by: syzbot+f82afc4d4e74d0ef7a89@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-12-10 16:07:41 -08:00
Eric Biggers 3680fc138e ceph: stop selecting CRC32, CRYPTO, and CRYPTO_AES
None of the CEPH_FS code directly requires CRC32, CRYPTO, or CRYPTO_AES.
These options do get selected indirectly anyway via CEPH_LIB, which does
need them, but there is no need for CEPH_FS to select them too.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2025-12-10 11:50:54 +01:00
Andy Shevchenko 87327d4eaa ceph: Amend checking to fix `make W=1` build breakage
In a few cases the code compares 32-bit value to a SIZE_MAX derived
constant which is much higher than that value on 64-bit platforms,
Clang, in particular, is not happy about this

fs/ceph/snap.c:377:10: error: result of comparison of constant 2305843009213693948 with expression of type 'u32' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
  377 |         if (num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64))
      |             ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by casting to size_t. Note, that possible replacement of SIZE_MAX
by U32_MAX may lead to the behaviour changes on the corner cases.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2025-12-10 11:50:54 +01:00
Max Kellermann d927a595ab ceph: add trace points to the MDS client
This patch adds trace points to the Ceph filesystem MDS client:

- request submission (CEPH_MSG_CLIENT_REQUEST) and completion
  (CEPH_MSG_CLIENT_REPLY)
- capabilities (CEPH_MSG_CLIENT_CAPS)

These are the central pieces that are useful for analyzing MDS
latency/performance problems from the client's perspective.

In the long run, all doutc() calls should be replaced with
tracepoints.  This way, the Ceph filesystem can be traced at any time
(without spamming the kernel log).  Additionally, trace points can be
used in BPF programs (which can even deference the pointer parameters
and extract more values).

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2025-12-10 11:50:54 +01:00
ChenXiaoSong 08c2a7d2ba smb: move file_notify_information to common/fscc.h
This struct definition is specified in MS-FSCC, and KSMBD will also use it,
so move it into common header file.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:23:03 -06:00
ChenXiaoSong 6539e18517 smb: move SMB2 Notify Action Flags into common/smb2pdu.h
Some of these definitions are already in common/smb2pdu.h. Remove the
duplicate client side definitions, and add all SMB2 Notify Action Flags to
common header file.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:22:58 -06:00
ChenXiaoSong 9ec7629b43 smb: move notify completion filter flags into common/smb2pdu.h
Some of these definitions are already in common/smb2pdu.h, remove the
duplicate client side definitions, and move FILE_NOTIFY_CHANGE_NAME to
common header file.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:22:54 -06:00
ChenXiaoSong a71a4aab48 smb/client: add parentheses to NT error code definitions containing bitwise OR operator
Use the following shell commands:

  # Add "("
  sed -i '/|/s/ 0x/ (0x/' fs/smb/client/nterr.h
  # Add ")" if line does not end with a comment
  sed -i '/|/ { /.*\*\/$/! s/$/)/ }' fs/smb/client/nterr.h
  # Add ")" if line end with a comment
  sed -i '/|/ s/[[:space:]]*\/\*/)&/' fs/smb/client/nterr.h

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:22:34 -06:00
ChenXiaoSong bcdd6cfaf2 smb: add documentation references for smb2 change notify definitions
To make it easier to locate the documentation during development.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:22:01 -06:00
ChenXiaoSong a9adafd401 smb/client: add 4 NT error code definitions
From server/nterr.h that has been removed.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:21:42 -06:00
ChenXiaoSong 9f99caa895 smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
This was reported by the KUnit tests in the later patches.

See MS-ERREF 2.3.1 STATUS_UNABLE_TO_FREE_VM. Keep it consistent with the
value in the documentation.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:20:17 -06:00
ChenXiaoSong b2b50fca34 smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
This was reported by the KUnit tests in the later patches.

See MS-ERREF 2.3.1 STATUS_DEVICE_DOOR_OPEN. Keep it consistent with the
value in the documentation.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:20:01 -06:00
ChenXiaoSong a1237c203f smb/client: fix NT_STATUS_NO_DATA_DETECTED value
This was reported by the KUnit tests in the later patches.

See MS-ERREF 2.3.1 STATUS_NO_DATA_DETECTED. Keep it consistent with the
value in the documentation.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:19:43 -06:00
ChenXiaoSong 2e0d224d89 smb/server: add comment to FileSystemName of FileFsAttributeInformation
Explained why FileSystemName is always set to "NTFS".

Link: 84392651b0
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:01:36 -06:00
ChenXiaoSong 98def4eb02 smb/server: remove unused nterr.h
KSMBD does not use these NT error code definitions. Instead, it uses the
SMB2 status code definitions defined in common/smb2status.h.

By the way, server/nterr.h contains the following additional definitions
compared to client/nterr.h:

  - NT_STATUS_PENDING
  - NT_STATUS_INVALID_LOCK_RANGE
  - NT_STATUS_NETWORK_SESSION_EXPIRED
  - NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP

We can add them to client/nterr.h in the next patch.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:01:16 -06:00
ChenXiaoSong 01ab0d1640 smb/server: rename include guard in smb_common.h
Make the include guard more descriptive to avoid conflicts with include
guards that may be used in the future.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-09 21:00:48 -06:00
Linus Torvalds 9d588a1140 platform-drivers-x86 for v6.19-1
Highlights:
 
 - acer-wmi: Add PH16-72, PHN16-72, and PT14-51 fan control support
 
 - acpi: platform_profile: Add max-power profile option (power draw limited
                           by the cooling hardware, may exceed battery power
 			  draw limit when on AC power)
 
 - amd/hsmp: Allow >1 data-fabric per socket
 
 - asus-armoury: Add WMI attributes driver to expose miscellaneous
                 WMI functions through fw_attributes (deprecates
                 the custom BIOS features interface through asus-wmi)
 
 - asus-wmi: Use brightness_set_blocking() for kbd led
 
 - ayaneo-ec: Add Ayaneo Embedded Controller driver
 
 - fs/nls:
 
   - Fix utf16 -> utf8 string conversion in output size restricted cases
 
   - Improve error code consistency for utf8 -> utf32 conversions
 
 - ideapad-laptop: Fast (Rapid Charge) charge type support
 
 - intel/hid: Add Dell Pro Rugged 10/12 tablet to VGBS DMI quirks
 
 - intel/pmc:
 
   - Arrow Lake telemetry GUID improvements
 
   - Add support for Wildcat Lake PMC information
 
 - intel_pmc_ipc: Fix ACPI buffer memleak
 
 - intel/punit_ipc: Fix memory corruption
 
 - intel/vsec: Wildcat Lake PMT telemetry support
 
 - lenovo-wmi-gamezone: Map "Extreme" performance mode to max-power
 
 - lg-laptop: Add support for the HDAP opregion field
 
 - serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing projects
 
 - thinkpad-t14s-ec: Improve suspend/resume support (lid LEDs, keyboard
                     backlight)
 
 - uniwill: Add Uniwill laptop driver
 
 - wmi: Move under drivers/platform/wmi as non-x86 WMI support is around
        the corner and other WMI features will require adding more C
        files as well
 
 - tools/power/x86/intel-speed-select: v1.24
 
   - Check feature status to check if the feature enablement was successful
 
   - Reset SST-TF bucket structure to display valid bucket info
 
 - Miscellaneous cleanups / refactoring / improvements
 
 The following is an automated shortlog grouped by driver:
 
 acer-wmi:
  -  Add fan control support
  -  Add support for PHN16-72
  -  Enable fan control for PH16-72 and PT14-51
  -  Fix setting of fan behavior
 
 acpi:
  -  platform_profile - Add max-power profile option
 
 Add Uniwill laptop driver:
  - Add Uniwill laptop driver
 
 alienware-wmi-wmax:
  -  Simplify FW profile to pprof matching
 
 amd: hfi:
  -  Remove redundant assignment to .owner
  -  Remove unused cpumask from cpuinfo struct
 
 amd/hsmp:
  -  Replace amd_num_nodes() with topology_max_packages()
 
 amd/pmf:
  -  Add BIOS_INPUTS_MAX macro to replace hardcoded array size
  -  Refactor repetitive BIOS output handling
  -  Rename IPU metrics fields to NPU for consistency
  -  Replace magic table id with METRICS_TABLE_ID
  -  Use devm_mutex_init() for mutex initialization
  -  Use explicit SET_CMD/GET_CMD flags in amd_pmf_send_cmd()
 
 arm64: thinkpad-t14s-ec:
  -  add suspend handler for keyboard backlight
  -  add system PM hooks
 
 asus-armoury:
  -  add apu-mem control support
  -  add panel_hd_mode attribute
  -  add ppt_* and nv_* tuning knobs
  -  add screen auto-brightness toggle
  -  add support for FA507UV
  -  add support for GA503QR
  -  Fix error code in mini_led_mode_current_value_store()
  -  fix mini-led mode show
  -  fix only DC tunables being available
  -  move existing tunings to asus-armoury module
 
 asus-wmi:
  -  deprecate bios features
  -  export symbols used for read/write WMI
  -  rename ASUS_WMI_DEVID_PPT_FPPT
  -  use brightness_set_blocking() for kbd led
 
 ayaneo-ec:
  -  Add Ayaneo Embedded Controller platform driver
  -  Add charge control support
  -  Add controller power and modules attributes
  -  Add hwmon support
  -  Add suspend hook
  -  Move Ayaneo devices from oxpec to ayaneo-ec
 
 Documentation: laptops:
  -  Add documentation for uniwill laptops
 
 fs/nls:
  -  Fix inconsistency between utf8_to_utf32() and utf32_to_utf8()
  -  Fix utf16 to utf8 conversion
 
 hp-wmi:
  -  Order DMI board name arrays
 
 ideapad-laptop: Add charge_types:
  - Fast (Rapid Charge)
 
 ideapad-laptop:
  -  Protect GBMD/SBMC calls with mutex
  -  Support multiple power_supply_ext definitions
  -  Use str_on_off() helper
 
 intel/hid:
  -  Add Dell Pro Rugged 10/12 tablet to VGBS DMI quirks
 
 intel/pmc:
  -  Add DMU GUID to Arrow Lake U/H
  -  Add support for multiple DMU GUIDs
  -  Enable SSRAM support for Wildcat Lake
 
 intel_pmc_ipc:
  -  fix ACPI buffer memory leak
 
 intel/pmc:
  -  Relocate lpm_req_guid to pmc_reg_map
  -  Remove redundant has_die_c6 variable
  -  Rename PMC index variable to pmc_idx
  -  Update Arrow Lake telemetry GUID
 
 intel/vsec:
  -  Add support for Wildcat Lake
 
 lenovo-wmi-gamezone Use max-power rather than balanced-performance:
  - lenovo-wmi-gamezone Use max-power rather than balanced-performance
 
 lg-laptop:
  -  Add support for the HDAP opregion field
 
 serial-multi-instantiate:
  -  Add IRQ_RESOURCE_OPT for IRQ missing projects
 
 surface: acpi-notify:
  -  add WQ_PERCPU to alloc_workqueue users
 
 surface: aggregator:
  -  Omit a variable reassignment in ssam_serial_hub_probe()
 
 surface:
  -  replace use of system_wq with system_percpu_wq
 
 tools/power/x86/intel-speed-select:
  -  Check feature status
  -  Reset isst_turbo_freq_info for invalid buckets
  -  v1.24 release
 
 uniwill:
  -  Add TUXEDO devices
  -  Handle more WMI events required for TUXEDO devices
 
 wmi-gamezone:
  -  Add Legion Go 2 Quirks
 
 wmi:
  -  Move WMI core code into a separate directory
  -  Remove extern keyword from prototypes
  -  Use correct type when populating ACPI objects
 
 x86-android-tablets:
  -  Omit a variable reassignment in lenovo_yoga_tab2_830_1050_init_codec()
 
 x86:
  -  replace use of system_wq with system_percpu_wq
 
 Merges:
  -  Merge branch 'fixes' of into for-next
  -  Merge branch 'intel-sst' of https://github.com/spandruvada/linux-kernel into for-next
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCaTgl5wAKCRBZrE9hU+XO
 McWDAP4nmj5+EeHsg3Kl0kQ1lqF9llWI4EM2NeRd6MwrV5klxgD9FLW6djGkmP2j
 RjtZ4CULbtQ3QMl7kmXhfAjRwJfiSgk=
 =yFvQ
 -----END PGP SIGNATURE-----

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

Pull x86 platform driver updates from Ilpo Järvinen:

 - acer-wmi: Add PH16-72, PHN16-72, and PT14-51 fan control support

 - acpi: platform_profile: Add max-power profile option (power draw
   limited by the cooling hardware, may exceed battery power draw limit
   when on AC power)

 - amd/hsmp: Allow more than one data-fabric per socket

 - asus-armoury: Add WMI attributes driver to expose miscellaneous WMI
   functions through fw_attributes (deprecates the custom BIOS features
   interface through asus-wmi)

 - asus-wmi: Use brightness_set_blocking() for kbd led

 - ayaneo-ec: Add Ayaneo Embedded Controller driver

 - fs/nls:
     - Fix utf16 to utf8 string conversion when output size restricted
     - Improve error code consistency for utf8 to utf32 conversions

 - ideapad-laptop: Fast (Rapid Charge) charge type support

 - intel/hid: Add Dell Pro Rugged 10/12 tablet to VGBS DMI quirks

 - intel/pmc:
     - Arrow Lake telemetry GUID improvements
     - Add support for Wildcat Lake PMC information

 - intel_pmc_ipc: Fix ACPI buffer memleak

 - intel/punit_ipc: Fix memory corruption

 - intel/vsec: Wildcat Lake PMT telemetry support

 - lenovo-wmi-gamezone: Map "Extreme" performance mode to max-power

 - lg-laptop: Add support for the HDAP opregion field

 - serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing
   projects

 - thinkpad-t14s-ec: Improve suspend/resume support (lid LEDs, keyboard
   backlight)

 - uniwill: Add Uniwill laptop driver

 - wmi: Move under drivers/platform/wmi as non-x86 WMI support is around
   the corner and other WMI features will require adding more C files as
   well

 - tools/power/x86/intel-speed-select: v1.24
     - Check feature status to check if the feature enablement was
       successful
     - Reset SST-TF bucket structure to display valid bucket info

 - Miscellaneous cleanups / refactoring / improvements

* tag 'platform-drivers-x86-v6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (73 commits)
  tools/power/x86/intel-speed-select: v1.24 release
  tools/power/x86/intel-speed-select: Reset isst_turbo_freq_info for invalid buckets
  tools/power/x86/intel-speed-select: Check feature status
  platform/x86: asus-wmi: use brightness_set_blocking() for kbd led
  fs/nls: Fix inconsistency between utf8_to_utf32() and utf32_to_utf8()
  platform/x86: asus-armoury: add support for GA503QR
  platform/x86: intel_pmc_ipc: fix ACPI buffer memory leak
  platform/x86: hp-wmi: Order DMI board name arrays
  platform/x86/intel/hid: Add Dell Pro Rugged 10/12 tablet to VGBS DMI quirks
  platform: surface: replace use of system_wq with system_percpu_wq
  platform: x86: replace use of system_wq with system_percpu_wq
  platform/surface: acpi-notify: add WQ_PERCPU to alloc_workqueue users
  platform/x86: wmi-gamezone: Add Legion Go 2 Quirks
  platform/x86: lenovo-wmi-gamezone Use max-power rather than balanced-performance
  acpi: platform_profile - Add max-power profile option
  platform/x86/amd/pmf: Use devm_mutex_init() for mutex initialization
  platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size
  platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing projects
  platform/x86/amd/pmf: Refactor repetitive BIOS output handling
  platform/x86/uniwill: Add TUXEDO devices
  ...
2025-12-10 06:38:17 +09:00
Linus Torvalds c752c21c90 Convert "__auto_type" to "auto", defining a macro for "auto"
unless C23+ is in use.
 
 ---
  arch/nios2/include/asm/uaccess.h                      |  8 ++++----
  arch/x86/include/asm/bug.h                            |  2 +-
  arch/x86/include/asm/string_64.h                      |  6 +++---
  arch/x86/include/asm/uaccess_64.h                     |  2 +-
  fs/proc/inode.c                                       | 19 +++++++++----------
  include/linux/cleanup.h                               |  6 +++---
  include/linux/compiler.h                              |  2 +-
  include/linux/compiler_types.h                        | 13 +++++++++++++
  include/linux/minmax.h                                |  6 +++---
  .../testing/selftests/bpf/prog_tests/socket_helpers.h |  9 +++++++--
  tools/virtio/linux/compiler.h                         |  2 +-
  11 files changed, 46 insertions(+), 29 deletions(-)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEbQEHvGnuWidP2bYMLbPDMhtt34YFAmk4grQACgkQLbPDMhtt
 34Z9zQ//VKM0xKkCGVPfRBbL33O+DIcDfZjk6jokAl47aKAwJxrSTfT+Hdnmwsnv
 i7gKwaioYxDjnZlsfCzDbwbHexPTMGjsjgRNmFK3uS1mv1AhTspV2Jjn9qiYzd5o
 N+Cvzv7eIr88ti1dKe+7MZBa9j37nsGKZDzT0M/GubBlzIgMzeCZ6xAxOOV/TmD9
 sP17oU65MhczegpXH/fcxyK7atkvlWskPfc+50YB5T3C96hqzT0LDiU/vBSHIJ8z
 EyqSRYlt2To17BdcKQEKYcklduFZwJ/02UWDT4RYJRGBSkn6ohPJJwYsjI5Cvl5m
 9yPRLLqW/LsA5O5CZ/mq/tM0xiDdm5dCTEEbiwk90Lg1XTVxmpbTbMjjN1MCAy+a
 HYjsq9nWkYl9xXVBHk7CqgAjITAV7Z4ZZN//JLrJleQsD794EP3vYBzEaa370deP
 L22lONVSjpPm6m+Rr1fjObRDFQxs4piobUavxIj2JKaF48G8mSA0uAOG0nBRQkR1
 jOTsMhqH33z9XNxb52BlFdaVkQGkHNlLeONc/ivGiDMKox5oCb/gveKOQ+PXYnLN
 IRTllLqke0fuOQrgLa5lu135J6ZbPHDOgH+P19OwNrBQnOMQqzTr7DnENVoanIy7
 ocVc6vS3OX4qhZ+7uVpHugbnSCWOoCzBgV4xcZrIdh4qpTKzM+g=
 =Cu2O
 -----END PGP SIGNATURE-----

Merge tag 'auto-type-conversion-for-v6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-auto

Pull __auto_type to auto conversion from Peter Anvin:
 "Convert '__auto_type' to 'auto', defining a macro for 'auto' unless
  C23+ is in use"

* tag 'auto-type-conversion-for-v6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-auto:
  tools/virtio: replace "__auto_type" with "auto"
  selftests/bpf: replace "__auto_type" with "auto"
  arch/x86: replace "__auto_type" with "auto"
  arch/nios2: replace "__auto_type" and adjacent equivalent with "auto"
  fs/proc: replace "__auto_type" with "const auto"
  include/linux: change "__auto_type" to "auto"
  compiler_types.h: add "auto" as a macro for "__auto_type"
2025-12-10 05:41:10 +09:00
Linus Torvalds 3d99347a2e 22 smb3 client fixes
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmk3lJoACgkQiiy9cAdy
 T1HZhAv+IreQpPeRVeq8hd8JYfsys75bo6Dc4eElyO4mLBirMS2wcfM54kCm1Uxr
 9dOt/q+nD6YI6L0IYRMwGSawWFqs76qpz5ZxZzg9xQ2AS3jWCPXK1cdtIOZFahJ0
 v14Pvo0tF8QmSxqKtTQ10FojWIS9Y9feqWvXW+BbVd2w1zk7iQ//9vnygfzu27o2
 DTWqkmEOirt08AUDuROr5vvhl6Ew4J6Dej6jd3C7GuZ5vB0o425vxk3gFE7dI2d1
 1h+YeyiLLmgAKyZ9QZAqLVXqgsBz1SflycR6UpW4gvNeTkDxI1MbXsIUz+f/xReJ
 SUM6t7gp3hO3XCtW+wYkDq4spIjspJVUNeM1YK0Ip4x5TRy5Jcoe0ikeh/DbET+N
 W7mijp+LLTrWG9B1hIXH+0fATuH5dolGmhADOrVqvHL4A8oIp16HyGEjg3dRpMZ+
 AsDyjICmv1qXQNX/lvEJtXAQOSyOoO6ouCuavNBXwJVTsSqDrcW5pmifSkF+ZAV8
 5PGQNI+2
 =PmvL
 -----END PGP SIGNATURE-----

Merge tag 'v6.19-rc-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client updates from Steve French:

 - multichannel fixes, including enabling ability to change multichannel
   settings with remount

 - debugging improvements: adding additional tracepoints, improving log
   messages

 - cleanup, including restructuring some of the transport layer for the
   client to make it clearer, and cleanup of status code table to be
   more consistent with protocol documentation

 - fixes for reads that start beyond end of file use cases

 - fix to backoff reconnects to reduce reconnect storms

 - locking improvement for getting mid entries

 - fixes for missing status code error mappings

 - performance improvement for status code to error mappings

* tag 'v6.19-rc-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: (22 commits)
  smb/client: update some SMB2 status strings
  cifs: Remove dead function prototypes
  smb/client: add two elements to smb2_error_map_table array
  smb: rename to STATUS_SMB_NO_PREAUTH_INTEGRITY_HASH_OVERLAP
  smb/client: remove unused elements from smb2_error_map_table array
  smb/client: reduce loop count in map_smb2_to_linux_error() by half
  smb: client: Add tracepoint for krb5 auth
  smb: client: improve error message when creating SMB session
  smb: client: relax session and tcon reconnect attempts
  cifs: Fix handling of a beyond-EOF DIO/unbuffered read over SMB2
  cifs: client: allow changing multichannel mount options on remount
  cifs: Do some preparation prior to organising the function declarations
  cifs: Add a tracepoint to log EIO errors
  cifs: Don't need state locking in smb2_get_mid_entry()
  cifs: Remove the server pointer from smb_message
  cifs: Fix specification of function pointers
  cifs: Replace SendReceiveBlockingLock() with SendReceive() plus flags
  cifs: Clean up some places where an extra kvec[] was required for rfc1002
  cifs: Make smb1's SendReceive() wrap cifs_send_recv()
  cifs: Remove the RFC1002 header from smb_hdr
  ...
2025-12-09 16:09:32 +09:00
Linus Torvalds cb015814f8 f2fs-for-6.19-rc1
This series focuses on minor clean-ups and performance optimizations across
 sysfs, documentation, debugfs, tracepoints, slab allocation, and GC.
 Furthermore, it resolves several corner-case bugs caught by xfstests, as
 well as issues related to 16KB page support and f2fs_enable_checkpoint.
 
 Enhancement:
  - wrap ASCII tables in literal blocks to fix LaTeX build
  - optimize trace_f2fs_write_checkpoint with enums
  - support to show curseg.next_blkoff in debugfs
  - add a sysfs entry to show max open zones
  - add fadvise tracepoint
  - use global inline_xattr_slab instead of per-sb slab cache
  - set default valid_thresh_ratio to 80 for zoned devices
  - maintain one time GC mode is enabled during whole zoned GC cycle
 
 Bug fix:
  - ensure node page reads complete before f2fs_put_super() finishes
  - fix to not account invalid blocks in get_left_section_blocks()
  - revert summary entry count from 2048 to 512 in 16kb block support
  - fix to detect recoverable inode during dryrun of find_fsync_dnodes()
  - fix age extent cache insertion skip on counter overflow
  - Add sanity checks before unlinking and loading inodes
  - ensure minimum trim granularity accounts for all devices
  - block cache/dio write during f2fs_enable_checkpoint()
  - fix to propagate error from f2fs_enable_checkpoint()
  - invalidate dentry cache on failed whiteout creation
  - fix to avoid updating compression context during writeback
  - fix to avoid updating zero-sized extent in extent cache
  - fix to avoid potential deadlock
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE00UqedjCtOrGVvQiQBSofoJIUNIFAmk3N1kACgkQQBSofoJI
 UNKfGw//Z7+0Oy0w/3k8UkJHvz6b3sDFzzCGlyBtYUaQaxp0eXxytB9T7GNE4g8z
 UA6nOA7VvHdFyu8YvJkMrf8vejorVnO9I86vlUZ/uZcOqKPWkjNxaHJvMYg0ZvkS
 uwiFo8rSL5FO0MSbnVhZScnolNuEINYi1sYd0fb2BzHB3P7cSwRrDGYuU53E3S8p
 3JsOa1EN0DrxlL7YTI8q8wmMcN1+/BK9YP4Sl3r8nBAYNAoP/JLMY40YkOTk3gKy
 ppJ32e++D9XxVTEaZUvktW/z9zLKdSvqjFE0BduSbNrqlfGj2AEwU1WJouFPYDOs
 b4mDhi9y3Mv2LWY6fTeOXcT/nTf6IssopHNBpPI6Ay73GwENPOYf+q4oTNeqpa1f
 sGqmw6M8NGiEjQAPKrbON8IDSpdc6Yzk1ENRjOf5j7/xR0gtL1b3G0KV5FCO+25x
 QP9KupkhBc9yheCTrig6reCQlvfWU+I70tyB30YD/BcqhCB/EjBvM/v9kK1udN0e
 6wjr5eBfX8z8DGlqNYzAjjEQC8IfkwDc1qLkovTsBKBo2Z0fHPriAZERAcLU7TuU
 z06GZQT6QdZ4lAw4KfNWcef0S3m14qY5E8qJoQS2G7DwdMOglouJRakOi75nW1Dc
 lSZBI1m1JxwLsj7iXNXLEJoGMUR5u+oUzJyj46trn6fOG6AIbuo=
 =4ZOp
 -----END PGP SIGNATURE-----

Merge tag 'f2fs-for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs

Pull f2fs updates from Jaegeuk Kim:
 "This series focuses on minor clean-ups and performance optimizations
  across sysfs, documentation, debugfs, tracepoints, slab allocation,
  and GC. Furthermore, it resolves several corner-case bugs caught by
  xfstests, as well as issues related to 16KB page support and
  f2fs_enable_checkpoint.

  Enhancement:
   - wrap ASCII tables in literal blocks to fix LaTeX build
   - optimize trace_f2fs_write_checkpoint with enums
   - support to show curseg.next_blkoff in debugfs
   - add a sysfs entry to show max open zones
   - add fadvise tracepoint
   - use global inline_xattr_slab instead of per-sb slab cache
   - set default valid_thresh_ratio to 80 for zoned devices
   - maintain one time GC mode is enabled during whole zoned GC cycle

  Bug fix:
   - ensure node page reads complete before f2fs_put_super() finishes
   - do not account invalid blocks in get_left_section_blocks()
   - revert summary entry count from 2048 to 512 in 16kb block support
   - detect recoverable inode during dryrun of find_fsync_dnodes()
   - fix age extent cache insertion skip on counter overflow
   - add sanity checks before unlinking and loading inodes
   - ensure minimum trim granularity accounts for all devices
   - block cache/dio write during f2fs_enable_checkpoint()
   - propagate error from f2fs_enable_checkpoint()
   - invalidate dentry cache on failed whiteout creation
   - avoid updating compression context during writeback
   - avoid updating zero-sized extent in extent cache
   - avoid potential deadlock"

* tag 'f2fs-for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (39 commits)
  f2fs: ignore discard return value
  f2fs: optimize trace_f2fs_write_checkpoint with enums
  f2fs: fix to not account invalid blocks in get_left_section_blocks()
  f2fs: support to show curseg.next_blkoff in debugfs
  docs: f2fs: wrap ASCII tables in literal blocks to fix LaTeX build
  f2fs: expand scalability of f2fs mount option
  f2fs: change default schedule timeout value
  f2fs: introduce f2fs_schedule_timeout()
  f2fs: use memalloc_retry_wait() as much as possible
  f2fs: add a sysfs entry to show max open zones
  f2fs: wrap all unusable_blocks_per_sec code in CONFIG_BLK_DEV_ZONED
  f2fs: simplify list initialization in f2fs_recover_fsync_data()
  f2fs: revert summary entry count from 2048 to 512 in 16kb block support
  f2fs: fix to detect recoverable inode during dryrun of find_fsync_dnodes()
  f2fs: fix return value of f2fs_recover_fsync_data()
  f2fs: add fadvise tracepoint
  f2fs: fix age extent cache insertion skip on counter overflow
  f2fs: Add sanity checks before unlinking and loading inodes
  f2fs: Rename f2fs_unlink exit label
  f2fs: ensure minimum trim granularity accounts for all devices
  ...
2025-12-09 12:06:20 +09:00
Linus Torvalds 70e3083ec6 This pull request contains the following changes for UBI and UBIFS:
UBIFS:
 	- Misc code cleanups such as removal of unnecessary variables
 
 UBI:
 	- No longer program unused bit in UBI headers
 -----BEGIN PGP SIGNATURE-----
 
 iQJmBAABCABQFiEEdgfidid8lnn52cLTZvlZhesYu8EFAmkz9QIbFIAAAAAABAAO
 bWFudTIsMi41KzEuMTEsMiwyFhxyaWNoYXJkQHNpZ21hLXN0YXIuYXQACgkQZvlZ
 hesYu8HQIQ//YKQkpUYoMFhPARL4TArC5d0TK7MneiEj4DfrW+tELxIMc2Sy3i6L
 Ltd7np9dWrcPSbsdfw4erFARoYoXQfLql/qhc9UlnlUtPyGhFHu6MgSd4o4XPYeL
 4oMS39rzZBJU+Vl6Hp/uo1uv5wjHG4qEHouNaVHbs5aM9+gEOisyVq2MswSm10Ja
 cjkJN1iwtrGnzxCloD/RbIOFx/Y1BGhzNnJpudu+i7PY2LVoUhCPex9QKRuGOpIY
 DDt7OwfxFhitGs24y2QzQL9bsCjP/OpvOcv8PAgUaChhkzd7RV7Hh24AjD9xjXH0
 h7Yyx1Qs6phVfES7tUHqiFT4YptsipsoNFnoh+kDbkv9MDsGtjJ8Qp1xcgH2AYVD
 A4MF29oewRc9KcNZ2C8yVSPcnz9c6bf73BnOguFKa8uLZGkRxO1Vds6tbK0pj3ef
 C+Sj2BV0YtDx7yfUgvcHpOavAkyWV8hgyYblV2wUoLvLDhsq5LuFXAt3xwsG8h4k
 N15A057aoWyFyRapfpoiGTATcVS4XyYhxc+VueRO35daEuXULpL/BEOZnJixdRz6
 ThJhr8auIIlzu31qsp26VkAYKPXK3hwDWW8Z7MZzUVWjVI3tkusYSuNYSYdQ7HtE
 jP52mfwf2ryxbgHVmNieDmBO6T+HFTQ8dbOV0ZAB/Eu7dtxDT6nnimk=
 =Y3kr
 -----END PGP SIGNATURE-----

Merge tag 'ubifs-for-linus-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs

Pull UBI and UBIFS updates from Richard Weinberger:
 "UBIFS:
   - Misc code cleanups such as removal of unnecessary variables

  UBI:
   - No longer program unused bit in UBI headers"

* tag 'ubifs-for-linus-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
  ubifs: vmalloc(array_size()) -> vmalloc_array()
  ubi: fastmap: fix ubi->fm memory leak
  mtd: ubi: skip programming unused bits in ubi headers
  ubifs: Remove unnecessary variable assignments
  ubifs: Simplify the code using ubifs_crc_node
  ubifs: Remove unnecessary parameters '*c'
2025-12-09 08:50:27 +09:00
H. Peter Anvin 75beb7effa fs/proc: replace "__auto_type" with "const auto"
Replace use of "__auto_type" in fs/proc/inode.c with "const auto".

Suggested-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>
2025-12-08 15:32:15 -08:00
ChenXiaoSong d8f52650b2 smb/client: update some SMB2 status strings
The smb2maperror KUnit tests reported the following errors:

  KTAP version 1
  1..1
      KTAP version 1
      # Subtest: smb2_maperror
      # module: cifs
      1..2
      ok 1 maperror_test_check_sort
      # maperror_test_check_search: EXPECTATION FAILED at fs/smb/client/smb2maperror_test.c:40
      Expected expect->status_string == result->status_string, but
          expect->status_string == "STATUS_ABANDONED_WAIT_0"
          result->status_string == "STATUS_ABANDONED"
      # maperror_test_check_search: EXPECTATION FAILED at fs/smb/client/smb2maperror_test.c:40
      Expected expect->status_string == result->status_string, but
          expect->status_string == "STATUS_FWP_TOO_MANY_CALLOUTS"
          result->status_string == "STATUS_FWP_TOO_MANY_BOOTTIME_FILTERS"
      not ok 2 maperror_test_check_search
  # smb2_maperror: pass:1 fail:1 skip:0 total:2
  # Totals: pass:1 fail:1 skip:0 total:2
  not ok 1 smb2_maperror

These status codes have duplicate values, so update the status strings to
make the log messages more explicit.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-12-07 11:46:19 -06:00
Linus Torvalds bbbf7f3284 - fix a bug with O_APPEND in cached mode causing data to be written multiple times on server
- use kvmalloc for trans_fd to avoid problems with large msize and fragmented memory
 This should hopefully be used in more transports when time allows
 - convert to new mount API
 - minor cleanups
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE/IPbcYBuWt0zoYhOq06b7GqY5nAFAmk1dvwACgkQq06b7GqY
 5nCRWA//a4qCTs/8FRS7N0Mz5Jg84VZ2JPnVN6iydLKbFDkgUL8JXI723VmApb6D
 wR21yRm7VuWpnGVdfPF6BtjZV7cYXEEwukfLqkXtOwx/WaRREKpN0sOciXMd0htg
 ZgnhhrabCOiSAYJYb9/29sNwhvfweQi0BeAFdIEAPrVonFUYXRzFS0v4AiBCs5PY
 n8X6aoshViAG05MZycB2VYaCxT45I+8YNCXtSsT/uX+3BP1FuRYMRluAYCLu/TU8
 oKyFjkpIri01211OEORx6gs5CDeCv0LpELfk5EW2QF/mz4oW3/4bAchg22NgNV6x
 0OCbgTqwlSJVETCZfZso/TV8efMlk1rLxSA0xjQY9r1lA26BTubrNadnC2W2nhSv
 GpPbDu6s3Cj3WD7P2InGtXxzUIZDCm8kHfHjzbbzgwOS6jl8SaDSnc6J2HtKNESL
 T55hqzqzv4POFQKrgznaQcaDW7imftOA+9xv+k+j5DTDKS9LLxiKS7+dyyzYAyyX
 sCjOd/T7JMvXIp4TxwbROn2+VBVYVO3ZaaKdK8e+qVKvWooP3iorGXAg0O0wZYJV
 tLE5zioZiRngzhqAczDIpJAe5Qd/SIi6W+sAOpKLSvVVKGf/akr0wH0KxI5z7ox8
 uBStVXTOoh52qQr0L7nnBIUJ2VJLJUt9TCzwwvaLM5B1TyPgxh8=
 =7ST9
 -----END PGP SIGNATURE-----

Merge tag '9p-for-6.19-rc1' of https://github.com/martinetd/linux

Pull 9p updates from Dominique Martinet:

 - fix a bug with O_APPEND in cached mode causing data to be written
   multiple times on server

 - use kvmalloc for trans_fd to avoid problems with large msize and
   fragmented memory This should hopefully be used in more transports
   when time allows

 - convert to new mount API

 - minor cleanups

* tag '9p-for-6.19-rc1' of https://github.com/martinetd/linux:
  9p: fix new mount API cache option handling
  9p: fix cache/debug options printing in v9fs_show_options
  9p: convert to the new mount API
  9p: create a v9fs_context structure to hold parsed options
  net/9p: move structures and macros to header files
  fs/fs_parse: add back fsparam_u32hex
  fs/9p: delete unnnecessary condition
  fs/9p: Don't open remote file with APPEND mode when writeback cache is used
  net/9p: cleanup: change p9_trans_module->def to bool
  9p: Use kvmalloc for message buffers on supported transports
2025-12-07 08:29:09 -08:00
Linus Torvalds c06c303832 ocfs2: fix xattr array entry __counted_by error
Commit 2f26f58df0 ("ocfs2: annotate flexible array members with
__counted_by_le()") started annotating the flexible arrays used by
ocfs2, and now gcc complains about ocfs2_reflink_xattr_header():

  In function ‘fortify_memset_chk’,
      inlined from ‘ocfs2_reflink_xattr_header’ at fs/ocfs2/xattr.c:6365:5:
  include/linux/fortify-string.h:480:25: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]

and it looks like the complaint is valid - even if the actual error
message is somewhat confusing.

The 'last' pointer points to past the end of the counted flex array, but
is used as an actual 'last' entry rather than a 'one-past-last'.

It looks like the code copied and cleared an extra entry (which is
likely harmless in practice), but I don't know ocfs2 at all.  Because
it's also possible that the counted-by annotations are off-by-one, and
so this needs checking by somebody who actually knows ocfs2.

But in the meantime this fixes the build error, and certainly _looks_
sane.

Cc: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-12-06 15:28:11 -08:00
Linus Torvalds 509d3f4584 Significant patch series in this pull request:
- The 6 patch series "panic: sys_info: Refactor and fix a potential
   issue" from Andy Shevchenko fixes a build issue and does some cleanup in
   ib/sys_info.c.
 
 - The 9 patch series "Implement mul_u64_u64_div_u64_roundup()" from
   David Laight enhances the 64-bit math code on behalf of a PWM driver and
   beefs up the test module for these library functions.
 
 - The 2 patch series "scripts/gdb/symbols: make BPF debug info available
   to GDB" from Ilya Leoshkevich makes BPF symbol names, sizes, and line
   numbers available to the GDB debugger.
 
 - The 4 patch series "Enable hung_task and lockup cases to dump system
   info on demand" from Feng Tang adds a sysctl which can be used to cause
   additional info dumping when the hung-task and lockup detectors fire.
 
 - The 6 patch series "lib/base64: add generic encoder/decoder, migrate
   users" from Kuan-Wei Chiu adds a general base64 encoder/decoder to lib/
   and migrates several users away from their private implementations.
 
 - The 2 patch series "rbree: inline rb_first() and rb_last()" from Eric
   Dumazet makes TCP a little faster.
 
 - The 9 patch series "liveupdate: Rework KHO for in-kernel users" from
   Pasha Tatashin reworks the KEXEC Handover interfaces in preparation for
   Live Update Orchestrator (LUO), and possibly for other future clients.
 
 - The 13 patch series "kho: simplify state machine and enable dynamic
   updates" from Pasha Tatashin increases the flexibility of KEXEC
   Handover.  Also preparation for LUO.
 
 - The 18 patch series "Live Update Orchestrator" from Pasha Tatashin is
   a major new feature targeted at cloud environments.  Quoting the [0/N]:
 
     This series introduces the Live Update Orchestrator, a kernel subsystem
     designed to facilitate live kernel updates using a kexec-based reboot.
     This capability is critical for cloud environments, allowing hypervisors
     to be updated with minimal downtime for running virtual machines.  LUO
     achieves this by preserving the state of selected resources, such as
     memory, devices and their dependencies, across the kernel transition.
 
     As a key feature, this series includes support for preserving memfd file
     descriptors, which allows critical in-memory data, such as guest RAM or
     any other large memory region, to be maintained in RAM across the kexec
     reboot.
 
   Mike Rappaport merits a mention here, for his extensive review and
   testing work.
 
 - The 3 patch series "kexec: reorganize kexec and kdump sysfs" from
   Sourabh Jain moves the kexec and kdump sysfs entries from /sys/kernel/
   to /sys/kernel/kexec/ and adds back-compatibility symlinks which can
   hopefully be removed one day.
 
 - The 2 patch series "kho: fixes for vmalloc restoration" from Mike
   Rapoport fixes a BUG which was being hit during KHO restoration of
   vmalloc() regions.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCaTSAkQAKCRDdBJ7gKXxA
 jrkiAP9QKfsRv46XZaM5raScjY1ayjP+gqb2rgt6BQ/gZvb2+wD/cPAYOR6BiX52
 n0pVpQmG5P/KyOmpLztn96ejL4heKwQ=
 =JY96
 -----END PGP SIGNATURE-----

Merge tag 'mm-nonmm-stable-2025-12-06-11-14' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull non-MM updates from Andrew Morton:

 - "panic: sys_info: Refactor and fix a potential issue" (Andy Shevchenko)
   fixes a build issue and does some cleanup in ib/sys_info.c

 - "Implement mul_u64_u64_div_u64_roundup()" (David Laight)
   enhances the 64-bit math code on behalf of a PWM driver and beefs up
   the test module for these library functions

 - "scripts/gdb/symbols: make BPF debug info available to GDB" (Ilya Leoshkevich)
   makes BPF symbol names, sizes, and line numbers available to the GDB
   debugger

 - "Enable hung_task and lockup cases to dump system info on demand" (Feng Tang)
   adds a sysctl which can be used to cause additional info dumping when
   the hung-task and lockup detectors fire

 - "lib/base64: add generic encoder/decoder, migrate users" (Kuan-Wei Chiu)
   adds a general base64 encoder/decoder to lib/ and migrates several
   users away from their private implementations

 - "rbree: inline rb_first() and rb_last()" (Eric Dumazet)
   makes TCP a little faster

 - "liveupdate: Rework KHO for in-kernel users" (Pasha Tatashin)
   reworks the KEXEC Handover interfaces in preparation for Live Update
   Orchestrator (LUO), and possibly for other future clients

 - "kho: simplify state machine and enable dynamic updates" (Pasha Tatashin)
   increases the flexibility of KEXEC Handover. Also preparation for LUO

 - "Live Update Orchestrator" (Pasha Tatashin)
   is a major new feature targeted at cloud environments. Quoting the
   cover letter:

      This series introduces the Live Update Orchestrator, a kernel
      subsystem designed to facilitate live kernel updates using a
      kexec-based reboot. This capability is critical for cloud
      environments, allowing hypervisors to be updated with minimal
      downtime for running virtual machines. LUO achieves this by
      preserving the state of selected resources, such as memory,
      devices and their dependencies, across the kernel transition.

      As a key feature, this series includes support for preserving
      memfd file descriptors, which allows critical in-memory data, such
      as guest RAM or any other large memory region, to be maintained in
      RAM across the kexec reboot.

   Mike Rappaport merits a mention here, for his extensive review and
   testing work.

 - "kexec: reorganize kexec and kdump sysfs" (Sourabh Jain)
   moves the kexec and kdump sysfs entries from /sys/kernel/ to
   /sys/kernel/kexec/ and adds back-compatibility symlinks which can
   hopefully be removed one day

 - "kho: fixes for vmalloc restoration" (Mike Rapoport)
   fixes a BUG which was being hit during KHO restoration of vmalloc()
   regions

* tag 'mm-nonmm-stable-2025-12-06-11-14' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (139 commits)
  calibrate: update header inclusion
  Reinstate "resource: avoid unnecessary lookups in find_next_iomem_res()"
  vmcoreinfo: track and log recoverable hardware errors
  kho: fix restoring of contiguous ranges of order-0 pages
  kho: kho_restore_vmalloc: fix initialization of pages array
  MAINTAINERS: TPM DEVICE DRIVER: update the W-tag
  init: replace simple_strtoul with kstrtoul to improve lpj_setup
  KHO: fix boot failure due to kmemleak access to non-PRESENT pages
  Documentation/ABI: new kexec and kdump sysfs interface
  Documentation/ABI: mark old kexec sysfs deprecated
  kexec: move sysfs entries to /sys/kernel/kexec
  test_kho: always print restore status
  kho: free chunks using free_page() instead of kfree()
  selftests/liveupdate: add kexec test for multiple and empty sessions
  selftests/liveupdate: add simple kexec-based selftest for LUO
  selftests/liveupdate: add userspace API selftests
  docs: add documentation for memfd preservation via LUO
  mm: memfd_luo: allow preserving memfd
  liveupdate: luo_file: add private argument to store runtime state
  mm: shmem: export some functions to internal.h
  ...
2025-12-06 14:01:20 -08:00
Linus Torvalds 92fc1f16e2 Two fixes related to recent introduction of scoped_seqlock_read():
- Fix compiler build failures when a particular .config and
    compiler build options variant doesn't result in the
    expected removal of unused, catch-bugs portions of
    scoped_seqlock_read() by the inliner at build time,
    and cause a linker fail even in correct code.
 
  - Match read-locking order in do_task_stat() and
    do_io_accounting(). The inconsistency here was harmless
    but unnecessary.
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmk0E/wRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1j10A/9GFzapX2e4SjyzTUeScdEbVM9cp7cb4lo
 PdPXtmq+Nsh+aw/I+hFBj1bGOnV+xRfoU/wc2a3CfFa1CwekRuzTcbCMU60wfJJr
 CYTf1e390J+6XG588JasjykN9TePDY+TZPIv9rO1Eczsgf6AlXQ8m3Q2tAax8CoN
 8AwMBLZFDmP6WjykeqADXOw4MWU/qS/6vESy65LN11n4jzp7dU4VCTF/Cb8ISEvj
 DMPByPwl/Kv9ioKwKf8xEMHvwboa3wwaE8OI8hxvcdB/VjUk0aSTSN/+6EFefX09
 XM2+2EmDr0E2lLutdsBccD7Yy9PK9vlekWSTDqGY5UcTWYRc0mo20nnUrHyu9QF5
 Yk+mr3jyYnPxKgUYu2d2mfeHXDidW0Yo60fvsO7Y1yfxBPQLMyr+MdYiq86IUvcc
 6pTJhw33N5pd+1zM2tRJclUAyiXSD89/XftBrF/USKB0SAS8dLz/fYJ3ApjEJzfz
 xdbIOz8jOMGum1wF8ss1wqjIhWvw3ICZhdMo+6032eR5Gr5SNGpM1lPu7cQQJ4pI
 tRvATuu5lXsxPEM4l/gb1BqlZImUGCaG4wgiQ1xcwMrsyqLoqWUmumdF3A84+wBa
 J6N+3NFALuce6vxABUOyx/oqfaBITndbnWQlC4uGgtNzlqjGABsyqBQL+svp2j2m
 O2jhqGfW4J8=
 =+H27
 -----END PGP SIGNATURE-----

Merge tag 'locking-urgent-2025-12-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar:
 "Two fixes related to recent introduction of scoped_seqlock_read():

   - Fix compiler build failures when a particular .config and compiler
     build options variant doesn't result in the expected removal of
     unused, catch-bugs portions of scoped_seqlock_read() by the inliner
     at build time, and cause a linker fail even in correct code

   - Match read-locking order in do_task_stat() and do_io_accounting().
     The inconsistency here was harmless but unnecessary"

* tag 'locking-urgent-2025-12-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  seqlock: Cure some more scoped_seqlock() optimization fails
  seqlock, procfs: Match scoped_seqlock_read() critical section vs. RCU ordering in do_task_stat() to do_io_accounting()
2025-12-06 11:31:49 -08:00
Linus Torvalds b0319c4642 NFSD 6.19 Release Notes
Mike Snitzer's mechanism for disabling I/O caching introduced in
 v6.18 is extended to include using direct I/O. The goal is to
 further reduce the memory footprint consumed by NFS clients
 accessing large data sets via NFSD.
 
 The NFSD community adopted a maintainer entry profile during this
 cycle. See
 
   Documentation/filesystems/nfs/nfsd-maintainer-entry-profile.rst
 
 Work continues on hardening NFSD's implementation of the pNFS block
 layout type. This type enables pNFS clients to directly access the
 underlying block devices that contain an exported file system,
 reducing server overhead and increasing data throughput.
 
 The remaining patches in this pull request are clean-ups and minor
 optimizations. Many thanks to the contributors, reviewers, testers,
 and bug reporters who participated during the v6.19 NFSD development
 cycle.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEKLLlsBKG3yQ88j7+M2qzM29mf5cFAmk0SkQACgkQM2qzM29m
 f5cI3RAAoqg53ctyWC8B76mC2kT/bugWWXNwVAVd58UGy3yptMlJG2TBBAHbV6rs
 NgMzP1gg470eccYonntS6Pk259hJimi/REifk+2bFuvjqym7OruKXJBxn2FZrCCw
 mBu/ptfj9SFoTezAHh/wNuHTEy68gLn6V2LB3jdMcxeqUaC39kFnB0sZP4+xiFcx
 PfL6uiXj8JtGpYXf8AKf7HniZCBrtkia1ByRrFHrcPX5A6S9dL85rDQbm/O8L3AA
 hS3cp2UQUSwvFUED9N2QXPpRQ3nytNSG08f/wOaXhIXAmXq/sZFGjlNqjpX8i5jV
 jsSQIeYy1BwLsdxo25wbShrqmYsFH3zWRELKoCs0g9lXbpJWyK0O93zETXtYRRae
 4O9iJ5VcQMyMpg4/Gh1jsRU9RUCc88T15F2HQVYTIgHrLKnz1sWMKI//1G3kYrf3
 L7hYk2ZU6QYqSNOFkrL0Jf7geqf8FR4nUi/nv+A/2gFqm+WWIhNTKQt2hsQlqD66
 HaYOhFX5SOj8YnjsbpGM8W65n8ELaON0PWhq+SBpRCm7i2llod0HTIpyv00NTwVL
 xmr5MfmO7989kVVy7DA/h/xg/dfOpUCNjImrXz+QDbsmCMdLjT/6YGD47FLkxzEO
 O+PuRIORuez8KosEaIRVjdXcNFPSeGfDdBAveHH9IqRX7ZvIZQY=
 =E0oM
 -----END PGP SIGNATURE-----

Merge tag 'nfsd-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd updates from Chuck Lever:

 - Mike Snitzer's mechanism for disabling I/O caching introduced in
   v6.18 is extended to include using direct I/O. The goal is to further
   reduce the memory footprint consumed by NFS clients accessing large
   data sets via NFSD.

 - The NFSD community adopted a maintainer entry profile during this
   cycle. See

      Documentation/filesystems/nfs/nfsd-maintainer-entry-profile.rst

 - Work continues on hardening NFSD's implementation of the pNFS block
   layout type. This type enables pNFS clients to directly access the
   underlying block devices that contain an exported file system,
   reducing server overhead and increasing data throughput.

 - The remaining patches are clean-ups and minor optimizations. Many
   thanks to the contributors, reviewers, testers, and bug reporters who
   participated during the v6.19 NFSD development cycle.

* tag 'nfsd-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (38 commits)
  NFSD: nfsd-io-modes: Separate lists
  NFSD: nfsd-io-modes: Wrap shell snippets in literal code blocks
  NFSD: Add toctree entry for NFSD IO modes docs
  NFSD: add Documentation/filesystems/nfs/nfsd-io-modes.rst
  NFSD: Implement NFSD_IO_DIRECT for NFS WRITE
  NFSD: Make FILE_SYNC WRITEs comply with spec
  NFSD: Add trace point for SCSI fencing operation.
  NFSD: use correct reservation type in nfsd4_scsi_fence_client
  xdrgen: Don't generate unnecessary semicolon
  xdrgen: Fix union declarations
  NFSD: don't start nfsd if sv_permsocks is empty
  xdrgen: handle _XdrString in union encoder/decoder
  xdrgen: Fix the variable-length opaque field decoder template
  xdrgen: Make the xdrgen script location-independent
  xdrgen: Generalize/harden pathname construction
  lockd: don't allow locking on reexported NFSv2/3
  MAINTAINERS: add a nfsd blocklayout reviewer
  nfsd: Use MD5 library instead of crypto_shash
  nfsd: stop pretending that we cache the SEQUENCE reply.
  NFS: nfsd-maintainer-entry-profile: Inline function name prefixes
  ...
2025-12-06 10:57:02 -08:00
Linus Torvalds 416f99c3b1 Driver core changes for 6.19-rc1
- Arch Topology:
   - Move parse_acpi_topology() from arm64 to common code for reuse in RISC-V
 
 - CPU:
   - Expose housekeeping CPUs through /sys/devices/system/cpu/housekeeping
   - Print a newline (or 0x0A) instead of '(null)' reading
     /sys/devices/system/cpu/nohz_full when nohz_full= is not set
 
 - debugfs
   - Remove (broken) 'no-mount' mode
   - Remove redundant access mode checks in debugfs_get_tree() and
     debugfs_create_*() functions
 
 - Devres:
   - Remove unused devm_free_percpu() helper
   - Move devm_alloc_percpu() from device.h to devres.h
 
 - Firmware Loader:
   - Replace simple_strtol() with kstrtoint()
   - Do not call cancel_store() when no upload is in progress
 
 - kernfs:
   - Increase struct super_block::maxbytes to MAX_LFS_FILESIZE
   - Fix a missing unwind path in __kernfs_new_node()
 
 - Misc:
   - Increase the name size in struct auxiliary_device_id to 40 characters
   - Replace system_unbound_wq with system_dfl_wq and add WQ_PERCPU to
     alloc_workqueue()
 
 - Platform:
   - Replace ERR_PTR() with IOMEM_ERR_PTR() in platform ioremap functions
 
 - Rust:
   - Auxiliary:
     - Unregister auxiliary device on parent device unbind
     - Move parent() to impl Device; implement device context aware parent() for
       Device<Bound>
     - Illustrate how to safely obtain a driver's device private data when
       calling from an auxiliary driver into the parant device driver
 
   - DebugFs:
     - Implement support for binary large objects
 
   - Device:
     - Let probe() return the driver's device private data as pinned initializer,
       i.e. impl PinInit<Self, Error>
     - Implement safe accessor for a driver's device private data for
       Device<Bound> (returned reference can't out-live driver binding and
       guarantees the correct private data type)
     - Implement AsBusDevice trait, to be used by class device abstractions to
       derive the bus device type of the parent device
 
   - DMA:
     - Store raw pointer of allocation as NonNull
     - Use start_ptr() and start_ptr_mut() to inherit correct mutability of self
 
   - FS:
     - Add file::Offset type alias
 
   - I2C:
     - Add abstractions for I2C device / driver infrastructure
     - Implement abstractions for manual I2C device registrations
 
   - I/O:
     - Use "kernel vertical" style for imports
     - Define ResourceSize as resource_size_t
     - Move ResourceSize to top-level I/O module
     - Add type alias for phys_addr_t
     - Implement Rust version of read_poll_timeout_atomic()
 
   - PCI:
     - Use "kernel vertical" style for imports
     - Move I/O and IRQ infrastructure to separate files
     - Add support for PCI interrupt vectors
     - Implement TryInto<IrqRequest<'a>> for IrqVector<'a> to convert an
       IrqVector bound to specific pci::Device into an IrqRequest bound to the
       same pci::Device's parent Device
     - Leverage pin_init_scope() to get rid of redundant Result in IRQ methods
 
   - PinInit:
     - Add {pin_}init_scope() to execute code before creating an initializer
 
   - Platform:
     - Leverage pin_init_scope() to get rid of redundant Result in IRQ methods
 
   - Timekeeping:
     - Implement abstraction of udelay()
 
   - Uaccess:
     - Implement read_slice_partial() and read_slice_file() for UserSliceReader
     - Implement write_slice_partial() and write_slice_file() for UserSliceWriter
 
 - sysfs
   - Prepare the constification of struct attribute
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS2q/xV6QjXAdC7k+1FlHeO1qrKLgUCaTAehwAKCRBFlHeO1qrK
 LmzvAP0TWwKUGIduccknIa1AFvBM92lWVZptSysotv3SLFZq3wD9GBLIENt1DkEk
 s+GBqbobPgoyaodaysqLQ/SNqF9TcAM=
 =Wutw
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core updates from Danilo Krummrich:
 "Arch Topology:
   - Move parse_acpi_topology() from arm64 to common code for reuse in
     RISC-V

  CPU:
   - Expose housekeeping CPUs through /sys/devices/system/cpu/housekeeping
   - Print a newline (or 0x0A) instead of '(null)' reading
     /sys/devices/system/cpu/nohz_full when nohz_full= is not set

  debugfs
   - Remove (broken) 'no-mount' mode
   - Remove redundant access mode checks in debugfs_get_tree() and
     debugfs_create_*() functions

  Devres:
   - Remove unused devm_free_percpu() helper
   - Move devm_alloc_percpu() from device.h to devres.h

  Firmware Loader:
   - Replace simple_strtol() with kstrtoint()
   - Do not call cancel_store() when no upload is in progress

  kernfs:
   - Increase struct super_block::maxbytes to MAX_LFS_FILESIZE
   - Fix a missing unwind path in __kernfs_new_node()

  Misc:
   - Increase the name size in struct auxiliary_device_id to 40
     characters
   - Replace system_unbound_wq with system_dfl_wq and add WQ_PERCPU to
     alloc_workqueue()

  Platform:
   - Replace ERR_PTR() with IOMEM_ERR_PTR() in platform ioremap
     functions

  Rust:
   - Auxiliary:
      - Unregister auxiliary device on parent device unbind
      - Move parent() to impl Device; implement device context aware
        parent() for Device<Bound>
      - Illustrate how to safely obtain a driver's device private data
        when calling from an auxiliary driver into the parant device
        driver

   - DebugFs:
      - Implement support for binary large objects

   - Device:
      - Let probe() return the driver's device private data as pinned
        initializer, i.e. impl PinInit<Self, Error>
      - Implement safe accessor for a driver's device private data for
        Device<Bound> (returned reference can't out-live driver binding
        and guarantees the correct private data type)
      - Implement AsBusDevice trait, to be used by class device
        abstractions to derive the bus device type of the parent device

   - DMA:
      - Store raw pointer of allocation as NonNull
      - Use start_ptr() and start_ptr_mut() to inherit correct
        mutability of self

   - FS:
      - Add file::Offset type alias

   - I2C:
      - Add abstractions for I2C device / driver infrastructure
      - Implement abstractions for manual I2C device registrations

   - I/O:
      - Use "kernel vertical" style for imports
      - Define ResourceSize as resource_size_t
      - Move ResourceSize to top-level I/O module
      - Add type alias for phys_addr_t
      - Implement Rust version of read_poll_timeout_atomic()

   - PCI:
      - Use "kernel vertical" style for imports
      - Move I/O and IRQ infrastructure to separate files
      - Add support for PCI interrupt vectors
      - Implement TryInto<IrqRequest<'a>> for IrqVector<'a> to convert
        an IrqVector bound to specific pci::Device into an IrqRequest
        bound to the same pci::Device's parent Device
      - Leverage pin_init_scope() to get rid of redundant Result in IRQ
        methods

   - PinInit:
      - Add {pin_}init_scope() to execute code before creating an
        initializer

   - Platform:
      - Leverage pin_init_scope() to get rid of redundant Result in IRQ
        methods

   - Timekeeping:
      - Implement abstraction of udelay()

   - Uaccess:
      - Implement read_slice_partial() and read_slice_file() for
        UserSliceReader
      - Implement write_slice_partial() and write_slice_file() for
        UserSliceWriter

  sysfs:
   - Prepare the constification of struct attribute"

* tag 'driver-core-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: (75 commits)
  rust: pci: fix build failure when CONFIG_PCI_MSI is disabled
  debugfs: Fix default access mode config check
  debugfs: Remove broken no-mount mode
  debugfs: Remove redundant access mode checks
  driver core: Check drivers_autoprobe for all added devices
  driver core: WQ_PERCPU added to alloc_workqueue users
  driver core: replace use of system_unbound_wq with system_dfl_wq
  tick/nohz: Expose housekeeping CPUs in sysfs
  tick/nohz: avoid showing '(null)' if nohz_full= not set
  sysfs/cpu: Use DEVICE_ATTR_RO for nohz_full attribute
  kernfs: fix memory leak of kernfs_iattrs in __kernfs_new_node
  fs/kernfs: raise sb->maxbytes to MAX_LFS_FILESIZE
  mod_devicetable: Bump auxiliary_device_id name size
  sysfs: simplify attribute definition macros
  samples/kobject: constify 'struct foo_attribute'
  samples/kobject: add is_visible() callback to attribute group
  sysfs: attribute_group: enable const variants of is_visible()
  sysfs: introduce __SYSFS_FUNCTION_ALTERNATIVE()
  sysfs: transparently handle const pointers in ATTRIBUTE_GROUPS()
  sysfs: attribute_group: allow registration of const attribute
  ...
2025-12-05 21:29:02 -08:00
Mike Snitzer 3af870aedb nfs/localio: fix regression due to out-of-order __put_cred
Commit f2060bdc21 ("nfs/localio: add refcounting for each iocb IO
associated with NFS pgio header") inadvertantly reintroduced the same
potential for __put_cred() triggering BUG_ON(cred == current->cred) that
commit 992203a1fb ("nfs/localio: restore creds before releasing pageio
data") fixed.

Fix this by saving and restoring the cred around each {read,write}_iter
call within the respective for loop of nfs_local_call_{read,write} using
scoped_with_creds().

NOTE: this fix started by first reverting the following commits:

 94afb627df ("nfs: use credential guards in nfs_local_call_read()")
 bff3c841f7 ("nfs: use credential guards in nfs_local_call_write()")
 1d18101a64 ("Merge tag 'kernel-6.19-rc1.cred' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs")

followed by narrowly fixing the cred lifetime issue by using
scoped_with_creds().  In doing so, this commit's changes appear more
extensive than they really are (as evidenced by comparing to v6.18's
fs/nfs/localio.c).

Reported-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Acked-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Link: https://lore.kernel.org/linux-next/20251205111942.4150b06f@canb.auug.org.au/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-12-05 17:53:56 -08:00
Linus Torvalds 51d90a15fe ARM:
- Support for userspace handling of synchronous external aborts (SEAs),
   allowing the VMM to potentially handle the abort in a non-fatal
   manner.
 
 - Large rework of the VGIC's list register handling with the goal of
   supporting more active/pending IRQs than available list registers in
   hardware. In addition, the VGIC now supports EOImode==1 style
   deactivations for IRQs which may occur on a separate vCPU than the
   one that acked the IRQ.
 
 - Support for FEAT_XNX (user / privileged execute permissions) and
   FEAT_HAF (hardware update to the Access Flag) in the software page
   table walkers and shadow MMU.
 
 - Allow page table destruction to reschedule, fixing long need_resched
   latencies observed when destroying a large VM.
 
 - Minor fixes to KVM and selftests
 
 Loongarch:
 
 - Get VM PMU capability from HW GCFG register.
 
 - Add AVEC basic support.
 
 - Use 64-bit register definition for EIOINTC.
 
 - Add KVM timer test cases for tools/selftests.
 
 RISC/V:
 
 - SBI message passing (MPXY) support for KVM guest
 
 - Give a new, more specific error subcode for the case when in-kernel
   AIA virtualization fails to allocate IMSIC VS-file
 
 - Support KVM_DIRTY_LOG_INITIALLY_SET, enabling dirty log gradually
   in small chunks
 
 - Fix guest page fault within HLV* instructions
 
 - Flush VS-stage TLB after VCPU migration for Andes cores
 
 s390:
 
 - Always allocate ESCA (Extended System Control Area), instead of
   starting with the basic SCA and converting to ESCA with the
   addition of the 65th vCPU.  The price is increased number of
   exits (and worse performance) on z10 and earlier processor;
   ESCA was introduced by z114/z196 in 2010.
 
 - VIRT_XFER_TO_GUEST_WORK support
 
 - Operation exception forwarding support
 
 - Cleanups
 
 x86:
 
 - Skip the costly "zap all SPTEs" on an MMIO generation wrap if MMIO SPTE
   caching is disabled, as there can't be any relevant SPTEs to zap.
 
 - Relocate a misplaced export.
 
 - Fix an async #PF bug where KVM would clear the completion queue when the
   guest transitioned in and out of paging mode, e.g. when handling an SMI and
   then returning to paged mode via RSM.
 
 - Leave KVM's user-return notifier registered even when disabling
   virtualization, as long as kvm.ko is loaded.  On reboot/shutdown, keeping
   the notifier registered is ok; the kernel does not use the MSRs and the
   callback will run cleanly and restore host MSRs if the CPU manages to
   return to userspace before the system goes down.
 
 - Use the checked version of {get,put}_user().
 
 - Fix a long-lurking bug where KVM's lack of catch-up logic for periodic APIC
   timers can result in a hard lockup in the host.
 
 - Revert the periodic kvmclock sync logic now that KVM doesn't use a
   clocksource that's subject to NTP corrections.
 
 - Clean up KVM's handling of MMIO Stale Data and L1TF, and bury the latter
   behind CONFIG_CPU_MITIGATIONS.
 
 - Context switch XCR0, XSS, and PKRU outside of the entry/exit fast path;
   the only reason they were handled in the fast path was to paper of a bug
   in the core #MC code, and that has long since been fixed.
 
 - Add emulator support for AVX MOV instructions, to play nice with emulated
   devices whose guest drivers like to access PCI BARs with large multi-byte
   instructions.
 
 x86 (AMD):
 
 - Fix a few missing "VMCB dirty" bugs.
 
 - Fix the worst of KVM's lack of EFER.LMSLE emulation.
 
 - Add AVIC support for addressing 4k vCPUs in x2AVIC mode.
 
 - Fix incorrect handling of selective CR0 writes when checking intercepts
   during emulation of L2 instructions.
 
 - Fix a currently-benign bug where KVM would clobber SPEC_CTRL[63:32] on
   VMRUN and #VMEXIT.
 
 - Fix a bug where KVM corrupt the guest code stream when re-injecting a soft
   interrupt if the guest patched the underlying code after the VM-Exit, e.g.
   when Linux patches code with a temporary INT3.
 
 - Add KVM_X86_SNP_POLICY_BITS to advertise supported SNP policy bits to
   userspace, and extend KVM "support" to all policy bits that don't require
   any actual support from KVM.
 
 x86 (Intel):
 
 - Use the root role from kvm_mmu_page to construct EPTPs instead of the
   current vCPU state, partly as worthwhile cleanup, but mostly to pave the
   way for tracking per-root TLB flushes, and elide EPT flushes on pCPU
   migration if the root is clean from a previous flush.
 
 - Add a few missing nested consistency checks.
 
 - Rip out support for doing "early" consistency checks via hardware as the
   functionality hasn't been used in years and is no longer useful in general;
   replace it with an off-by-default module param to WARN if hardware fails
   a check that KVM does not perform.
 
 - Fix a currently-benign bug where KVM would drop the guest's SPEC_CTRL[63:32]
   on VM-Enter.
 
 - Misc cleanups.
 
 - Overhaul the TDX code to address systemic races where KVM (acting on behalf
   of userspace) could inadvertantly trigger lock contention in the TDX-Module;
   KVM was either working around these in weird, ugly ways, or was simply
   oblivious to them (though even Yan's devilish selftests could only break
   individual VMs, not the host kernel)
 
 - Fix a bug where KVM could corrupt a vCPU's cpu_list when freeing a TDX vCPU,
   if creating said vCPU failed partway through.
 
 - Fix a few sparse warnings (bad annotation, 0 != NULL).
 
 - Use struct_size() to simplify copying TDX capabilities to userspace.
 
 - Fix a bug where TDX would effectively corrupt user-return MSR values if the
   TDX Module rejects VP.ENTER and thus doesn't clobber host MSRs as expected.
 
 Selftests:
 
 - Fix a math goof in mmu_stress_test when running on a single-CPU system/VM.
 
 - Forcefully override ARCH from x86_64 to x86 to play nice with specifying
   ARCH=x86_64 on the command line.
 
 - Extend a bunch of nested VMX to validate nested SVM as well.
 
 - Add support for LA57 in the core VM_MODE_xxx macro, and add a test to
   verify KVM can save/restore nested VMX state when L1 is using 5-level
   paging, but L2 is not.
 
 - Clean up the guest paging code in anticipation of sharing the core logic for
   nested EPT and nested NPT.
 
 guest_memfd:
 
 - Add NUMA mempolicy support for guest_memfd, and clean up a variety of
   rough edges in guest_memfd along the way.
 
 - Define a CLASS to automatically handle get+put when grabbing a guest_memfd
   from a memslot to make it harder to leak references.
 
 - Enhance KVM selftests to make it easer to develop and debug selftests like
   those added for guest_memfd NUMA support, e.g. where test and/or KVM bugs
   often result in hard-to-debug SIGBUS errors.
 
 - Misc cleanups.
 
 Generic:
 
 - Use the recently-added WQ_PERCPU when creating the per-CPU workqueue for
   irqfd cleanup.
 
 - Fix a goof in the dirty ring documentation.
 
 - Fix choice of target for directed yield across different calls to
   kvm_vcpu_on_spin(); the function was always starting from the first
   vCPU instead of continuing the round-robin search.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmkvMa8UHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroMlFwf+Ow7zOYUuELSQ+Jn+hOYXiCNrdBDx
 ZamvMU8kLPr7XX0Zog6HgcMm//qyA6k5nSfqCjfsQZrIhRA/gWJ61jz1OX/Jxq18
 pJ9Vz6epnEPYiOtBwz+v8OS8MqDqVNzj2i6W1/cLPQE50c1Hhw64HWS5CSxDQiHW
 A7PVfl5YU12lW1vG3uE0sNESDt4Eh/spNM17iddXdF4ZUOGublserjDGjbc17E7H
 8BX3DkC2plqkJKwtjg0ae62hREkITZZc7RqsnftUkEhn0N0H9+rb6NKUyzIVh9NZ
 bCtCjtrKN9zfZ0Mujnms3ugBOVqNIputu/DtPnnFKXtXWSrHrgGSNv5ewA==
 =PEcw
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM updates from Paolo Bonzini:
 "ARM:

   - Support for userspace handling of synchronous external aborts
     (SEAs), allowing the VMM to potentially handle the abort in a
     non-fatal manner

   - Large rework of the VGIC's list register handling with the goal of
     supporting more active/pending IRQs than available list registers
     in hardware. In addition, the VGIC now supports EOImode==1 style
     deactivations for IRQs which may occur on a separate vCPU than the
     one that acked the IRQ

   - Support for FEAT_XNX (user / privileged execute permissions) and
     FEAT_HAF (hardware update to the Access Flag) in the software page
     table walkers and shadow MMU

   - Allow page table destruction to reschedule, fixing long
     need_resched latencies observed when destroying a large VM

   - Minor fixes to KVM and selftests

  Loongarch:

   - Get VM PMU capability from HW GCFG register

   - Add AVEC basic support

   - Use 64-bit register definition for EIOINTC

   - Add KVM timer test cases for tools/selftests

  RISC/V:

   - SBI message passing (MPXY) support for KVM guest

   - Give a new, more specific error subcode for the case when in-kernel
     AIA virtualization fails to allocate IMSIC VS-file

   - Support KVM_DIRTY_LOG_INITIALLY_SET, enabling dirty log gradually
     in small chunks

   - Fix guest page fault within HLV* instructions

   - Flush VS-stage TLB after VCPU migration for Andes cores

  s390:

   - Always allocate ESCA (Extended System Control Area), instead of
     starting with the basic SCA and converting to ESCA with the
     addition of the 65th vCPU. The price is increased number of exits
     (and worse performance) on z10 and earlier processor; ESCA was
     introduced by z114/z196 in 2010

   - VIRT_XFER_TO_GUEST_WORK support

   - Operation exception forwarding support

   - Cleanups

  x86:

   - Skip the costly "zap all SPTEs" on an MMIO generation wrap if MMIO
     SPTE caching is disabled, as there can't be any relevant SPTEs to
     zap

   - Relocate a misplaced export

   - Fix an async #PF bug where KVM would clear the completion queue
     when the guest transitioned in and out of paging mode, e.g. when
     handling an SMI and then returning to paged mode via RSM

   - Leave KVM's user-return notifier registered even when disabling
     virtualization, as long as kvm.ko is loaded. On reboot/shutdown,
     keeping the notifier registered is ok; the kernel does not use the
     MSRs and the callback will run cleanly and restore host MSRs if the
     CPU manages to return to userspace before the system goes down

   - Use the checked version of {get,put}_user()

   - Fix a long-lurking bug where KVM's lack of catch-up logic for
     periodic APIC timers can result in a hard lockup in the host

   - Revert the periodic kvmclock sync logic now that KVM doesn't use a
     clocksource that's subject to NTP corrections

   - Clean up KVM's handling of MMIO Stale Data and L1TF, and bury the
     latter behind CONFIG_CPU_MITIGATIONS

   - Context switch XCR0, XSS, and PKRU outside of the entry/exit fast
     path; the only reason they were handled in the fast path was to
     paper of a bug in the core #MC code, and that has long since been
     fixed

   - Add emulator support for AVX MOV instructions, to play nice with
     emulated devices whose guest drivers like to access PCI BARs with
     large multi-byte instructions

  x86 (AMD):

   - Fix a few missing "VMCB dirty" bugs

   - Fix the worst of KVM's lack of EFER.LMSLE emulation

   - Add AVIC support for addressing 4k vCPUs in x2AVIC mode

   - Fix incorrect handling of selective CR0 writes when checking
     intercepts during emulation of L2 instructions

   - Fix a currently-benign bug where KVM would clobber SPEC_CTRL[63:32]
     on VMRUN and #VMEXIT

   - Fix a bug where KVM corrupt the guest code stream when re-injecting
     a soft interrupt if the guest patched the underlying code after the
     VM-Exit, e.g. when Linux patches code with a temporary INT3

   - Add KVM_X86_SNP_POLICY_BITS to advertise supported SNP policy bits
     to userspace, and extend KVM "support" to all policy bits that
     don't require any actual support from KVM

  x86 (Intel):

   - Use the root role from kvm_mmu_page to construct EPTPs instead of
     the current vCPU state, partly as worthwhile cleanup, but mostly to
     pave the way for tracking per-root TLB flushes, and elide EPT
     flushes on pCPU migration if the root is clean from a previous
     flush

   - Add a few missing nested consistency checks

   - Rip out support for doing "early" consistency checks via hardware
     as the functionality hasn't been used in years and is no longer
     useful in general; replace it with an off-by-default module param
     to WARN if hardware fails a check that KVM does not perform

   - Fix a currently-benign bug where KVM would drop the guest's
     SPEC_CTRL[63:32] on VM-Enter

   - Misc cleanups

   - Overhaul the TDX code to address systemic races where KVM (acting
     on behalf of userspace) could inadvertantly trigger lock contention
     in the TDX-Module; KVM was either working around these in weird,
     ugly ways, or was simply oblivious to them (though even Yan's
     devilish selftests could only break individual VMs, not the host
     kernel)

   - Fix a bug where KVM could corrupt a vCPU's cpu_list when freeing a
     TDX vCPU, if creating said vCPU failed partway through

   - Fix a few sparse warnings (bad annotation, 0 != NULL)

   - Use struct_size() to simplify copying TDX capabilities to userspace

   - Fix a bug where TDX would effectively corrupt user-return MSR
     values if the TDX Module rejects VP.ENTER and thus doesn't clobber
     host MSRs as expected

  Selftests:

   - Fix a math goof in mmu_stress_test when running on a single-CPU
     system/VM

   - Forcefully override ARCH from x86_64 to x86 to play nice with
     specifying ARCH=x86_64 on the command line

   - Extend a bunch of nested VMX to validate nested SVM as well

   - Add support for LA57 in the core VM_MODE_xxx macro, and add a test
     to verify KVM can save/restore nested VMX state when L1 is using
     5-level paging, but L2 is not

   - Clean up the guest paging code in anticipation of sharing the core
     logic for nested EPT and nested NPT

  guest_memfd:

   - Add NUMA mempolicy support for guest_memfd, and clean up a variety
     of rough edges in guest_memfd along the way

   - Define a CLASS to automatically handle get+put when grabbing a
     guest_memfd from a memslot to make it harder to leak references

   - Enhance KVM selftests to make it easer to develop and debug
     selftests like those added for guest_memfd NUMA support, e.g. where
     test and/or KVM bugs often result in hard-to-debug SIGBUS errors

   - Misc cleanups

  Generic:

   - Use the recently-added WQ_PERCPU when creating the per-CPU
     workqueue for irqfd cleanup

   - Fix a goof in the dirty ring documentation

   - Fix choice of target for directed yield across different calls to
     kvm_vcpu_on_spin(); the function was always starting from the first
     vCPU instead of continuing the round-robin search"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (260 commits)
  KVM: arm64: at: Update AF on software walk only if VM has FEAT_HAFDBS
  KVM: arm64: at: Use correct HA bit in TCR_EL2 when regime is EL2
  KVM: arm64: Document KVM_PGTABLE_PROT_{UX,PX}
  KVM: arm64: Fix spelling mistake "Unexpeced" -> "Unexpected"
  KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot()
  KVM: arm64: Add endian casting to kvm_swap_s[12]_desc()
  KVM: arm64: Fix compilation when CONFIG_ARM64_USE_LSE_ATOMICS=n
  KVM: arm64: selftests: Add test for AT emulation
  KVM: arm64: nv: Expose hardware access flag management to NV guests
  KVM: arm64: nv: Implement HW access flag management in stage-2 SW PTW
  KVM: arm64: Implement HW access flag management in stage-1 SW PTW
  KVM: arm64: Propagate PTW errors up to AT emulation
  KVM: arm64: Add helper for swapping guest descriptor
  KVM: arm64: nv: Use pgtable definitions in stage-2 walk
  KVM: arm64: Handle endianness in read helper for emulated PTW
  KVM: arm64: nv: Stop passing vCPU through void ptr in S2 PTW
  KVM: arm64: Call helper for reading descriptors directly
  KVM: arm64: nv: Advertise support for FEAT_XNX
  KVM: arm64: Teach ptdump about FEAT_XNX permissions
  KVM: s390: Use generic VIRT_XFER_TO_GUEST_WORK functions
  ...
2025-12-05 17:01:20 -08:00
Trond Myklebust bd3b04b46c NFSv4: Handle NFS4ERR_NOTSUPP errors for directory delegations
The error NFS4ERR_NOTSUPP will be returned for operations that are
legal, but not supported by the server.

Fixes: 156b094829 ("NFS: Request a directory delegation on ACCESS, CREATE, and UNLINK")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
2025-12-05 19:34:29 -05:00
Mike Snitzer 0b873de2c0 nfs/localio: remove 61 byte hole from needless ____cacheline_aligned
struct nfs_local_kiocb used ____cacheline_aligned on its iters[] array
and as the structure evolved it caused a 61 byte hole to form.  Fix
this by removing ____cacheline_aligned and reordering iters[] before
iter_is_dio_aligned[].

Fixes: 6a218b9c31 ("nfs/localio: do not issue misaligned DIO out-of-order")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
2025-12-05 19:34:29 -05:00