Commit graph

1186762 commits

Author SHA1 Message Date
Namjae Jeon
25933573ef ksmbd: fix posix_acls and acls dereferencing possible ERR_PTR()
Dan reported the following error message:

fs/smb/server/smbacl.c:1296 smb_check_perm_dacl()
    error: 'posix_acls' dereferencing possible ERR_PTR()
fs/smb/server/vfs.c:1323 ksmbd_vfs_make_xattr_posix_acl()
    error: 'posix_acls' dereferencing possible ERR_PTR()
fs/smb/server/vfs.c:1830 ksmbd_vfs_inherit_posix_acl()
    error: 'acls' dereferencing possible ERR_PTR()

__get_acl() returns a mix of error pointers and NULL. This change it
with IS_ERR_OR_NULL().

Fixes: e2f34481b2 ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-06-02 12:30:57 -05:00
Namjae Jeon
fc6c6a3c32 ksmbd: fix out-of-bound read in parse_lease_state()
This bug is in parse_lease_state, and it is caused by the missing check
of `struct create_context`. When the ksmbd traverses the create_contexts,
it doesn't check if the field of `NameOffset` and `Next` is valid,
The KASAN message is following:

[    6.664323] BUG: KASAN: slab-out-of-bounds in parse_lease_state+0x7d/0x280
[    6.664738] Read of size 2 at addr ffff888005c08988 by task kworker/0:3/103
...
[    6.666644] Call Trace:
[    6.666796]  <TASK>
[    6.666933]  dump_stack_lvl+0x33/0x50
[    6.667167]  print_report+0xcc/0x620
[    6.667903]  kasan_report+0xae/0xe0
[    6.668374]  kasan_check_range+0x35/0x1b0
[    6.668621]  parse_lease_state+0x7d/0x280
[    6.668868]  smb2_open+0xbe8/0x4420
[    6.675137]  handle_ksmbd_work+0x282/0x820

Use smb2_find_context_vals() to find smb2 create request lease context.
smb2_find_context_vals validate create context fields.

Cc: stable@vger.kernel.org
Reported-by: Chih-Yen Chang <cc85nod@gmail.com>
Tested-by: Chih-Yen Chang <cc85nod@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-06-02 12:30:57 -05:00
Namjae Jeon
f1a411873c ksmbd: fix out-of-bound read in deassemble_neg_contexts()
The check in the beginning is
`clen + sizeof(struct smb2_neg_context) <= len_of_ctxts`,
but in the end of loop, `len_of_ctxts` will subtract
`((clen + 7) & ~0x7) + sizeof(struct smb2_neg_context)`, which causes
integer underflow when clen does the 8 alignment. We should use
`(clen + 7) & ~0x7` in the check to avoid underflow from happening.

Then there are some variables that need to be declared unsigned
instead of signed.

[   11.671070] BUG: KASAN: slab-out-of-bounds in smb2_handle_negotiate+0x799/0x1610
[   11.671533] Read of size 2 at addr ffff888005e86cf2 by task kworker/0:0/7
...
[   11.673383] Call Trace:
[   11.673541]  <TASK>
[   11.673679]  dump_stack_lvl+0x33/0x50
[   11.673913]  print_report+0xcc/0x620
[   11.674671]  kasan_report+0xae/0xe0
[   11.675171]  kasan_check_range+0x35/0x1b0
[   11.675412]  smb2_handle_negotiate+0x799/0x1610
[   11.676217]  ksmbd_smb_negotiate_common+0x526/0x770
[   11.676795]  handle_ksmbd_work+0x274/0x810
...

Cc: stable@vger.kernel.org
Signed-off-by: Chih-Yen Chang <cc85nod@gmail.com>
Tested-by: Chih-Yen Chang <cc85nod@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-06-02 12:30:57 -05:00
KP Singh
b0fd1852bc bpf: Fix UAF in task local storage
When task local storage was generalized for tracing programs, the
bpf_task_local_storage callback was moved from a BPF LSM hook
callback for security_task_free LSM hook to it's own callback. But a
failure case in bad_fork_cleanup_security was missed which, when
triggered, led to a dangling task owner pointer and a subsequent
use-after-free. Move the bpf_task_storage_free to the very end of
free_task to handle all failure cases.

This issue was noticed when a BPF LSM program was attached to the
task_alloc hook on a kernel with KASAN enabled. The program used
bpf_task_storage_get to copy the task local storage from the current
task to the new task being created.

Fixes: a10787e6d5 ("bpf: Enable task local storage for tracing programs")
Reported-by: Kuba Piecuch <jpiecuch@google.com>
Signed-off-by: KP Singh <kpsingh@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230602002612.1117381-1-kpsingh@kernel.org
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
2023-06-02 10:18:07 -07:00
Linus Torvalds
2b7497739f block-6.4-2023-06-02
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmR56zQQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpl+iD/0ZwWydDPMV2cT/MvMDUelqfZNW6yAQcctp
 5ICVb7ZWkZNec/wRFUZUxXV1IYQwpudnTTjdrRcnmvRcIk9vXoLMDqOOb4J2XyP9
 My0tK5zTKe2W46ipa1jKyIj/Nq+liPOK8EIcRTLbvrqOeZAbj0GJrfV9pg11OMEL
 18wQbWeHG4UKIMqYekvOb+wMGYNK/YO17X/9bmHnmPmTIbidvvCS8n0gKIgruGxI
 lOJZfBr3wYrLDRXVf706MmrygyQNf+FJXO3RHmm9LrsZVQvUHqAJQJ2MCN64xrkU
 VphCHtHMSRn/qKEmMkgsDpqsSN+s7XfHPHgLpwzIoIoGbEOkRFRgQGlbjC30RiIg
 X565IoAbZMe9WjC1tEqnKa1WG0aogdMjWTGA+8TEOaZPWBUcgvmixwbdKdqGEO/F
 SnkvUwJ/GgRK1AXKsG/+nwWPd5YD3JJjsZuM1cq/LcYtN30/IO0FDI6DPUav1kzF
 xjhETkKBq6GNQoDa8w1GOJIOP46PT2uaWsBKOZDOiQKRxGsM326+rL9Zh1s1GCL+
 /A+0UWtUxPw8QxAx98gT5aHePf2JmyKPu6FRFtsXAVqP32vJ0LMeV6WT4ZzSOo5l
 s8rr1HtH0JKu4f9BworQ3lT1Mk2/5D3ldpcOeybjkgu0FetvEqW1/czDS/ZkarK/
 q6AjY4n+jg==
 =EdhU
 -----END PGP SIGNATURE-----

Merge tag 'block-6.4-2023-06-02' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:
 "Just an NVMe pull request with (mostly) KATO fixes, a regression fix
  for zoned device revalidation, and a fix for an md raid5 regression"

* tag 'block-6.4-2023-06-02' of git://git.kernel.dk/linux:
  nvme: fix the name of Zone Append for verbose logging
  nvme: improve handling of long keep alives
  nvme: check IO start time when deciding to defer KA
  nvme: double KA polling frequency to avoid KATO with TBKAS on
  nvme: fix miss command type check
  block: fix revalidate performance regression
  md/raid5: fix miscalculation of 'end_sector' in raid5_read_one_chunk()
2023-06-02 13:13:50 -04:00
Linus Torvalds
26d1477990 io_uring-6.4-2023-06-02
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmR560oQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpik4D/4pk35A+52TaLCJFDtsGAwmZ5CLjWAcdzKf
 8PGT4Z8WbgbO3amdZpMRkBpYi+BLJ8G3fJoS4U7mOSGC7gvPY5wU+S094DuteScA
 P/MXYLl3cWCAScCV/8suqjV0+6D+r5UgEzWjH0kZ9YGTSEjAancsTlXfPIDgIV30
 /C6sBCzA4FpOP/UjDGBFLLCovfOjGkOjQzQ+XrKE44t0N9vghkBkvZDXyflbp/Ef
 x3eupF2nEN5brUSVaOEGXhknASWYFdLg7or+BdfOi4je+8k6/53euVSaAKed1lCS
 asFbw6ILwOSzwqVS8lPcxy5og1zoaHOcAgPpJG8RIG0Iw77ZX9yWjwdcKjJ5A0rl
 uygVzEqQ8QqP/xTiprc21ulma8GtL8DKoNo6im+aT6L6FCkjpSKQl55lKggRZ/x9
 ctih1UVKX5GuNCpLD8tfByH97AXCm5PQya6/U42sOy01kqudsOc4bbbJ/ybPJ6sF
 CEq5bfkCL0W+L0iEg/2k3BIiDfa82oBSSnEVka4uULfU8X8EPRHMkLkNqL9P7NIp
 /apYcwPsaqZDdykeOdxyQys9cHHR8rsPKaN256s7dtIGd1z+LV6OMSwMyRXLAsp+
 Y+bjFHZwoa0uWxbmpXY7F/3iRq34gFhtovL+bRtarDelrB9bfklfR4BypVTayNaA
 eqZ1peGItw==
 =ekgX
 -----END PGP SIGNATURE-----

Merge tag 'io_uring-6.4-2023-06-02' of git://git.kernel.dk/linux

Pull io_uring fix from Jens Axboe:
 "Just a single revert in here, removing the warning on the epoll ctl
  opcode.

  We originally deprecated this a few releases ago, but I've since had
  two people report that it's being used. Which isn't the biggest deal,
  obviously this is why we out in the deprecation notice in the first
  place, but it also means that we should just kill this warning again
  and abandon the deprecation plans.

  Since it's only a few handfuls of code to support epoll ctl, not worth
  going any further with this imho"

* tag 'io_uring-6.4-2023-06-02' of git://git.kernel.dk/linux:
  io_uring: undeprecate epoll_ctl support
2023-06-02 13:08:27 -04:00
Roberto Sassu
c3d03e8e35 KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()
Commit ac4e97abce ("scatterlist: sg_set_buf() argument must be in linear
mapping") checks that both the signature and the digest reside in the
linear mapping area.

However, more recently commit ba14a194a4 ("fork: Add generic vmalloced
stack support") made it possible to move the stack in the vmalloc area,
which is not contiguous, and thus not suitable for sg_set_buf() which needs
adjacent pages.

Always make a copy of the signature and digest in the same buffer used to
store the key and its parameters, and pass them to sg_init_one(). Prefer it
to conditionally doing the copy if necessary, to keep the code simple. The
buffer allocated with kmalloc() is in the linear mapping area.

Cc: stable@vger.kernel.org # 4.9.x
Fixes: ba14a194a4 ("fork: Add generic vmalloced stack support")
Link: https://lore.kernel.org/linux-integrity/Y4pIpxbjBdajymBJ@sol.localdomain/
Suggested-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
2023-06-02 15:36:23 +02:00
Linus Torvalds
921bdc72a0 MMC core:
- Fix pwrseq for WILC1000/WILC3000 SDIO card
 
 MMC host:
  - vub300: Fix invalid response handling
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmR5rCEXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCkKmA//fB0MmUuNkX0QzLVNllK04bC7
 TRqpISArbMht+jojEXy8m9Wl2H+HOXMLz6SrJLp0yTeUoSESbHxUKFdoIciYotzB
 Q8locBXmb1ZhXRFPCZrUa6BG1MbQMo8K0J2XyVyPCD/wZyBCIF+m0yUWZpLmSsQW
 XIPvx48ey9DrpHMob6JudJ+TTOkOd1iRk1SqErao4q5EWvuegEYHQqXfGc7jakjl
 cng8IJM/Lv/91noUZrT5Wt/EaIAKpx2qgapVU2vlIowpMsJP8Nu1QyfmAWLXo2x8
 g8yZ9vpD44vaIyvoQKRexGJEKxth9XVVmv+xPupCewmNUG3GqT7cL+FR8gE/c6Xh
 COYjEgZJKRsJ4UXvLlPFcW8eV7O29hZBNKDXGPzCtTxlLB73O9nweZavLdCRbBzI
 XLxwdayWTD/a/tamJhRPt46cN1R/e3XDNqvrknPF9UUbVzxhvGXDIKRSnFk+QqDE
 Vdr5ZGAsuGVIuZopGib21qhS0QHxF2qcw7rgDcU1o2WlMB8nZQ74E9TTZB/6qkZk
 Un8YjG3gxVWS4nfw22D/6dugGg8ocNB3kZ80ca0up7NQScJXMDqZ6Bb/P1GtRo5S
 xb2aow+1yRFXgm1BnCXeWD1kqS5bLjC5UCetECiO07azYc9iNfpENU7EVC6SCm8e
 p7P8eVxYWqaZYnuLohQ=
 =KDAh
 -----END PGP SIGNATURE-----

Merge tag 'mmc-v6.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:
 "MMC core:
   - Fix pwrseq for WILC1000/WILC3000 SDIO card

  MMC host:
   - vub300: Fix invalid response handling"

* tag 'mmc-v6.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: pwrseq: sd8787: Fix WILC CHIP_EN and RESETN toggling order
  mmc: vub300: fix invalid response handling
2023-06-02 08:35:13 -04:00
Linus Torvalds
7bdecc2672 IOMMU Fixes for Linux v6.4-rc4
Including:
 
 	- AMD IOMMU fixes:
 	  - Fix domain type and size checks
 	  - IOTLB flush fix for invalidating ranges
 	  - Guest IRQ handling fixes and GALOG overflow fix
 
 	- Rockchip IOMMU:
 	  - Error handling fix
 
 	- Mediatek IOMMU:
 	  - IOTLB flushing fix
 
 	- Renesas IOMMU:
 	  - Fix Kconfig dependencies to avoid build errors on RiscV
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAmR5p6kACgkQK/BELZcB
 GuOMvBAAr6diCW20Jes6debV+mHh1Ty+ZS27v95P4zKxtjIcSdz+zqd2V5nwcivg
 btu69otv4/nyUmaEECRdYkAVX7ADgb3TgC6WsiBFImTnqTo9SIihNGAen5+HXJNW
 b8OHPLbqKba44r66b7NSvoLfFpcN3BsnTFUEtM0Cd/Bub+e4oj0dP2q0PyCmM4Al
 wBOc729srxpm4Zd7eiz6A2XiGFHVbMlNqOtmCcrv4j2t8KfOBJW0FoL/8u0l3IYC
 1G9AsbTQkudUGCoJzcVHzRzj5nfFbagQBVaUD2z6c3C/yKxn+lIoRgzNXwwkAzwY
 0y72QUUO4Pf+fuuE8y3RnDzGA4+TefK+safvk8/ue85I/8K262IA6VCgXsFcMJf4
 lE+bKjzRpzEN+Lsc9s/MlDTju87GugrCXlmjCU8YYCRs7UCyEHsmLfDw8BxqF2aq
 tUiCYYDtU/jDeQoNKQS0p360YDT51ybT5mykeocSI7IKhnv4CVDtGlBR+M8lBbqF
 sPD3HX0xWoBlvcTSgO00hJf3x8akHKavdq4HneiXh04cxDWpmUgQmYQM9SyfctXr
 tKf15Q9iDF7GoIY9BgBDGo8otqDL9wmq9dDpqsh4fLrjgi0j2vyYcXac47LUDdwh
 6ye8L9vuDhEFuPD08vkjfaR1p3N7P7vXuTp8CiC23yIj4zzVQcg=
 =4QRm
 -----END PGP SIGNATURE-----

Merge tag 'iommu-fixes-v6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull iommu fixes from Joerg Roedel:
 "AMD IOMMU fixes:
   - Fix domain type and size checks
   - IOTLB flush fix for invalidating ranges
   - Guest IRQ handling fixes and GALOG overflow fix

  Rockchip IOMMU:
   - Error handling fix

  Mediatek IOMMU:
   - IOTLB flushing fix

  Renesas IOMMU:
   - Fix Kconfig dependencies to avoid build errors on RiscV"

* tag 'iommu-fixes-v6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/mediatek: Flush IOTLB completely only if domain has been attached
  iommu/amd/pgtbl_v2: Fix domain max address
  iommu/amd: Fix domain flush size when syncing iotlb
  iommu/amd: Add missing domain type checks
  iommu/amd: Fix up merge conflict resolution
  iommu/amd: Handle GALog overflows
  iommu/amd: Don't block updates to GATag if guest mode is on
  iommu/rockchip: Fix unwind goto issue
  iommu: Make IPMMU_VMSA dependencies more strict
2023-06-02 08:21:18 -04:00
Jisheng Zhang
0e2aba6948 arm64: mm: pass original fault address to handle_mm_fault() in PER_VMA_LOCK block
When reading the arm64's PER_VMA_LOCK support code, I found a bit
difference between arm64 and other arch when calling handle_mm_fault()
during VMA lock-based page fault handling: the fault address is masked
before passing to handle_mm_fault(). This is also different from the
usage in mmap_lock-based handling. I think we need to pass the
original fault address to handle_mm_fault() as we did in
commit 84c5e23ede ("arm64: mm: Pass original fault address to
handle_mm_fault()").

If we go through the code path further, we can find that the "masked"
fault address can cause mismatched fault address between perf sw
major/minor page fault sw event and perf page fault sw event:

do_page_fault
  perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, ..., addr)   // orig addr
  handle_mm_fault
    mm_account_fault
      perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, ...) // masked addr

Fixes: cd7f176aea ("arm64/mm: try VMA lock-based page fault handling first")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20230524131305.2808-1-jszhang@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2023-06-02 13:02:44 +01:00
Catalin Marinas
f3c3762178 arm64: Remove the ARCH_FORCE_MAX_ORDER config input prompt
Commit 34affcd757 ("arm64: drop ranges in definition of
ARCH_FORCE_MAX_ORDER") dropped the ranges from the config entry and
introduced an EXPERT condition on the input prompt instead.

However, starting with defconfig (ARCH_FORCE_MAX_ORDER of 10) and
setting ARM64_64K_PAGES together with EXPERT leaves MAX_ORDER 10 which
fails to build in this configuration.

Drop the input prompt for ARCH_FORCE_MAX_ORDER completely so that it's
no longer configurable. People requiring a higher MAX_ORDER should send
a patch changing the default, together with proper justification.

Fixes: 34affcd757 ("arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER")
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Justin M. Forbes <jforbes@fedoraproject.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Link: https://lore.kernel.org/r/20230519171440.1941213-1-catalin.marinas@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-06-02 13:00:52 +01:00
Chancel Liu
32cf0046a6
ASoC: fsl_sai: Enable BCI bit if SAI works on synchronous mode with BYP asserted
There's an issue on SAI synchronous mode that TX/RX side can't get BCLK
from RX/TX it sync with if BYP bit is asserted. It's a workaround to
fix it that enable SION of IOMUX pad control and assert BCI.

For example if TX sync with RX which means both TX and RX are using clk
form RX and BYP=1. TX can get BCLK only if the following two conditions
are valid:
1. SION of RX BCLK IOMUX pad is set to 1
2. BCI of TX is set to 1

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230530103012.3448838-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-02 12:54:07 +01:00
Robert Hancock
635071f5fe
ASoC: simple-card-utils: fix PCM constraint error check
The code in asoc_simple_startup was treating any non-zero return from
snd_pcm_hw_constraint_minmax as an error, when this can return 1 in some
normal cases and only negative values indicate an error.

When this happened, it caused asoc_simple_startup to disable the clocks
it just enabled and return 1, which was not treated as an error by the
calling code which only checks for negative return values. Then when the
PCM is eventually shut down, it causes the clock framework to complain
about disabling clocks that were not enabled.

Fix the check for snd_pcm_hw_constraint_minmax return value to only
treat negative values as an error.

Fixes: 5ca2ab4598 ("ASoC: simple-card-utils: Add new system-clock-fixed flag")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20230602011936.231931-1-robert.hancock@calian.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-02 12:54:06 +01:00
Linus Torvalds
e99a74673a drm fixes for v6.4-rc5
amdgpu:
 - Fix mclk and fclk output ordering on some APUs
 - Fix display regression with 5K VRR
 - VCN, JPEG spurious interrupt warning fixes
 - Fix SI DPM on some ARM64 platforms
 - Fix missing TMZ enablement on GC 11.0.1
 
 i915:
 - Fix for OA reporting to allow detecting non-power-of-two reports
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEEKbZHaGwW9KfbeusDHTzWXnEhr4FAmR5ZQkACgkQDHTzWXnE
 hr521xAAiJ00YmeEh05W7E2ZruSqnI+sAAIv6vjKCfOe9mQWdF6eEIbM1YmpEF19
 Y4G08gaA34pyAnY9mFCNElK5Ec12/7VXjIF3MZ5arHyv4XMxGFTApvJSWXt8Y//B
 +lp9WR+knlBx82JhNowqQuV70IUjPaZfdJCn4Nf1k6U7hsfEPO0m8vjJnYNRUrbp
 PZrX7lrQl/jXxDNaCnsILKTSyhI3VxVIcdWMdMU6A0QIsi5tvrfoc0UZwZxQdjTw
 CJbiR5qW/u4Wde1vKFsFV1ks45PdkuKyiqL5CsfDn8YsGdUFvTqPeIGqA22BA6No
 Akuo+hO+Y97RkwCEZ19ncv1+TR9fmLq0nBY9zy5v1CDCwIfEGOQs7m8PHqVfqrsS
 Y8WvazEbsXVGJUzNPafYg3nDxHmo4ikp3ozz1wkgqpuVmvab20a229fTYtNf3MuN
 tOcXOojYGu0QT3RcXkaMUAas/goDaftBcn7cnOrnhaW6SZYeFmz2GKUtRXmX9AqV
 UdlqrnUFBEGJkQa7IxXCZvh3jBCfU8QXNajopzgBe/aycy8X/TmF1dngOeZu7t1u
 o0PHDf4RMGbQSrTIFVlyZ/Iu6nMzekxD8itIHZowzaehiBC329VqVWua0y4HQ4No
 4lKrYWf4Pw+4iVStyoZJQTojeoXLxbmyEClgn0aENfMqgW6r+8c=
 =O8fG
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2023-06-02' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Quiet enough week, though the misc fixes tree didn't get to me when I
  was sending this, so maybe it'll be a bit bigger next week, just one
  i915 fix and some scattered amdgpu fixes:

  amdgpu:
   - Fix mclk and fclk output ordering on some APUs
   - Fix display regression with 5K VRR
   - VCN, JPEG spurious interrupt warning fixes
   - Fix SI DPM on some ARM64 platforms
   - Fix missing TMZ enablement on GC 11.0.1

  i915:
   - Fix for OA reporting to allow detecting non-power-of-two reports"

* tag 'drm-fixes-2023-06-02' of git://anongit.freedesktop.org/drm/drm:
  drm/i915/perf: Clear out entire reports after reading if not power of 2 size
  drm/amdgpu: enable tmz by default for GC 11.0.1
  drm/amd/pm: resolve reboot exception for si oland
  drm/amdgpu: add RAS POISON interrupt funcs for jpeg_v4_0
  drm/amdgpu: add RAS POISON interrupt funcs for jpeg_v2_6
  drm/amdgpu: separate ras irq from jpeg instance irq for UVD_POISON
  drm/amdgpu: add RAS POISON interrupt funcs for vcn_v4_0
  drm/amdgpu: add RAS POISON interrupt funcs for vcn_v2_6
  drm/amdgpu: separate ras irq from vcn instance irq for UVD_POISON
  Revert "drm/amd/display: Do not set drr on pipe commit"
  Revert "drm/amd/display: Block optimize on consecutive FAMS enables"
  drm/amd/pm: reverse mclk and fclk clocks levels for renoir
  drm/amd/pm: reverse mclk and fclk clocks levels for vangogh
  drm/amd/pm: reverse mclk and fclk clocks levels for yellow carp
  drm/amd/pm: reverse mclk clocks levels for SMU v13.0.5
  drm/amd/pm: reverse mclk and fclk clocks levels for SMU v13.0.4
2023-06-02 07:42:22 -04:00
Linus Torvalds
1419c3ba31 selinux/stable-6.4 PR 20230601
-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCAAyFiEES0KozwfymdVUl37v6iDy2pc3iXMFAmR4/dIUHHBhdWxAcGF1
 bC1tb29yZS5jb20ACgkQ6iDy2pc3iXMvYBAAttzWiMKgLTIEOaa4QQHG1EqtgQ06
 pFeGDkmoKh4/3HlBorqbm/VHGeyJKjc7Tgul4MBf1+qB+3Dttr/D42MUs0e8ntki
 6U5OPCLZzGCDckYvbP/SbBsF+hUg4Xakz++C/B2RE7yPntm6U4xKyslEBBmWnZoV
 xMsM2wwQ9ManQWCFtajMds5X/jy7MKddph8mhP8IwgjmJ8i6nZW3Im++GSpDVwRe
 i/rU3PT5UVAvvu5rUROrM0VHX0SBxcn2Cv9mEfvuMKYMxqsH7usWEgVOoxCsLTA3
 lUQvZNHbFGjNnoc9gKahKotuv/TIKiUT1VSpYY7dyAZVkR8g7wiURIa85QrlZsP6
 QY1Yy/BMuzTgiAMO1WMEa+gr0mVRLyEf7lu1tWeXIVLY7xIxddAwSvVKrJ9Z3LYS
 VGGK2vYQDnW5lnCykKNGYCZvmiGfC4yw2BoalM7/iC2VxuGIo1/sV7L8pEwK5fEU
 jCQOAGdOPQtYhAiebIn/bRKbYvJJuQc47umLJ1lpKekBBv4R+qI42EV4n1WcgsJ6
 GwwxGUiVTfLgD3D5A5xrq9Cq9/sT26arhSrtIV71dG+CDtahz3Jhpj9pqYGSMATZ
 O2GyQsLjNmic23htH6ELLU67tXaiuV+7OK6kr2NU/en7Pn9JQiB7SN2XW2IqMPHT
 z6i4XqtMyKPuF3k=
 =VnYa
 -----END PGP SIGNATURE-----

Merge tag 'selinux-pr-20230601' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux

Pull selinux fix from Paul Moore:
 "A small SELinux Makefile fix to resolve a problem seen when building
  the kernel with older versions of make.

  The fix is pretty trivial and effectively reverts a patch that was
  merged during the last merge window"

* tag 'selinux-pr-20230601' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
  selinux: don't use make's grouped targets feature yet
2023-06-02 07:30:27 -04:00
Arnd Bergmann
37a826d86f net: dsa: qca8k: add CONFIG_LEDS_TRIGGERS dependency
Without LED triggers, the driver now fails to build:

drivers/net/dsa/qca/qca8k-leds.c: In function 'qca8k_parse_port_leds':
drivers/net/dsa/qca/qca8k-leds.c:403:31: error: 'struct led_classdev' has no member named 'hw_control_is_supported'
  403 |                 port_led->cdev.hw_control_is_supported = qca8k_cled_hw_control_is_supported;
      |                               ^

There is a mix of 'depends on' and 'select' for LEDS_TRIGGERS, so it's
not clear what we should use here, but in general using 'depends on'
causes fewer problems, so use that.

Fixes: e0256648c8 ("net: dsa: qca8k: implement hw_control ops")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-06-02 10:55:41 +01:00
Jiasheng Jiang
f93b30e50a net: systemport: Replace platform_get_irq with platform_get_irq_optional
Replace platform_get_irq with platform_get_irq_optional because wol_irq
is optional.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-06-02 09:56:23 +01:00
Akihiro Suda
e209fee411 net/ipv4: ping_group_range: allow GID from 2147483648 to 4294967294
With this commit, all the GIDs ("0 4294967294") can be written to the
"net.ipv4.ping_group_range" sysctl.

Note that 4294967295 (0xffffffff) is an invalid GID (see gid_valid() in
include/linux/uidgid.h), and an attempt to register this number will cause
-EINVAL.

Prior to this commit, only up to GID 2147483647 could be covered.
Documentation/networking/ip-sysctl.rst had "0 4294967295" as an example
value, but this example was wrong and causing -EINVAL.

Fixes: c319b4d76b ("net: ipv4: add IPPROTO_ICMP socket kind")
Co-developed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-06-02 09:55:22 +01:00
Alexander Sverdlin
5a59a58ec2 net: dsa: lan9303: allow vid != 0 in port_fdb_{add|del} methods
LAN9303 doesn't associate FDB (ALR) entries with VLANs, it has just one
global Address Logic Resolution table [1].

Ignore VID in port_fdb_{add|del} methods, go on with the global table. This
is the same semantics as hellcreek or RZ/N1 implement.

Visible symptoms:
LAN9303_MDIO 5b050000.ethernet-1:00: port 2 failed to delete 00:xx:xx:xx:xx:cf vid 1 from fdb: -2
LAN9303_MDIO 5b050000.ethernet-1:00: port 2 failed to add 00:xx:xx:xx:xx:cf vid 1 to fdb: -95

[1] https://ww1.microchip.com/downloads/en/DeviceDoc/00002308A.pdf

Fixes: 0620427ea0 ("net: dsa: lan9303: Add fdb/mdb manipulation")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20230531143826.477267-1-alexander.sverdlin@siemens.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 21:45:22 -07:00
Qingfang DENG
ed779fe4c9 neighbour: fix unaligned access to pneigh_entry
After the blamed commit, the member key is longer 4-byte aligned. On
platforms that do not support unaligned access, e.g., MIPS32R2 with
unaligned_action set to 1, this will trigger a crash when accessing
an IPv6 pneigh_entry, as the key is cast to an in6_addr pointer.

Change the type of the key to u32 to make it aligned.

Fixes: 62dd93181a ("[IPV6] NDISC: Set per-entry is_router flag in Proxy NA.")
Signed-off-by: Qingfang DENG <qingfang.deng@siflower.com.cn>
Link: https://lore.kernel.org/r/20230601015432.159066-1-dqfext@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 21:36:37 -07:00
Alexandre Ghiti
6966d7988c
riscv: Implement missing huge_ptep_get
huge_ptep_get must be reimplemented in order to go through all the PTEs
of a NAPOT region: this is needed because the HW can update the A/D bits
of any of the PTE that constitutes the NAPOT region.

Fixes: 82a1a1f3bf ("riscv: mm: support Svnapot in hugetlb page")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20230428120120.21620-2-alexghiti@rivosinc.com
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-06-01 18:15:37 -07:00
Alexandre Ghiti
835e5ac3f9
riscv: Fix huge_ptep_set_wrprotect when PTE is a NAPOT
We need to avoid inconsistencies across the PTEs that form a NAPOT
region, so when we write protect such a region, we should clear and flush
all the PTEs to make sure that any of those PTEs is not cached which would
result in such inconsistencies (arm64 does the same).

Fixes: 82a1a1f3bf ("riscv: mm: support Svnapot in hugetlb page")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20230428120120.21620-1-alexghiti@rivosinc.com
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-06-01 18:15:20 -07:00
Linus Torvalds
c43a6ff9f9 modules-6.4-rc5-second-pull
A zstd fix by lucas as he tested zstd decompression support
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCgAwFiEENnNq2KuOejlQLZofziMdCjCSiKcFAmR5D8USHG1jZ3JvZkBr
 ZXJuZWwub3JnAAoJEM4jHQowkoingK8P/3XmCG83G1JULOgFso657i1qdsVbqQek
 Qzo7t9IniifEYZPu8+BTplrtwP3G7x9xlci94JWSftaDvRCWh7kULJ2EMYe61aQk
 eEiYu79AYQYDAYx2mUacvf8QeSWoJmxY7DyUHt9eZQTJ90VN6/svKThxLk2HbQvR
 LtDryHVJqVnH2iSdkP3GA/kVulvLfrQ4+entVhr609kFsvZz21WICtnPU5/xu3PJ
 /Cb8T5FvTjQO6+nCjKMWlBM5sfXSQDxMqcnppZO/sed0yPP47hGzljJM2tlWNkK7
 qb7IrXYW4SowjcIGzQIFHbPSBRM+02hhIF0iSK66kGVrDHocJ1u2pKhhzgsnZdfk
 Wjr1R1CHAthjr1e1S4sFAnl3VTXBCPtC2L2SdCR3aGb1EB2bEjPmZTex6HWWNeCV
 iBVLdJxyt0K6NQTlFe4b5ZE5j0JB2h/uDSpY9OrwMwkVA4BptKRlkUt+4EliPeaf
 lBNABLFDSK82x7bL9MSurzJhLOumj/9CMpl/WkwJYsT5RK5zkfcLpmh6YuRQlA/1
 xR4NKlJn3pVGjXrmAl2t6VJrSa/wCQjkUzd1xyilLI/oxk4uxelGFJiofCyl4zSF
 +A0MHbvrL6N8x6conbfWkQ4cFgSGLSneB5UgVe9myl2b/P3n6PCgyghulo7F9JYj
 G65Ty9CqKJRm
 =FVHd
 -----END PGP SIGNATURE-----

Merge tag 'modules-6.4-rc5-second-pull' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux

Pull modules fix from Luis Chamberlain:
 "A zstd fix by lucas as he tested zstd decompression support"

* tag 'modules-6.4-rc5-second-pull' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
  module/decompress: Fix error checking on zstd decompression
2023-06-01 20:48:16 -04:00
Linus Torvalds
792fc92140 First batch of EFI fixes for v6.4:
- fix harmless warning in zboot code on 'make clean'
 - add some missing prototypes
 - fix boot regressions triggered by PE/COFF header image minor version
   bump
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQQm/3uucuRGn1Dmh0wbglWLn0tXAUCZHjJNQAKCRAwbglWLn0t
 XKrjAP9ZFwTZWvYKGWFYi119egU+HjpZmY8ccIG35sVt4TKRbgEAnTiMVWEggkuR
 ETAd8mpk4pFjfa8yIY06Tdy3kjqIzgM=
 =egis
 -----END PGP SIGNATURE-----

Merge tag 'efi-fixes-for-v6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:
 "A few minor fixes for EFI, one of which fixes the reported boot
  regression when booting x86 kernels using the BIOS based loader built
  into the hypervisor framework on macOS.

   - fix harmless warning in zboot code on 'make clean'

   - add some missing prototypes

   - fix boot regressions triggered by PE/COFF header image minor
     version bump"

* tag 'efi-fixes-for-v6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi: Bump stub image version for macOS HVF compatibility
  efi: fix missing prototype warnings
  efi/libstub: zboot: Avoid eager evaluation of objcopy flags
2023-06-01 20:43:11 -04:00
Dave Airlie
b6ccf213d9 Merge tag 'drm-intel-fixes-2023-06-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Fix for OA reporting to allow detecting non-power-of-two reports

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZHimf55x/DyXYar1@jlahtine-mobl.ger.corp.intel.com
2023-06-02 10:33:29 +10:00
Dave Airlie
f9e94d6c85 Merge tag 'amd-drm-fixes-6.4-2023-05-31' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.4-2023-05-31:

amdgpu:
- Fix mclk and fclk output ordering on some APUs
- Fix display regression with 5K VRR
- VCN, JPEG spurious interrupt warning fixes
- Fix SI DPM on some ARM64 platforms
- Fix missing TMZ enablement on GC 11.0.1

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230601033846.7628-1-alexander.deucher@amd.com
2023-06-02 09:52:48 +10:00
Linus Torvalds
9e87b63ed3 fbdev fixes for kernel 6.4-rc5:
- Fix null-ptr-deref in soft_cursor
 - various remove callback conversions
 - error path fixes in imsttfb
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCZHjvfAAKCRD3ErUQojoP
 X4JlAP49ZIcuvWmToI37vaDdMrkatfLRfZqzMunNIOs1wapYTQD+POy9HnqmPhVP
 rNxGNkgrqWciMxdidJ1yKdZ2NQlOegM=
 =QD77
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-for-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes from Helge Deller:
 "Most notable is a fix for a null-ptr-deref in fbcon's soft_cursor
  function which was found by syzbot.

   - Fix null-ptr-deref in soft_cursor

   - various remove callback conversions

   - error path fixes in imsttfb"

* tag 'fbdev-for-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: bw2: Convert to platform remove callback returning void
  fbdev: broadsheetfb: Convert to platform remove callback returning void
  fbdev: au1200fb: Convert to platform remove callback returning void
  fbdev: au1100fb: Convert to platform remove callback returning void
  fbdev: arcfb: Convert to platform remove callback returning void
  fbdev: au1100fb: Drop if with an always false condition
  fbcon: Fix null-ptr-deref in soft_cursor
  fbdev: imsttfb: Fix error path of imsttfb_probe()
  fbdev: imsttfb: Release framebuffer and dealloc cmap on error path
  fbdev: matroxfb ssd1307fb: Switch i2c drivers back to use .probe()
2023-06-01 17:50:22 -04:00
Lucas De Marchi
fadb74f9f2 module/decompress: Fix error checking on zstd decompression
While implementing support for in-kernel decompression in kmod,
finit_module() was returning a very suspicious value:

	finit_module(3, "", MODULE_INIT_COMPRESSED_FILE) = 18446744072717407296

It turns out the check for module_get_next_page() failing is wrong,
and hence the decompression was not really taking place. Invert
the condition to fix it.

Fixes: 169a58ad82 ("module/decompress: Support zstd in-kernel decompression")
Cc: stable@kernel.org
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2023-06-01 14:36:46 -07:00
Linus Torvalds
b0e78154c0 MTD core:
* MAINTAINERS: Add Michal as reviewer instead of Naga
 * mtdchar: Mark bits of ioctl handler noinline
 
 NAND controller drivers:
 * marvell:
   - Don't set the NAND frequency select
   - Ensure timing values are written
 * ingenic: Fix empty stub helper definitions
 
 SPI-NOR core:
 * Fix divide by zero for spi-nor-generic flashes
 
 SPI-NOR manufacturer driver:
 * spansion: make sure local struct does not contain garbage
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEE9HuaYnbmDhq/XIDIJWrqGEe9VoQFAmR4w7AACgkQJWrqGEe9
 VoRMNwf8CNORYRAhsTBSszrkEV34PP90nqXHurybnaYCUWmGWInZYqUlFWqwk1II
 eIB09X/Zq6lF8g3OmARRSpZk2OZLHfETH1OVh4Suow1aMJXz8I0gALBC5JnExYJB
 QqiSrMyjNDG3fVDTyn8ZY5x8ZTqtrQeQ9bdhZI+xL2O8pjwWC5f996CH2KPxrZdr
 y4oiTfmFeS8tsGoWmxpskGr9Sd9BwIAUuU1Ga/SlzeJmUIzOLLKDxiQtKutTJrKB
 4R0DJHFV6un90qxUENuQjlkhOv7M5DPtV4hX/ipDBgKSP40aU7VHUa2IhaCJekT7
 VnVuEqEd+jIQbpQvYNhqxsmjKk/f5w==
 =GfjP
 -----END PGP SIGNATURE-----

Merge tag 'mtd/fixes-for-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux

Pull mtd fixes from Miquel Raynal:
 "MTD core:
   - MAINTAINERS: Add Michal as reviewer instead of Naga
   - mtdchar: Mark bits of ioctl handler noinline

  NAND controller drivers:
   - marvell:
       - Don't set the NAND frequency select
       - Ensure timing values are written
   - ingenic: Fix empty stub helper definitions

  SPI-NOR core:
   - Fix divide by zero for spi-nor-generic flashes

  SPI-NOR manufacturer driver:
   - spansion: make sure local struct does not contain garbage"

* tag 'mtd/fixes-for-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
  mtd: rawnand: marvell: don't set the NAND frequency select
  mtd: rawnand: marvell: ensure timing values are written
  mtdchar: mark bits of ioctl handler noinline
  MAINTAINERS: Add myself as reviewer instead of Naga
  mtd: spi-nor: Fix divide by zero for spi-nor-generic flashes
  mtd: rawnand: ingenic: fix empty stub helper definitions
  mtd: spi-nor: spansion: make sure local struct does not contain garbage
2023-06-01 17:35:17 -04:00
Linus Torvalds
714069daa5 Fairly standard-sized batch of fixes, accounting for the lack of
sub-tree submissions this week. The mlx5 IRQ fixes are notable,
 people were complaining about that. No fires burning.
 
 Current release - regressions:
 
  - eth: mlx5e:
    - multiple fixes for dynamic IRQ allocation
    - prevent encap offload when neigh update is running
 
  - eth: mana: fix perf regression: remove rx_cqes, tx_cqes counters
 
 Current release - new code bugs:
 
  - eth: mlx5e: DR, add missing mutex init/destroy in pattern manager
 
 Previous releases - always broken:
 
  - tcp: deny tcp_disconnect() when threads are waiting
 
  - sched: prevent ingress Qdiscs from getting installed in random
    locations in the hierarchy and moving around
 
  - sched: flower: fix possible OOB write in fl_set_geneve_opt()
 
  - netlink: fix NETLINK_LIST_MEMBERSHIPS length report
 
  - udp6: fix race condition in udp6_sendmsg & connect
 
  - tcp: fix mishandling when the sack compression is deferred
 
  - rtnetlink: validate link attributes set at creation time
 
  - mptcp: fix connect timeout handling
 
  - eth: stmmac: fix call trace when stmmac_xdp_xmit() is invoked
 
  - eth: amd-xgbe: fix the false linkup in xgbe_phy_status
 
  - eth: mlx5e:
    - fix corner cases in internal buffer configuration
    - drain health before unregistering devlink
 
  - usb: qmi_wwan: set DTR quirk for BroadMobi BM818
 
 Misc:
 
  - tcp: return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if user_mss set
 
 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE6jPA+I1ugmIBA4hXMUZtbf5SIrsFAmR42fUACgkQMUZtbf5S
 IrtD7w//R4zkxkNpT/pTmBsbm4zA7MSttPEW07HPTBXcMBbJMPV3pEyo18Pezm/a
 kJLO+2mvNTz/S74WAU0H2M3ux2I+Uc/srRXroff52ttCeV7mO/OHPAYBna0PqDoq
 O5A+laSGxaq3ulmLJdbE0SMhrH4t6iCeelEFUw03q49XhEKQlfgSHW4+lws16ffE
 Togxy1Iip8PXCMYXqWb1Hc0MFqF+2MdPm8YVaIfYRuFrI56apdknywrKuHYwk7kl
 gsy8hKHRJDRQy5RjmHDgbsLm4RCr2abHOe2mYwtdGAXWfvdRUI4HGeFYtc/b5i32
 55WAkegBzZPVkql7OLQM1N0hZYjz7JdAV/MiT8Taf8kSJGmLNbQxgJxgF8t8xj8S
 9ddUGSuxOhKBU3jeen6zjenVVbKWXXHDHICS3T5j/rlGUeeUmfgmLyvZ3PfYQeHA
 gibfLsq2KQqYQDKESO97hfORXnBV+dP0xXPMNcjKLNx+NnmhmaCI4vVYPfLc7X02
 1XqApdfhR/CK2ytNTATDVQdP72xyhtuqRTuhWEYi0q5UYQamTCXt+mDG7DKXfCj5
 cyJOcFNOJQH14XKiiAxf0IkD2VimuPVYxuhebTu79YQTXSqf6sUw67pLJ7i8LhUW
 tQMM4qOCcIH7y1qJvHbUFDa/4fK/+HnnmC2H3LH/Q8wtpZLKgRU=
 =o77c
 -----END PGP SIGNATURE-----

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

Pull networking fixes from Jakub Kicinski:
 "Happy Wear a Dress Day.

  Fairly standard-sized batch of fixes, accounting for the lack of
  sub-tree submissions this week. The mlx5 IRQ fixes are notable, people
  were complaining about that. No fires burning.

  Current release - regressions:

   - eth: mlx5e:
      - multiple fixes for dynamic IRQ allocation
      - prevent encap offload when neigh update is running

   - eth: mana: fix perf regression: remove rx_cqes, tx_cqes counters

  Current release - new code bugs:

   - eth: mlx5e: DR, add missing mutex init/destroy in pattern manager

  Previous releases - always broken:

   - tcp: deny tcp_disconnect() when threads are waiting

   - sched: prevent ingress Qdiscs from getting installed in random
     locations in the hierarchy and moving around

   - sched: flower: fix possible OOB write in fl_set_geneve_opt()

   - netlink: fix NETLINK_LIST_MEMBERSHIPS length report

   - udp6: fix race condition in udp6_sendmsg & connect

   - tcp: fix mishandling when the sack compression is deferred

   - rtnetlink: validate link attributes set at creation time

   - mptcp: fix connect timeout handling

   - eth: stmmac: fix call trace when stmmac_xdp_xmit() is invoked

   - eth: amd-xgbe: fix the false linkup in xgbe_phy_status

   - eth: mlx5e:
      - fix corner cases in internal buffer configuration
      - drain health before unregistering devlink

   - usb: qmi_wwan: set DTR quirk for BroadMobi BM818

  Misc:

   - tcp: return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if
     user_mss set"

* tag 'net-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (71 commits)
  mptcp: fix active subflow finalization
  mptcp: add annotations around sk->sk_shutdown accesses
  mptcp: fix data race around msk->first access
  mptcp: consolidate passive msk socket initialization
  mptcp: add annotations around msk->subflow accesses
  mptcp: fix connect timeout handling
  rtnetlink: add the missing IFLA_GRO_ tb check in validate_linkmsg
  rtnetlink: move IFLA_GSO_ tb check to validate_linkmsg
  rtnetlink: call validate_linkmsg in rtnl_create_link
  ice: recycle/free all of the fragments from multi-buffer frame
  net: phy: mxl-gpy: extend interrupt fix to all impacted variants
  net: renesas: rswitch: Fix return value in error path of xmit
  net: dsa: mv88e6xxx: Increase wait after reset deactivation
  net: ipa: Use correct value for IPA_STATUS_SIZE
  tcp: fix mishandling when the sack compression is deferred.
  net/sched: flower: fix possible OOB write in fl_set_geneve_opt()
  sfc: fix error unwinds in TC offload
  net/mlx5: Read embedded cpu after init bit cleared
  net/mlx5e: Fix error handling in mlx5e_refresh_tirs
  net/mlx5: Ensure af_desc.mask is properly initialized
  ...
2023-06-01 17:29:18 -04:00
Mike Christie
f9010dbdce fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
When switching from kthreads to vhost_tasks two bugs were added:
1. The vhost worker tasks's now show up as processes so scripts doing
ps or ps a would not incorrectly detect the vhost task as another
process.  2. kthreads disabled freeze by setting PF_NOFREEZE, but
vhost tasks's didn't disable or add support for them.

To fix both bugs, this switches the vhost task to be thread in the
process that does the VHOST_SET_OWNER ioctl, and has vhost_worker call
get_signal to support SIGKILL/SIGSTOP and freeze signals. Note that
SIGKILL/STOP support is required because CLONE_THREAD requires
CLONE_SIGHAND which requires those 2 signals to be supported.

This is a modified version of the patch written by Mike Christie
<michael.christie@oracle.com> which was a modified version of patch
originally written by Linus.

Much of what depended upon PF_IO_WORKER now depends on PF_USER_WORKER.
Including ignoring signals, setting up the register state, and having
get_signal return instead of calling do_group_exit.

Tidied up the vhost_task abstraction so that the definition of
vhost_task only needs to be visible inside of vhost_task.c.  Making
it easier to review the code and tell what needs to be done where.
As part of this the main loop has been moved from vhost_worker into
vhost_task_fn.  vhost_worker now returns true if work was done.

The main loop has been updated to call get_signal which handles
SIGSTOP, freezing, and collects the message that tells the thread to
exit as part of process exit.  This collection clears
__fatal_signal_pending.  This collection is not guaranteed to
clear signal_pending() so clear that explicitly so the schedule()
sleeps.

For now the vhost thread continues to exist and run work until the
last file descriptor is closed and the release function is called as
part of freeing struct file.  To avoid hangs in the coredump
rendezvous and when killing threads in a multi-threaded exec.  The
coredump code and de_thread have been modified to ignore vhost threads.

Remvoing the special case for exec appears to require teaching
vhost_dev_flush how to directly complete transactions in case
the vhost thread is no longer running.

Removing the special case for coredump rendezvous requires either the
above fix needed for exec or moving the coredump rendezvous into
get_signal.

Fixes: 6e890c5d50 ("vhost: use vhost_tasks for worker threads")
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Co-developed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-06-01 17:15:33 -04:00
Francesco Dolcini
403e97d6ab dt-bindings: serial: 8250_omap: add rs485-rts-active-high
Add rs485-rts-active-high property, this was removed by mistake.
In general we just use rs485-rts-active-low property, however the OMAP
UART for legacy reason uses the -high one.

Fixes: 767d3467eb ("dt-bindings: serial: 8250_omap: drop rs485 properties")
Closes: https://lore.kernel.org/all/ZGefR4mTHHo1iQ7H@francesco-nb.int.toradex.com/
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230531111038.6302-1-francesco@dolcini.it
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-01 19:04:00 +01:00
Paul Moore
42c4e97e06 selinux: don't use make's grouped targets feature yet
The Linux Kernel currently only requires make v3.82 while the grouped
target functionality requires make v4.3.  Removed the grouped target
introduced in 4ce1f694eb ("selinux: ensure av_permissions.h is
built when needed") as well as the multiple header file targets in
the make rule.  This effectively reverts the problem commit.

We will revisit this change when make >= 4.3 is required by the rest
of the kernel.

Cc: stable@vger.kernel.org
Fixes: 4ce1f694eb ("selinux: ensure av_permissions.h is built when needed")
Reported-by: Erwan Velu <e.velu@criteo.com>
Reported-by: Luiz Capitulino <luizcap@amazon.com>
Tested-by: Luiz Capitulino <luizcap@amazon.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2023-06-01 13:56:13 -04:00
Jakub Kicinski
a451b8eb96 mlx5-fixes-2023-05-31
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEGhZs6bAKwk/OTgTpSD+KveBX+j4FAmR4C7UACgkQSD+KveBX
 +j43QQgAm2KnMLUmtSHBFgyFEh7udVTK2XKH8RFwcQ9rhGnpAaDMhZY40oNLuNZv
 i+yMl1dfopNr9SxfQQdyPAbS138rfCIxZi7F26PBAaaPJ6WS1Ds5qIpyS8Dt8FFW
 w2+AS5RXDCZwoa0OYZYqXYnsWtRCjAO7KEChbif26ruuN9alu3ll+b074xup8a8q
 +j3Guk5zFHsf9Qz+RZIXrUj//qoWpsmyKdcVlr/vsWra9Y31tpymtEp7mplUrZmu
 xAmYoRssFiYYGxl5oVIpTzyzGBLxbDrpQiBHZH+XjUmGVYeEUFsVMgCcvLs5VjeF
 wvcEFMTPcuAdkkXzNa2txEznYf53Bg==
 =vNQo
 -----END PGP SIGNATURE-----

Merge tag 'mlx5-fixes-2023-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5 fixes 2023-05-31

This series provides bug fixes to mlx5 driver.

* tag 'mlx5-fixes-2023-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
  net/mlx5: Read embedded cpu after init bit cleared
  net/mlx5e: Fix error handling in mlx5e_refresh_tirs
  net/mlx5: Ensure af_desc.mask is properly initialized
  net/mlx5: Fix setting of irq->map.index for static IRQ case
  net/mlx5: Remove rmap also in case dynamic MSIX not supported
====================

Link: https://lore.kernel.org/r/20230601031051.131529-1-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 10:15:43 -07:00
Jens Axboe
2e45a49531 nvme fixes for Linux 6.4
- Fixes for spurious Keep Alive timeouts (Uday)
  - Fix for command type check on passthrough actions (Min)
  - Fix for nvme command name for error logging (Christoph)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE3Fbyvv+648XNRdHTPe3zGtjzRgkFAmR4uxMACgkQPe3zGtjz
 Rgli9hAAsrGDFzSKhJL4Yu6qNIJPEmEcMs1cgQxg6p820DNiJq7lIBxcclczydOT
 P6aKrxm1e2u07Kig4hnVmsPBZHh808EFDCsbm1MgZDfJp6yyLJLlemBtMK3NWe5s
 Vkc/DcUGMDsKW7ZChmu3+xAv+sWayGOA6x7Ad71KLLErI9w2vyIWD6t+7wSnvKnS
 U/yPvmFmy4366qVWCpDurdXnA7jr0vPkQaOo4kqe7rQScKY66CKErdD1SxXCzsS2
 e4G28AZYj5DevzUPMI2TqCal+xjjU5iiy5YWOB6GQTVhIUV6qESV5lNkc0BetCit
 qZNUvRnZ5JjyFCRQEEvoTsX66QZhHp2K403MVNIN+vqcBKNLjvv6UIa+F5Ny2ztb
 osYJ6kpHxQ1bt7iI03OObpiH8CMtcFq1viIYLLXOzyAdGesTkXh2A9hZEtPbV6so
 FlAsBlVZrrmDfPLuOPPssdK8ktsC6QMSKrQVzO5bFRhjCEerLJfsMqbdYQjCsi/R
 nYbb9iuziO5x/j7JhFSoDccCpjcyAhM9bnbTFqeloKWoBtmeFIbx3fW00e27yDt4
 Y0k4S/tXEc/934ItSjTe/ztiXPg/jgp2OctAudpDhr+334aTsAbjxz7zT/aLIeHd
 jvoTEi6Uf2stSsocNFU8YzVhvXnwKoUu39bjmJix/YSTiD0AY5o=
 =9d+f
 -----END PGP SIGNATURE-----

Merge tag 'nvme-6.4-2023-06-01' of git://git.infradead.org/nvme into block-6.4

Pull NVMe fixes from Keith:

"nvme fixes for Linux 6.4

 - Fixes for spurious Keep Alive timeouts (Uday)
 - Fix for command type check on passthrough actions (Min)
 - Fix for nvme command name for error logging (Christoph)"

* tag 'nvme-6.4-2023-06-01' of git://git.infradead.org/nvme:
  nvme: fix the name of Zone Append for verbose logging
  nvme: improve handling of long keep alives
  nvme: check IO start time when deciding to defer KA
  nvme: double KA polling frequency to avoid KATO with TBKAS on
  nvme: fix miss command type check
2023-06-01 11:12:46 -06:00
Ism Hong
9a7e8ec0d4
riscv: perf: Fix callchain parse error with kernel tracepoint events
For RISC-V, when tracing with tracepoint events, the IP and status are
set to 0, preventing the perf code parsing the callchain and resolving
the symbols correctly.

 ./ply 'tracepoint:kmem/kmem_cache_alloc { @[stack]=count(); }'
 @:
 { <STACKID4294967282> }: 1

The fix is to implement perf_arch_fetch_caller_regs for riscv, which
fills several necessary registers used for callchain unwinding,
including epc, sp, s0 and status. It's similar to commit b3eac0265b
("arm: perf: Fix callchain parse error with kernel tracepoint events")
and commit 5b09a094f2 ("arm64: perf: Fix callchain parse error with
kernel tracepoint events").

With this patch, callchain can be parsed correctly as:

 ./ply 'tracepoint:kmem/kmem_cache_alloc { @[stack]=count(); }'
 @:
 {
         __traceiter_kmem_cache_alloc+68
         __traceiter_kmem_cache_alloc+68
         kmem_cache_alloc+354
         __sigqueue_alloc+94
         __send_signal_locked+646
         send_signal_locked+154
         do_send_sig_info+84
         __kill_pgrp_info+130
         kill_pgrp+60
         isig+150
         n_tty_receive_signal_char+36
         n_tty_receive_buf_standard+2214
         n_tty_receive_buf_common+280
         n_tty_receive_buf2+26
         tty_ldisc_receive_buf+34
         tty_port_default_receive_buf+62
         flush_to_ldisc+158
         process_one_work+458
         worker_thread+138
         kthread+178
         riscv_cpufeature_patch_func+832
  }: 1

Signed-off-by: Ism Hong <ism.hong@gmail.com>
Link: https://lore.kernel.org/r/20230601095355.1168910-1-ism.hong@gmail.com
Fixes: 178e9fc47a ("perf: riscv: preliminary RISC-V support")
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-06-01 10:09:22 -07:00
Jakub Kicinski
66dd101487 Merge branch 'mptcp-fixes-for-connect-timeout-access-annotations-and-subflow-init'
Mat Martineau says:

====================
mptcp: Fixes for connect timeout, access annotations, and subflow init

Patch 1 allows the SO_SNDTIMEO sockopt to correctly change the connect
timeout on MPTCP sockets.

Patches 2-5 add READ_ONCE()/WRITE_ONCE() annotations to fix KCSAN issues.

Patch 6 correctly initializes some subflow fields on outgoing connections.
====================

Link: https://lore.kernel.org/r/20230531-send-net-20230531-v1-0-47750c420571@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 10:04:06 -07:00
Paolo Abeni
55b47ca7d8 mptcp: fix active subflow finalization
Active subflow are inserted into the connection list at creation time.
When the MPJ handshake completes successfully, a new subflow creation
netlink event is generated correctly, but the current code wrongly
avoid initializing a couple of subflow data.

The above will cause misbehavior on a few exceptional events: unneeded
mptcp-level retransmission on msk-level sequence wrap-around and infinite
mapping fallback even when a MPJ socket is present.

Address the issue factoring out the needed initialization in a new helper
and invoking the latter from __mptcp_finish_join() time for passive
subflow and from mptcp_finish_join() for active ones.

Fixes: 0530020a7c ("mptcp: track and update contiguous data status")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 10:04:04 -07:00
Paolo Abeni
6b9831bfd9 mptcp: add annotations around sk->sk_shutdown accesses
Christoph reported the mptcp variant of a recently addressed plain
TCP issue. Similar to commit e14cadfd80 ("tcp: add annotations around
sk->sk_shutdown accesses") add READ/WRITE ONCE annotations to silence
KCSAN reports around lockless sk_shutdown access.

Fixes: 71ba088ce0 ("mptcp: cleanup accept and poll")
Reported-by: Christoph Paasch <cpaasch@apple.com>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/401
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 10:04:04 -07:00
Paolo Abeni
1b1b43ee7a mptcp: fix data race around msk->first access
The first subflow socket is accessed outside the msk socket lock
by mptcp_subflow_fail(), we need to annotate each write access
with WRITE_ONCE, but a few spots still lacks it.

Fixes: 76a13b3157 ("mptcp: invoke MP_FAIL response when needed")
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 10:04:04 -07:00
Paolo Abeni
7e8b88ec35 mptcp: consolidate passive msk socket initialization
When the msk socket is cloned at MPC handshake time, a few
fields are initialized in a racy way outside mptcp_sk_clone()
and the msk socket lock.

The above is due historical reasons: before commit a88d0092b2
("mptcp: simplify subflow_syn_recv_sock()") as the first subflow socket
carrying all the needed date was not available yet at msk creation
time

We can now refactor the code moving the missing initialization bit
under the socket lock, removing the init race and avoiding some
code duplication.

This will also simplify the next patch, as all msk->first write
access are now under the msk socket lock.

Fixes: 0397c6d85f ("mptcp: keep unaccepted MPC subflow into join list")
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 10:04:04 -07:00
Paolo Abeni
5b825727d0 mptcp: add annotations around msk->subflow accesses
The MPTCP can access the first subflow socket in a few spots
outside the socket lock scope. That is actually safe, as MPTCP
will delete the socket itself only after the msk sock close().

Still the such accesses causes a few KCSAN splats, as reported
by Christoph. Silence the harmless warning adding a few annotation
around the relevant accesses.

Fixes: 71ba088ce0 ("mptcp: cleanup accept and poll")
Reported-by: Christoph Paasch <cpaasch@apple.com>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/402
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 10:04:04 -07:00
Paolo Abeni
786fc12457 mptcp: fix connect timeout handling
Ondrej reported a functional issue WRT timeout handling on connect
with a nice reproducer.

The problem is that the current mptcp connect waits for both the
MPTCP socket level timeout, and the first subflow socket timeout.
The latter is not influenced/touched by the exposed setsockopt().

Overall the above makes the SO_SNDTIMEO a no-op on connect.

Since mptcp_connect is invoked via inet_stream_connect and the
latter properly handle the MPTCP level timeout, we can address the
issue making the nested subflow level connect always unblocking.

This also allow simplifying a bit the code, dropping an ugly hack
to handle the fastopen and custom proto_ops connect.

The issues predates the blamed commit below, but the current resolution
requires the infrastructure introduced there.

Fixes: 54f1944ed6 ("mptcp: factor out mptcp_connect()")
Reported-by: Ondrej Mosnacek <omosnace@redhat.com>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/399
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 10:04:04 -07:00
Jakub Kicinski
3021dbfe3e Merge branch 'rtnetlink-a-couple-of-fixes-in-linkmsg-validation'
Xin Long says:

====================
rtnetlink: a couple of fixes in linkmsg validation

validate_linkmsg() was introduced to do linkmsg validation for existing
links. However, the new created links also need this linkmsg validation.

Add validate_linkmsg() check for link creating in Patch 1, and add more
tb checks into validate_linkmsg() in Patch 2 and 3.
====================

Link: https://lore.kernel.org/r/cover.1685548598.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 09:59:45 -07:00
Xin Long
65d6914e25 rtnetlink: add the missing IFLA_GRO_ tb check in validate_linkmsg
This fixes the issue that dev gro_max_size and gso_ipv4_max_size
can be set to a huge value:

  # ip link add dummy1 type dummy
  # ip link set dummy1 gro_max_size 4294967295
  # ip -d link show dummy1
    dummy addrgenmode eui64 ... gro_max_size 4294967295

Fixes: 0fe79f28bf ("net: allow gro_max_size to exceed 65536")
Fixes: 9eefedd58a ("net: add gso_ipv4_max_size and gro_ipv4_max_size per device")
Reported-by: Xiumei Mu <xmu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 09:59:44 -07:00
Xin Long
fef5b228dd rtnetlink: move IFLA_GSO_ tb check to validate_linkmsg
These IFLA_GSO_* tb check should also be done for the new created link,
otherwise, they can be set to a huge value when creating links:

  # ip link add dummy1 gso_max_size 4294967295 type dummy
  # ip -d link show dummy1
    dummy addrgenmode eui64 ... gso_max_size 4294967295

Fixes: 46e6b992c2 ("rtnetlink: allow GSO maximums to be set on device creation")
Fixes: 9eefedd58a ("net: add gso_ipv4_max_size and gro_ipv4_max_size per device")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 09:59:44 -07:00
Xin Long
b0ad3c1790 rtnetlink: call validate_linkmsg in rtnl_create_link
validate_linkmsg() was introduced by commit 1840bb13c2 ("[RTNL]:
Validate hardware and broadcast address attribute for RTM_NEWLINK")
to validate tb[IFLA_ADDRESS/BROADCAST] for existing links. The same
check should also be done for newly created links.

This patch adds validate_linkmsg() call in rtnl_create_link(), to
avoid the invalid address set when creating some devices like:

  # ip link add dummy0 type dummy
  # ip link add link dummy0 name mac0 address 01:02 type macsec

Fixes: 0e06877c6f ("[RTNETLINK]: rtnl_link: allow specifying initial device address")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 09:59:43 -07:00
Maciej Fijalkowski
abaf8d51b0 ice: recycle/free all of the fragments from multi-buffer frame
The ice driver caches next_to_clean value at the beginning of
ice_clean_rx_irq() in order to remember the first buffer that has to be
freed/recycled after main Rx processing loop. The end boundary is
indicated by first descriptor of frame that Rx processing loop has ended
its duties. Note that if mentioned loop ended in the middle of gathering
multi-buffer frame, next_to_clean would be pointing to the descriptor in
the middle of the frame BUT freeing/recycling stage will stop at the
first descriptor. This means that next iteration of ice_clean_rx_irq()
will miss the (first_desc, next_to_clean - 1) entries.

 When running various 9K MTU workloads, such splats were observed:

[  540.780716] BUG: kernel NULL pointer dereference, address: 0000000000000000
[  540.787787] #PF: supervisor read access in kernel mode
[  540.793002] #PF: error_code(0x0000) - not-present page
[  540.798218] PGD 0 P4D 0
[  540.800801] Oops: 0000 [#1] PREEMPT SMP NOPTI
[  540.805231] CPU: 18 PID: 3984 Comm: xskxceiver Tainted: G        W          6.3.0-rc7+ #96
[  540.813619] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019
[  540.824209] RIP: 0010:ice_clean_rx_irq+0x2b6/0xf00 [ice]
[  540.829678] Code: 74 24 10 e9 aa 00 00 00 8b 55 78 41 31 57 10 41 09 c4 4d 85 ff 0f 84 83 00 00 00 49 8b 57 08 41 8b 4f 1c 65 8b 35 1a fa 4b 3f <48> 8b 02 48 c1 e8 3a 39 c6 0f 85 a2 00 00 00 f6 42 08 02 0f 85 98
[  540.848717] RSP: 0018:ffffc9000f42fc50 EFLAGS: 00010282
[  540.854029] RAX: 0000000000000004 RBX: 0000000000000002 RCX: 000000000000fffe
[  540.861272] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00000000ffffffff
[  540.868519] RBP: ffff88984a05ac00 R08: 0000000000000000 R09: dead000000000100
[  540.875760] R10: ffff88983fffcd00 R11: 000000000010f2b8 R12: 0000000000000004
[  540.883008] R13: 0000000000000003 R14: 0000000000000800 R15: ffff889847a10040
[  540.890253] FS:  00007f6ddf7fe640(0000) GS:ffff88afdf800000(0000) knlGS:0000000000000000
[  540.898465] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  540.904299] CR2: 0000000000000000 CR3: 000000010d3da001 CR4: 00000000007706e0
[  540.911542] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  540.918789] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  540.926032] PKRU: 55555554
[  540.928790] Call Trace:
[  540.931276]  <TASK>
[  540.933418]  ice_napi_poll+0x4ca/0x6d0 [ice]
[  540.937804]  ? __pfx_ice_napi_poll+0x10/0x10 [ice]
[  540.942716]  napi_busy_loop+0xd7/0x320
[  540.946537]  xsk_recvmsg+0x143/0x170
[  540.950178]  sock_recvmsg+0x99/0xa0
[  540.953729]  __sys_recvfrom+0xa8/0x120
[  540.957543]  ? do_futex+0xbd/0x1d0
[  540.961008]  ? __x64_sys_futex+0x73/0x1d0
[  540.965083]  __x64_sys_recvfrom+0x20/0x30
[  540.969155]  do_syscall_64+0x38/0x90
[  540.972796]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
[  540.977934] RIP: 0033:0x7f6de5f27934

To fix this, set cached_ntc to first_desc so that at the end, when
freeing/recycling buffers, descriptors from first to ntc are not missed.

Fixes: 2fba7dc515 ("ice: Add support for XDP multi-buffer on Rx side")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://lore.kernel.org/r/20230531154457.3216621-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 09:59:39 -07:00
Xu Liang
519d648764 net: phy: mxl-gpy: extend interrupt fix to all impacted variants
The interrupt fix in commit 97a89ed101 should be applied on all variants
of GPY2xx PHY and GPY115C.

Fixes: 97a89ed101 ("net: phy: mxl-gpy: disable interrupts on GPY215 by default")
Signed-off-by: Xu Liang <lxu@maxlinear.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230531074822.39136-1-lxu@maxlinear.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 09:59:36 -07:00
Yoshihiro Shimoda
a60caf039e net: renesas: rswitch: Fix return value in error path of xmit
Fix return value in the error path of rswitch_start_xmit(). If TX
queues are full, this function should return NETDEV_TX_BUSY.

Fixes: 3590918b5d ("net: ethernet: renesas: Add support for "Ethernet Switch"")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20230529073817.1145208-1-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-01 09:57:08 -07:00