Skip to content
Snippets Groups Projects
  1. Feb 08, 2024
  2. Feb 05, 2024
  3. Feb 01, 2024
    • Richard Fitzgerald's avatar
      ASoC: cs35l56: Allow more time for firmware to boot · 9e92b77c
      Richard Fitzgerald authored
      
      The original 50ms timeout for firmware boot is not long enough for
      worst-case time to reboot after a firmware download. Increase the
      timeout to 250ms.
      
      Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
      Fixes: e4961125 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
      Link: https://msgid.link/r/20240129162737.497-15-rf@opensource.cirrus.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      9e92b77c
    • Richard Fitzgerald's avatar
      ASoC: cs35l56: Load tunings for the correct speaker models · 245eeff1
      Richard Fitzgerald authored
      
      If the "spk-id-gpios" property is present it points to GPIOs whose
      value must be used to select the correct bin file to match the
      speakers.
      
      Some manufacturers use multiple sources of speakers, which need
      different tunings for best performance. On these models the type of
      speaker fitted is indicated by the values of one or more GPIOs. The
      number formed by the GPIOs identifies the tuning required.
      
      The speaker ID must be used in combination with the subsystem ID
      (either from PCI SSID or cirrus,firmware-uid property), because the
      GPIOs can only indicate variants of a specific model.
      
      Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
      Fixes: 1a1c3d79 ("ASoC: cs35l56: Use PCI SSID as the firmware UID")
      Link: https://msgid.link/r/20240129162737.497-14-rf@opensource.cirrus.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      245eeff1
    • Richard Fitzgerald's avatar
      ASoC: cs35l56: Firmware file must match the version of preloaded firmware · f4ef5149
      Richard Fitzgerald authored
      
      Check during initialization whether the firmware is already patched.
      If so, include the firmware version in the wm_adsp fwf_name string.
      
      If the firmware has already been patched by the BIOS the driver
      can only replace it if it has control of hard RESET.
      
      If the driver cannot replace the firmware, it can still load a wmfw
      (for ALSA control definitions) and/or a bin (for additional tunings).
      But these must match the version of firmware that is running on the
      CS35L56.
      
      The firmware is pre-patched if FIRMWARE_MISSING == 0.
      
      Including the firmware version in the fwf_name string will
      qualify the firmware file name:
      
      Normal (unpatched or replaceable firmware):
        cs35l56-rev-dsp1-misc[-system_name].[wmfw|bin]
      
      Preloaded firmware:
        cs35l56-rev[-s]-VVVVVV-dsp1-misc[-system_name].[wmfw|bin]
      
      Where:
         [-s] is an optional -s added into the name for a secured CS35L56
         VVVVVV is the 24-bit firmware version in hexadecimal.
      
      Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
      Fixes: 608f1b0d ("ASoC: cs35l56: Move DSP part string generation so that it is done only once")
      Link: https://msgid.link/r/20240129162737.497-13-rf@opensource.cirrus.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      f4ef5149
    • Richard Fitzgerald's avatar
      ASoC: cs35l56: Fix to ensure ASP1 registers match cache · 72a77d76
      Richard Fitzgerald authored
      
      Add a dummy SUPPLY widget connected to the ASP that forces the
      chip registers to match the regmap cache when the ASP is
      powered-up.
      
      On a SoundWire system the ASP is free for use as a chip-to-chip
      interconnect. This can be either for the firmware on multiple
      CS35L56 to share reference audio; or as a bridge to another
      device. If it is a firmware interconnect it is owned by the
      firmware and the Linux driver should avoid writing the registers.
      However. If it is a bridge then Linux may take over and handle
      it as a normal codec-to-codec link.
      
      CS35L56 is designed for SDCA and a generic SDCA driver would
      know nothing about these chip-specific registers. So if the
      ASP is being used on a SoundWire system the firmware sets up the
      ASP registers. This means that we can't assume the default
      state of the ASP registers. But we don't know the initial state
      that the firmware set them to until after the firmware has been
      downloaded and booted, which can take several seconds when
      downloading multiple amps.
      
      To avoid blocking probe() for several seconds waiting for the
      firmware, the silicon defaults are assumed. This allows the machine
      driver to setup the ASP configuration during probe() without being
      blocked. If the ASP is hooked up and used, the SUPPLY widget
      ensures that the chip registers match what was configured in the
      regmap cache.
      
      If the machine driver does not hook up the ASP, it is assumed that
      it won't call any functions to configure the ASP DAI. Therefore
      the regmap cache will be clean for these registers so a
      regcache_sync() will not overwrite the chip registers. If the
      DAI is not hooked up, the dummy SUPPLY widget will not be
      invoked so it will never force-overwrite the chip registers.
      
      Backport note:
      This won't apply cleanly to kernels older than v6.6.
      
      Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
      Fixes: e4961125 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
      Link: https://msgid.link/r/20240129162737.497-8-rf@opensource.cirrus.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      72a77d76
    • Eric Dumazet's avatar
      af_unix: fix lockdep positive in sk_diag_dump_icons() · 4d322dce
      Eric Dumazet authored
      
      syzbot reported a lockdep splat [1].
      
      Blamed commit hinted about the possible lockdep
      violation, and code used unix_state_lock_nested()
      in an attempt to silence lockdep.
      
      It is not sufficient, because unix_state_lock_nested()
      is already used from unix_state_double_lock().
      
      We need to use a separate subclass.
      
      This patch adds a distinct enumeration to make things
      more explicit.
      
      Also use swap() in unix_state_double_lock() as a clean up.
      
      v2: add a missing inline keyword to unix_state_lock_nested()
      
      [1]
      WARNING: possible circular locking dependency detected
      6.8.0-rc1-syzkaller-00356-g8a696a29c690 #0 Not tainted
      
      syz-executor.1/2542 is trying to acquire lock:
       ffff88808b5df9e8 (rlock-AF_UNIX){+.+.}-{2:2}, at: skb_queue_tail+0x36/0x120 net/core/skbuff.c:3863
      
      but task is already holding lock:
       ffff88808b5dfe70 (&u->lock/1){+.+.}-{2:2}, at: unix_dgram_sendmsg+0xfc7/0x2200 net/unix/af_unix.c:2089
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (&u->lock/1){+.+.}-{2:2}:
              lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754
              _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378
              sk_diag_dump_icons net/unix/diag.c:87 [inline]
              sk_diag_fill+0x6ea/0xfe0 net/unix/diag.c:157
              sk_diag_dump net/unix/diag.c:196 [inline]
              unix_diag_dump+0x3e9/0x630 net/unix/diag.c:220
              netlink_dump+0x5c1/0xcd0 net/netlink/af_netlink.c:2264
              __netlink_dump_start+0x5d7/0x780 net/netlink/af_netlink.c:2370
              netlink_dump_start include/linux/netlink.h:338 [inline]
              unix_diag_handler_dump+0x1c3/0x8f0 net/unix/diag.c:319
             sock_diag_rcv_msg+0xe3/0x400
              netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2543
              sock_diag_rcv+0x2a/0x40 net/core/sock_diag.c:280
              netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
              netlink_unicast+0x7e6/0x980 net/netlink/af_netlink.c:1367
              netlink_sendmsg+0xa37/0xd70 net/netlink/af_netlink.c:1908
              sock_sendmsg_nosec net/socket.c:730 [inline]
              __sock_sendmsg net/socket.c:745 [inline]
              sock_write_iter+0x39a/0x520 net/socket.c:1160
              call_write_iter include/linux/fs.h:2085 [inline]
              new_sync_write fs/read_write.c:497 [inline]
              vfs_write+0xa74/0xca0 fs/read_write.c:590
              ksys_write+0x1a0/0x2c0 fs/read_write.c:643
              do_syscall_x64 arch/x86/entry/common.c:52 [inline]
              do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
             entry_SYSCALL_64_after_hwframe+0x63/0x6b
      
      -> #0 (rlock-AF_UNIX){+.+.}-{2:2}:
              check_prev_add kernel/locking/lockdep.c:3134 [inline]
              check_prevs_add kernel/locking/lockdep.c:3253 [inline]
              validate_chain+0x1909/0x5ab0 kernel/locking/lockdep.c:3869
              __lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5137
              lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754
              __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
              _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
              skb_queue_tail+0x36/0x120 net/core/skbuff.c:3863
              unix_dgram_sendmsg+0x15d9/0x2200 net/unix/af_unix.c:2112
              sock_sendmsg_nosec net/socket.c:730 [inline]
              __sock_sendmsg net/socket.c:745 [inline]
              ____sys_sendmsg+0x592/0x890 net/socket.c:2584
              ___sys_sendmsg net/socket.c:2638 [inline]
              __sys_sendmmsg+0x3b2/0x730 net/socket.c:2724
              __do_sys_sendmmsg net/socket.c:2753 [inline]
              __se_sys_sendmmsg net/socket.c:2750 [inline]
              __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2750
              do_syscall_x64 arch/x86/entry/common.c:52 [inline]
              do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
             entry_SYSCALL_64_after_hwframe+0x63/0x6b
      
      other info that might help us debug this:
      
       Possible unsafe locking scenario:
      
             CPU0                    CPU1
             ----                    ----
        lock(&u->lock/1);
                                     lock(rlock-AF_UNIX);
                                     lock(&u->lock/1);
        lock(rlock-AF_UNIX);
      
       *** DEADLOCK ***
      
      1 lock held by syz-executor.1/2542:
        #0: ffff88808b5dfe70 (&u->lock/1){+.+.}-{2:2}, at: unix_dgram_sendmsg+0xfc7/0x2200 net/unix/af_unix.c:2089
      
      stack backtrace:
      CPU: 1 PID: 2542 Comm: syz-executor.1 Not tainted 6.8.0-rc1-syzkaller-00356-g8a696a29c690 #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
      Call Trace:
       <TASK>
        __dump_stack lib/dump_stack.c:88 [inline]
        dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
        check_noncircular+0x366/0x490 kernel/locking/lockdep.c:2187
        check_prev_add kernel/locking/lockdep.c:3134 [inline]
        check_prevs_add kernel/locking/lockdep.c:3253 [inline]
        validate_chain+0x1909/0x5ab0 kernel/locking/lockdep.c:3869
        __lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5137
        lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754
        __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
        _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
        skb_queue_tail+0x36/0x120 net/core/skbuff.c:3863
        unix_dgram_sendmsg+0x15d9/0x2200 net/unix/af_unix.c:2112
        sock_sendmsg_nosec net/socket.c:730 [inline]
        __sock_sendmsg net/socket.c:745 [inline]
        ____sys_sendmsg+0x592/0x890 net/socket.c:2584
        ___sys_sendmsg net/socket.c:2638 [inline]
        __sys_sendmmsg+0x3b2/0x730 net/socket.c:2724
        __do_sys_sendmmsg net/socket.c:2753 [inline]
        __se_sys_sendmmsg net/socket.c:2750 [inline]
        __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2750
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b
      RIP: 0033:0x7f26d887cda9
      Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
      RSP: 002b:00007f26d95a60c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
      RAX: ffffffffffffffda RBX: 00007f26d89abf80 RCX: 00007f26d887cda9
      RDX: 000000000000003e RSI: 00000000200bd000 RDI: 0000000000000004
      RBP: 00007f26d88c947a R08: 0000000000000000 R09: 0000000000000000
      R10: 00000000000008c0 R11: 0000000000000246 R12: 0000000000000000
      R13: 000000000000000b R14: 00007f26d89abf80 R15: 00007ffcfe081a68
      
      Fixes: 2aac7a2c ("unix_diag: Pending connections IDs NLA")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Link: https://lore.kernel.org/r/20240130184235.1620738-1-edumazet@google.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4d322dce
    • Caleb Sander's avatar
      nvme: take const cmd pointer in read-only helpers · f9e9115d
      Caleb Sander authored
      
      nvme_is_fabrics() and nvme_is_write() only read struct nvme_command,
      so take it by const pointer. This allows callers to pass a const pointer
      and communicates that these functions don't modify the command.
      
      Signed-off-by: default avatarCaleb Sander <csander@purestorage.com>
      Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      f9e9115d
  4. Jan 31, 2024
  5. Jan 30, 2024
  6. Jan 28, 2024
  7. Jan 27, 2024
    • Nicolas Dichtel's avatar
      ipmr: fix kernel panic when forwarding mcast packets · e622502c
      Nicolas Dichtel authored
      
      The stacktrace was:
      [   86.305548] BUG: kernel NULL pointer dereference, address: 0000000000000092
      [   86.306815] #PF: supervisor read access in kernel mode
      [   86.307717] #PF: error_code(0x0000) - not-present page
      [   86.308624] PGD 0 P4D 0
      [   86.309091] Oops: 0000 [#1] PREEMPT SMP NOPTI
      [   86.309883] CPU: 2 PID: 3139 Comm: pimd Tainted: G     U             6.8.0-6wind-knet #1
      [   86.311027] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.1-0-g0551a4be2c-prebuilt.qemu-project.org 04/01/2014
      [   86.312728] RIP: 0010:ip_mr_forward (/build/work/knet/net/ipv4/ipmr.c:1985)
      [ 86.313399] Code: f9 1f 0f 87 85 03 00 00 48 8d 04 5b 48 8d 04 83 49 8d 44 c5 00 48 8b 40 70 48 39 c2 0f 84 d9 00 00 00 49 8b 46 58 48 83 e0 fe <80> b8 92 00 00 00 00 0f 84 55 ff ff ff 49 83 47 38 01 45 85 e4 0f
      [   86.316565] RSP: 0018:ffffad21c0583ae0 EFLAGS: 00010246
      [   86.317497] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
      [   86.318596] RDX: ffff9559cb46c000 RSI: 0000000000000000 RDI: 0000000000000000
      [   86.319627] RBP: ffffad21c0583b30 R08: 0000000000000000 R09: 0000000000000000
      [   86.320650] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
      [   86.321672] R13: ffff9559c093a000 R14: ffff9559cc00b800 R15: ffff9559c09c1d80
      [   86.322873] FS:  00007f85db661980(0000) GS:ffff955a79d00000(0000) knlGS:0000000000000000
      [   86.324291] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   86.325314] CR2: 0000000000000092 CR3: 000000002f13a000 CR4: 0000000000350ef0
      [   86.326589] Call Trace:
      [   86.327036]  <TASK>
      [   86.327434] ? show_regs (/build/work/knet/arch/x86/kernel/dumpstack.c:479)
      [   86.328049] ? __die (/build/work/knet/arch/x86/kernel/dumpstack.c:421 /build/work/knet/arch/x86/kernel/dumpstack.c:434)
      [   86.328508] ? page_fault_oops (/build/work/knet/arch/x86/mm/fault.c:707)
      [   86.329107] ? do_user_addr_fault (/build/work/knet/arch/x86/mm/fault.c:1264)
      [   86.329756] ? srso_return_thunk (/build/work/knet/arch/x86/lib/retpoline.S:223)
      [   86.330350] ? __irq_work_queue_local (/build/work/knet/kernel/irq_work.c:111 (discriminator 1))
      [   86.331013] ? exc_page_fault (/build/work/knet/./arch/x86/include/asm/paravirt.h:693 /build/work/knet/arch/x86/mm/fault.c:1515 /build/work/knet/arch/x86/mm/fault.c:1563)
      [   86.331702] ? asm_exc_page_fault (/build/work/knet/./arch/x86/include/asm/idtentry.h:570)
      [   86.332468] ? ip_mr_forward (/build/work/knet/net/ipv4/ipmr.c:1985)
      [   86.333183] ? srso_return_thunk (/build/work/knet/arch/x86/lib/retpoline.S:223)
      [   86.333920] ipmr_mfc_add (/build/work/knet/./include/linux/rcupdate.h:782 /build/work/knet/net/ipv4/ipmr.c:1009 /build/work/knet/net/ipv4/ipmr.c:1273)
      [   86.334583] ? __pfx_ipmr_hash_cmp (/build/work/knet/net/ipv4/ipmr.c:363)
      [   86.335357] ip_mroute_setsockopt (/build/work/knet/net/ipv4/ipmr.c:1470)
      [   86.336135] ? srso_return_thunk (/build/work/knet/arch/x86/lib/retpoline.S:223)
      [   86.336854] ? ip_mroute_setsockopt (/build/work/knet/net/ipv4/ipmr.c:1470)
      [   86.337679] do_ip_setsockopt (/build/work/knet/net/ipv4/ip_sockglue.c:944)
      [   86.338408] ? __pfx_unix_stream_read_actor (/build/work/knet/net/unix/af_unix.c:2862)
      [   86.339232] ? srso_return_thunk (/build/work/knet/arch/x86/lib/retpoline.S:223)
      [   86.339809] ? aa_sk_perm (/build/work/knet/security/apparmor/include/cred.h:153 /build/work/knet/security/apparmor/net.c:181)
      [   86.340342] ip_setsockopt (/build/work/knet/net/ipv4/ip_sockglue.c:1415)
      [   86.340859] raw_setsockopt (/build/work/knet/net/ipv4/raw.c:836)
      [   86.341408] ? security_socket_setsockopt (/build/work/knet/security/security.c:4561 (discriminator 13))
      [   86.342116] sock_common_setsockopt (/build/work/knet/net/core/sock.c:3716)
      [   86.342747] do_sock_setsockopt (/build/work/knet/net/socket.c:2313)
      [   86.343363] __sys_setsockopt (/build/work/knet/./include/linux/file.h:32 /build/work/knet/net/socket.c:2336)
      [   86.344020] __x64_sys_setsockopt (/build/work/knet/net/socket.c:2340)
      [   86.344766] do_syscall_64 (/build/work/knet/arch/x86/entry/common.c:52 /build/work/knet/arch/x86/entry/common.c:83)
      [   86.345433] ? srso_return_thunk (/build/work/knet/arch/x86/lib/retpoline.S:223)
      [   86.346161] ? syscall_exit_work (/build/work/knet/./include/linux/audit.h:357 /build/work/knet/kernel/entry/common.c:160)
      [   86.346938] ? srso_return_thunk (/build/work/knet/arch/x86/lib/retpoline.S:223)
      [   86.347657] ? syscall_exit_to_user_mode (/build/work/knet/kernel/entry/common.c:215)
      [   86.348538] ? srso_return_thunk (/build/work/knet/arch/x86/lib/retpoline.S:223)
      [   86.349262] ? do_syscall_64 (/build/work/knet/./arch/x86/include/asm/cpufeature.h:171 /build/work/knet/arch/x86/entry/common.c:98)
      [   86.349971] entry_SYSCALL_64_after_hwframe (/build/work/knet/arch/x86/entry/entry_64.S:129)
      
      The original packet in ipmr_cache_report() may be queued and then forwarded
      with ip_mr_forward(). This last function has the assumption that the skb
      dst is set.
      
      After the below commit, the skb dst is dropped by ipv4_pktinfo_prepare(),
      which causes the oops.
      
      Fixes: bb740365 ("ipmr: support IP_PKTINFO on cache report IGMP msg")
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20240125141847.1931933-1-nicolas.dichtel@6wind.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e622502c
  8. Jan 26, 2024
    • Zack Rusin's avatar
      drm/ttm: Make sure the mapped tt pages are decrypted when needed · 71ce0463
      Zack Rusin authored
      
      Some drivers require the mapped tt pages to be decrypted. In an ideal
      world this would have been handled by the dma layer, but the TTM page
      fault handling would have to be rewritten to able to do that.
      
      A side-effect of the TTM page fault handling is using a dma allocation
      per order (via ttm_pool_alloc_page) which makes it impossible to just
      trivially use dma_mmap_attrs. As a result ttm has to be very careful
      about trying to make its pgprot for the mapped tt pages match what
      the dma layer thinks it is. At the ttm layer it's possible to
      deduce the requirement to have tt pages decrypted by checking
      whether coherent dma allocations have been requested and the system
      is running with confidential computing technologies.
      
      This approach isn't ideal but keeping TTM matching DMAs expectations
      for the page properties is in general fragile, unfortunately proper
      fix would require a rewrite of TTM's page fault handling.
      
      Fixes vmwgfx with SEV enabled.
      
      v2: Explicitly include cc_platform.h
      v3: Use CC_ATTR_GUEST_MEM_ENCRYPT instead of CC_ATTR_MEM_ENCRYPT to
      limit the scope to guests and log when memory decryption is enabled.
      
      Signed-off-by: default avatarZack Rusin <zack.rusin@broadcom.com>
      Fixes: 3bf3710e ("drm/ttm: Add a generic TTM memcpy move for page-based iomem")
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-kernel@vger.kernel.org
      Cc: <stable@vger.kernel.org> # v5.14+
      Link: https://patchwork.freedesktop.org/patch/msgid/20230926040359.3040017-1-zack@kde.org
      71ce0463
    • Marco Elver's avatar
      mm, kmsan: fix infinite recursion due to RCU critical section · f6564fce
      Marco Elver authored
      Alexander Potapenko writes in [1]: "For every memory access in the code
      instrumented by KMSAN we call kmsan_get_metadata() to obtain the metadata
      for the memory being accessed.  For virtual memory the metadata pointers
      are stored in the corresponding `struct page`, therefore we need to call
      virt_to_page() to get them.
      
      According to the comment in arch/x86/include/asm/page.h,
      virt_to_page(kaddr) returns a valid pointer iff virt_addr_valid(kaddr) is
      true, so KMSAN needs to call virt_addr_valid() as well.
      
      To avoid recursion, kmsan_get_metadata() must not call instrumented code,
      therefore ./arch/x86/include/asm/kmsan.h forks parts of
      arch/x86/mm/physaddr.c to check whether a virtual address is valid or not.
      
      But the introduction of rcu_read_lock() to pfn_valid() added instrumented
      RCU API calls to virt_to_page_or_null(), which is called by
      kmsan_get_metadata(), so there is an infinite recursion now.  I do not
      think it is correct to stop that recursion by doing
      kmsan_enter_runtime()/kmsan_exit_runtime() in kmsan_get_metadata(): that
      would prevent instrumented functions called from within the runtime from
      tracking the shadow values, which might introduce false positives."
      
      Fix the issue by switching pfn_valid() to the _sched() variant of
      rcu_read_lock/unlock(), which does not require calling into RCU.  Given
      the critical section in pfn_valid() is very small, this is a reasonable
      trade-off (with preemptible RCU).
      
      KMSAN further needs to be careful to suppress calls into the scheduler,
      which would be another source of recursion.  This can be done by wrapping
      the call to pfn_valid() into preempt_disable/enable_no_resched().  The
      downside is that this sacrifices breaking scheduling guarantees; however,
      a kernel compiled with KMSAN has already given up any performance
      guarantees due to being heavily instrumented.
      
      Note, KMSAN code already disables tracing via Makefile, and since mmzone.h
      is included, it is not necessary to use the notrace variant, which is
      generally preferred in all other cases.
      
      Link: https://lkml.kernel.org/r/20240115184430.2710652-1-glider@google.com [1]
      Link: https://lkml.kernel.org/r/20240118110022.2538350-1-elver@google.com
      
      
      Fixes: 5ec8e8ea ("mm/sparsemem: fix race in accessing memory_section->usage")
      Signed-off-by: default avatarMarco Elver <elver@google.com>
      Reported-by: default avatarAlexander Potapenko <glider@google.com>
      Reported-by: default avatar <syzbot+93a9e8a3dea8d6085e12@syzkaller.appspotmail.com>
      Reviewed-by: default avatarAlexander Potapenko <glider@google.com>
      Tested-by: default avatarAlexander Potapenko <glider@google.com>
      Cc: Charan Teja Kalla <quic_charante@quicinc.com>
      Cc: Borislav Petkov (AMD) <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      f6564fce
    • Yang Shi's avatar
      mm: mmap: map MAP_STACK to VM_NOHUGEPAGE · c4608d1b
      Yang Shi authored
      commit efa7df3e ("mm: align larger anonymous mappings on THP
      boundaries") incured regression for stress-ng pthread benchmark [1].  It
      is because THP get allocated to pthread's stack area much more possible
      than before.  Pthread's stack area is allocated by mmap without
      VM_GROWSDOWN or VM_GROWSUP flag, so kernel can't tell whether it is a
      stack area or not.
      
      The MAP_STACK flag is used to mark the stack area, but it is a no-op on
      Linux.  Mapping MAP_STACK to VM_NOHUGEPAGE to prevent from allocating THP
      for such stack area.
      
      With this change the stack area looks like:
      
      fffd18e10000-fffd19610000 rw-p 00000000 00:00 0
      Size:               8192 kB
      KernelPageSize:        4 kB
      MMUPageSize:           4 kB
      Rss:                  12 kB
      Pss:                  12 kB
      Pss_Dirty:            12 kB
      Shared_Clean:          0 kB
      Shared_Dirty:          0 kB
      Private_Clean:         0 kB
      Private_Dirty:        12 kB
      Referenced:           12 kB
      Anonymous:            12 kB
      KSM:                   0 kB
      LazyFree:              0 kB
      AnonHugePages:         0 kB
      ShmemPmdMapped:        0 kB
      FilePmdMapped:         0 kB
      Shared_Hugetlb:        0 kB
      Private_Hugetlb:       0 kB
      Swap:                  0 kB
      SwapPss:               0 kB
      Locked:                0 kB
      THPeligible:           0
      VmFlags: rd wr mr mw me ac nh
      
      The "nh" flag is set.
      
      [1] https://lore.kernel.org/linux-mm/202312192310.56367035-oliver.sang@intel.com/
      
      Link: https://lkml.kernel.org/r/20231221065943.2803551-2-shy828301@gmail.com
      
      
      Fixes: efa7df3e ("mm: align larger anonymous mappings on THP boundaries")
      Signed-off-by: default avatarYang Shi <yang@os.amperecomputing.com>
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Tested-by: default avatarOliver Sang <oliver.sang@intel.com>
      Reviewed-by: default avatarYin Fengwei <fengwei.yin@intel.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Christopher Lameter <cl@linux.com>
      Cc: Huang, Ying <ying.huang@intel.com>
      Cc: <stable@vger.kerenl.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      c4608d1b
  9. Jan 25, 2024
    • AMARANATH Amarnath's avatar
      drm/ttm: replace busy placement with flags v6 · a78a8da5
      AMARANATH Amarnath authored and Christian König's avatar Christian König committed
      
      Instead of a list of separate busy placement add flags which indicate
      that a placement should only be used when there is room or if we need to
      evict.
      
      v2: add missing TTM_PL_FLAG_IDLE for i915
      v3: fix auto build test ERROR on drm-tip/drm-tip
      v4: fix some typos pointed out by checkpatch
      v5: cleanup some rebase problems with VMWGFX
      v6: implement some missing VMWGFX functionality pointed out by Zack,
          rename the flags as suggested by Michel, rebase on drm-tip and
          adjust XE as well
      
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarSomalapuram Amaranath <Amaranath.Somalapuram@amd.com>
      Reviewed-by: default avatarZack Rusin <zack.rusin@broadcom.com>
      Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240112125158.2748-4-christian.koenig@amd.com
      a78a8da5
    • Maciej Fijalkowski's avatar
      xsk: fix usage of multi-buffer BPF helpers for ZC XDP · c5114710
      Maciej Fijalkowski authored
      
      Currently when packet is shrunk via bpf_xdp_adjust_tail() and memory
      type is set to MEM_TYPE_XSK_BUFF_POOL, null ptr dereference happens:
      
      [1136314.192256] BUG: kernel NULL pointer dereference, address:
      0000000000000034
      [1136314.203943] #PF: supervisor read access in kernel mode
      [1136314.213768] #PF: error_code(0x0000) - not-present page
      [1136314.223550] PGD 0 P4D 0
      [1136314.230684] Oops: 0000 [#1] PREEMPT SMP NOPTI
      [1136314.239621] CPU: 8 PID: 54203 Comm: xdpsock Not tainted 6.6.0+ #257
      [1136314.250469] Hardware name: Intel Corporation S2600WFT/S2600WFT,
      BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019
      [1136314.265615] RIP: 0010:__xdp_return+0x6c/0x210
      [1136314.274653] Code: ad 00 48 8b 47 08 49 89 f8 a8 01 0f 85 9b 01 00 00 0f 1f 44 00 00 f0 41 ff 48 34 75 32 4c 89 c7 e9 79 cd 80 ff 83 fe 03 75 17 <f6> 41 34 01 0f 85 02 01 00 00 48 89 cf e9 22 cc 1e 00 e9 3d d2 86
      [1136314.302907] RSP: 0018:ffffc900089f8db0 EFLAGS: 00010246
      [1136314.312967] RAX: ffffc9003168aed0 RBX: ffff8881c3300000 RCX:
      0000000000000000
      [1136314.324953] RDX: 0000000000000000 RSI: 0000000000000003 RDI:
      ffffc9003168c000
      [1136314.336929] RBP: 0000000000000ae0 R08: 0000000000000002 R09:
      0000000000010000
      [1136314.348844] R10: ffffc9000e495000 R11: 0000000000000040 R12:
      0000000000000001
      [1136314.360706] R13: 0000000000000524 R14: ffffc9003168aec0 R15:
      0000000000000001
      [1136314.373298] FS:  00007f8df8bbcb80(0000) GS:ffff8897e0e00000(0000)
      knlGS:0000000000000000
      [1136314.386105] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [1136314.396532] CR2: 0000000000000034 CR3: 00000001aa912002 CR4:
      00000000007706f0
      [1136314.408377] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
      0000000000000000
      [1136314.420173] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
      0000000000000400
      [1136314.431890] PKRU: 55555554
      [1136314.439143] Call Trace:
      [1136314.446058]  <IRQ>
      [1136314.452465]  ? __die+0x20/0x70
      [1136314.459881]  ? page_fault_oops+0x15b/0x440
      [1136314.468305]  ? exc_page_fault+0x6a/0x150
      [1136314.476491]  ? asm_exc_page_fault+0x22/0x30
      [1136314.484927]  ? __xdp_return+0x6c/0x210
      [1136314.492863]  bpf_xdp_adjust_tail+0x155/0x1d0
      [1136314.501269]  bpf_prog_ccc47ae29d3b6570_xdp_sock_prog+0x15/0x60
      [1136314.511263]  ice_clean_rx_irq_zc+0x206/0xc60 [ice]
      [1136314.520222]  ? ice_xmit_zc+0x6e/0x150 [ice]
      [1136314.528506]  ice_napi_poll+0x467/0x670 [ice]
      [1136314.536858]  ? ttwu_do_activate.constprop.0+0x8f/0x1a0
      [1136314.546010]  __napi_poll+0x29/0x1b0
      [1136314.553462]  net_rx_action+0x133/0x270
      [1136314.561619]  __do_softirq+0xbe/0x28e
      [1136314.569303]  do_softirq+0x3f/0x60
      
      This comes from __xdp_return() call with xdp_buff argument passed as
      NULL which is supposed to be consumed by xsk_buff_free() call.
      
      To address this properly, in ZC case, a node that represents the frag
      being removed has to be pulled out of xskb_list. Introduce
      appropriate xsk helpers to do such node operation and use them
      accordingly within bpf_xdp_adjust_tail().
      
      Fixes: 24ea5012 ("xsk: support mbuf on ZC RX")
      Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> # For the xsk header part
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Link: https://lore.kernel.org/r/20240124191602.566724-4-maciej.fijalkowski@intel.com
      
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      c5114710
    • Maciej Fijalkowski's avatar
      xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags · f7f6aa8e
      Maciej Fijalkowski authored
      
      XDP multi-buffer support introduced XDP_FLAGS_HAS_FRAGS flag that is
      used by drivers to notify data path whether xdp_buff contains fragments
      or not. Data path looks up mentioned flag on first buffer that occupies
      the linear part of xdp_buff, so drivers only modify it there. This is
      sufficient for SKB and XDP_DRV modes as usually xdp_buff is allocated on
      stack or it resides within struct representing driver's queue and
      fragments are carried via skb_frag_t structs. IOW, we are dealing with
      only one xdp_buff.
      
      ZC mode though relies on list of xdp_buff structs that is carried via
      xsk_buff_pool::xskb_list, so ZC data path has to make sure that
      fragments do *not* have XDP_FLAGS_HAS_FRAGS set. Otherwise,
      xsk_buff_free() could misbehave if it would be executed against xdp_buff
      that carries a frag with XDP_FLAGS_HAS_FRAGS flag set. Such scenario can
      take place when within supplied XDP program bpf_xdp_adjust_tail() is
      used with negative offset that would in turn release the tail fragment
      from multi-buffer frame.
      
      Calling xsk_buff_free() on tail fragment with XDP_FLAGS_HAS_FRAGS would
      result in releasing all the nodes from xskb_list that were produced by
      driver before XDP program execution, which is not what is intended -
      only tail fragment should be deleted from xskb_list and then it should
      be put onto xsk_buff_pool::free_list. Such multi-buffer frame will never
      make it up to user space, so from AF_XDP application POV there would be
      no traffic running, however due to free_list getting constantly new
      nodes, driver will be able to feed HW Rx queue with recycled buffers.
      Bottom line is that instead of traffic being redirected to user space,
      it would be continuously dropped.
      
      To fix this, let us clear the mentioned flag on xsk_buff_pool side
      during xdp_buff initialization, which is what should have been done
      right from the start of XSK multi-buffer support.
      
      Fixes: 1bbc04de ("ice: xsk: add RX multi-buffer support")
      Fixes: 1c9ba9c1 ("i40e: xsk: add RX multi-buffer support")
      Fixes: 24ea5012 ("xsk: support mbuf on ZC RX")
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Link: https://lore.kernel.org/r/20240124191602.566724-3-maciej.fijalkowski@intel.com
      
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      f7f6aa8e
  10. Jan 24, 2024
    • Kees Cook's avatar
      exec: Distinguish in_execve from in_exec · 90383cc0
      Kees Cook authored
      
      Just to help distinguish the fs->in_exec flag from the current->in_execve
      flag, add comments in check_unsafe_exec() and copy_fs() for more
      context. Also note that in_execve is only used by TOMOYO now.
      
      Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: linux-fsdevel@vger.kernel.org
      Cc: linux-mm@kvack.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      90383cc0
    • George Guo's avatar
      netfilter: nf_tables: cleanup documentation · b253d87f
      George Guo authored
      
      - Correct comments for nlpid, family, udlen and udata in struct nft_table,
        and afinfo is no longer a member of enum nft_set_class.
      
      - Add comment for data in struct nft_set_elem.
      
      - Add comment for flags in struct nft_ctx.
      
      - Add comments for timeout in struct nft_set_iter, and flags is not a
        member of struct nft_set_iter, remove the comment for it.
      
      - Add comments for commit, abort, estimate and gc_init in struct
        nft_set_ops.
      
      - Add comments for pending_update, num_exprs, exprs and catchall_list
        in struct nft_set.
      
      - Add comment for ext_len in struct nft_set_ext_tmpl.
      
      - Add comment for inner_ops in struct nft_expr_type.
      
      - Add comments for clone, destroy_clone, reduce, gc, offload,
        offload_action, offload_stats in struct nft_expr_ops.
      
      - Add comments for blob_gen_0, blob_gen_1, bound, genmask, udlen, udata,
        blob_next in struct nft_chain.
      
      - Add comment for flags in struct nft_base_chain.
      
      - Add comments for udlen, udata in struct nft_object.
      
      - Add comment for type in struct nft_object_ops.
      
      - Add comment for hook_list in struct nft_flowtable, and remove comments
        for dev_name and ops which are not members of struct nft_flowtable.
      
      Signed-off-by: default avatarGeorge Guo <guodongtai@kylinos.cn>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      b253d87f
    • Mark Brown's avatar
      spi: Raise limit on number of chip selects · 2f8c7c37
      Mark Brown authored
      
      As reported by Guenter the limit we've got on the number of chip selects is
      set too low for some systems, raise the limit. We should really remove the
      hard coded limit but this is needed as a fix so let's do the simple thing
      and raise the limit for now.
      
      Fixes: 4d8ff6b0 ("spi: Add multi-cs memories support in SPI core")
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Suggested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Link: https://msgid.link/r/20240124-spi-multi-cs-max-v2-1-df6fc5ab1abc@kernel.org
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      2f8c7c37
    • Richard Palethorpe's avatar
      x86/entry/ia32: Ensure s32 is sign extended to s64 · 56062d60
      Richard Palethorpe authored
      
      Presently ia32 registers stored in ptregs are unconditionally cast to
      unsigned int by the ia32 stub. They are then cast to long when passed to
      __se_sys*, but will not be sign extended.
      
      This takes the sign of the syscall argument into account in the ia32
      stub. It still casts to unsigned int to avoid implementation specific
      behavior. However then casts to int or unsigned int as necessary. So that
      the following cast to long sign extends the value.
      
      This fixes the io_pgetevents02 LTP test when compiled with -m32. Presently
      the systemcall io_pgetevents_time64() unexpectedly accepts -1 for the
      maximum number of events.
      
      It doesn't appear other systemcalls with signed arguments are effected
      because they all have compat variants defined and wired up.
      
      Fixes: ebeb8c82 ("syscalls/x86: Use 'struct pt_regs' based syscall calling for IA32_EMULATION and x32")
      Suggested-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRichard Palethorpe <rpalethorpe@suse.com>
      Signed-off-by: default avatarNikolay Borisov <nik.borisov@suse.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20240110130122.3836513-1-nik.borisov@suse.com
      Link: https://lore.kernel.org/ltp/20210921130127.24131-1-rpalethorpe@suse.com/
      56062d60
    • Moshe Shemesh's avatar
      net/mlx5: Bridge, fix multicast packets sent to uplink · ec7cc38e
      Moshe Shemesh authored
      
      To enable multicast packets which are offloaded in bridge multicast
      offload mode to be sent also to uplink, FTE bit uplink_hairpin_en should
      be set. Add this bit to FTE for the bridge multicast offload rules.
      
      Fixes: 18c2916c ("net/mlx5: Bridge, snoop igmp/mld packets")
      Signed-off-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      ec7cc38e
    • Tariq Toukan's avatar
      net/mlx5: Fix query of sd_group field · cfbc3608
      Tariq Toukan authored
      
      The sd_group field moved in the HW spec from the MPIR register
      to the vport context.
      Align the query accordingly.
      
      Fixes: f5e95632 ("net/mlx5: Expose Management PCIe Index Register (MPIR)")
      Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      cfbc3608
    • Saeed Mahameed's avatar
      net/mlx5e: Use the correct lag ports number when creating TISes · 25461ce8
      Saeed Mahameed authored
      
      The cited commit moved the code of mlx5e_create_tises() and changed the
      loop to create TISes over MLX5_MAX_PORTS constant value, instead of
      getting the correct lag ports supported by the device, which can cause
      FW errors on devices with less than MLX5_MAX_PORTS ports.
      
      Change that back to mlx5e_get_num_lag_ports(mdev).
      
      Also IPoIB interfaces create there own TISes, they don't use the eth
      TISes, pass a flag to indicate that.
      
      This fixes the following errors that might appear in kernel log:
      mlx5_cmd_out_err:808:(pid 650): CREATE_TIS(0x912) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x595b5d), err(-22)
      mlx5e_create_mdev_resources:174:(pid 650): alloc tises failed, -22
      
      Fixes: b25bd37c ("net/mlx5: Move TISes from priv to mdev HW resources")
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      25461ce8
    • Ido Schimmel's avatar
      net/sched: flower: Fix chain template offload · 32f2a0af
      Ido Schimmel authored
      
      When a qdisc is deleted from a net device the stack instructs the
      underlying driver to remove its flow offload callback from the
      associated filter block using the 'FLOW_BLOCK_UNBIND' command. The stack
      then continues to replay the removal of the filters in the block for
      this driver by iterating over the chains in the block and invoking the
      'reoffload' operation of the classifier being used. In turn, the
      classifier in its 'reoffload' operation prepares and emits a
      'FLOW_CLS_DESTROY' command for each filter.
      
      However, the stack does not do the same for chain templates and the
      underlying driver never receives a 'FLOW_CLS_TMPLT_DESTROY' command when
      a qdisc is deleted. This results in a memory leak [1] which can be
      reproduced using [2].
      
      Fix by introducing a 'tmplt_reoffload' operation and have the stack
      invoke it with the appropriate arguments as part of the replay.
      Implement the operation in the sole classifier that supports chain
      templates (flower) by emitting the 'FLOW_CLS_TMPLT_{CREATE,DESTROY}'
      command based on whether a flow offload callback is being bound to a
      filter block or being unbound from one.
      
      As far as I can tell, the issue happens since cited commit which
      reordered tcf_block_offload_unbind() before tcf_block_flush_all_chains()
      in __tcf_block_put(). The order cannot be reversed as the filter block
      is expected to be freed after flushing all the chains.
      
      [1]
      unreferenced object 0xffff888107e28800 (size 2048):
        comm "tc", pid 1079, jiffies 4294958525 (age 3074.287s)
        hex dump (first 32 bytes):
          b1 a6 7c 11 81 88 ff ff e0 5b b3 10 81 88 ff ff  ..|......[......
          01 00 00 00 00 00 00 00 e0 aa b0 84 ff ff ff ff  ................
        backtrace:
          [<ffffffff81c06a68>] __kmem_cache_alloc_node+0x1e8/0x320
          [<ffffffff81ab374e>] __kmalloc+0x4e/0x90
          [<ffffffff832aec6d>] mlxsw_sp_acl_ruleset_get+0x34d/0x7a0
          [<ffffffff832bc195>] mlxsw_sp_flower_tmplt_create+0x145/0x180
          [<ffffffff832b2e1a>] mlxsw_sp_flow_block_cb+0x1ea/0x280
          [<ffffffff83a10613>] tc_setup_cb_call+0x183/0x340
          [<ffffffff83a9f85a>] fl_tmplt_create+0x3da/0x4c0
          [<ffffffff83a22435>] tc_ctl_chain+0xa15/0x1170
          [<ffffffff838a863c>] rtnetlink_rcv_msg+0x3cc/0xed0
          [<ffffffff83ac87f0>] netlink_rcv_skb+0x170/0x440
          [<ffffffff83ac6270>] netlink_unicast+0x540/0x820
          [<ffffffff83ac6e28>] netlink_sendmsg+0x8d8/0xda0
          [<ffffffff83793def>] ____sys_sendmsg+0x30f/0xa80
          [<ffffffff8379d29a>] ___sys_sendmsg+0x13a/0x1e0
          [<ffffffff8379d50c>] __sys_sendmsg+0x11c/0x1f0
          [<ffffffff843b9ce0>] do_syscall_64+0x40/0xe0
      unreferenced object 0xffff88816d2c0400 (size 1024):
        comm "tc", pid 1079, jiffies 4294958525 (age 3074.287s)
        hex dump (first 32 bytes):
          40 00 00 00 00 00 00 00 57 f6 38 be 00 00 00 00  @.......W.8.....
          10 04 2c 6d 81 88 ff ff 10 04 2c 6d 81 88 ff ff  ..,m......,m....
        backtrace:
          [<ffffffff81c06a68>] __kmem_cache_alloc_node+0x1e8/0x320
          [<ffffffff81ab36c1>] __kmalloc_node+0x51/0x90
          [<ffffffff81a8ed96>] kvmalloc_node+0xa6/0x1f0
          [<ffffffff82827d03>] bucket_table_alloc.isra.0+0x83/0x460
          [<ffffffff82828d2b>] rhashtable_init+0x43b/0x7c0
          [<ffffffff832aed48>] mlxsw_sp_acl_ruleset_get+0x428/0x7a0
          [<ffffffff832bc195>] mlxsw_sp_flower_tmplt_create+0x145/0x180
          [<ffffffff832b2e1a>] mlxsw_sp_flow_block_cb+0x1ea/0x280
          [<ffffffff83a10613>] tc_setup_cb_call+0x183/0x340
          [<ffffffff83a9f85a>] fl_tmplt_create+0x3da/0x4c0
          [<ffffffff83a22435>] tc_ctl_chain+0xa15/0x1170
          [<ffffffff838a863c>] rtnetlink_rcv_msg+0x3cc/0xed0
          [<ffffffff83ac87f0>] netlink_rcv_skb+0x170/0x440
          [<ffffffff83ac6270>] netlink_unicast+0x540/0x820
          [<ffffffff83ac6e28>] netlink_sendmsg+0x8d8/0xda0
          [<ffffffff83793def>] ____sys_sendmsg+0x30f/0xa80
      
      [2]
       # tc qdisc add dev swp1 clsact
       # tc chain add dev swp1 ingress proto ip chain 1 flower dst_ip 0.0.0.0/32
       # tc qdisc del dev swp1 clsact
       # devlink dev reload pci/0000:06:00.0
      
      Fixes: bbf73830 ("net: sched: traverse chains in block with tcf_get_next_chain()")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32f2a0af
  11. Jan 23, 2024
  12. Jan 22, 2024
    • David Howells's avatar
      afs: Fix error handling with lookup via FS.InlineBulkStatus · 17ba6f0b
      David Howells authored
      
      When afs does a lookup, it tries to use FS.InlineBulkStatus to preemptively
      look up a bunch of files in the parent directory and cache this locally, on
      the basis that we might want to look at them too (for example if someone
      does an ls on a directory, they may want want to then stat every file
      listed).
      
      FS.InlineBulkStatus can be considered a compound op with the normal abort
      code applying to the compound as a whole.  Each status fetch within the
      compound is then given its own individual abort code - but assuming no
      error that prevents the bulk fetch from returning the compound result will
      be 0, even if all the constituent status fetches failed.
      
      At the conclusion of afs_do_lookup(), we should use the abort code from the
      appropriate status to determine the error to return, if any - but instead
      it is assumed that we were successful if the op as a whole succeeded and we
      return an incompletely initialised inode, resulting in ENOENT, no matter
      the actual reason.  In the particular instance reported, a vnode with no
      permission granted to be accessed is being given a UAEACCES abort code
      which should be reported as EACCES, but is instead being reported as
      ENOENT.
      
      Fix this by abandoning the inode (which will be cleaned up with the op) if
      file[1] has an abort code indicated and turn that abort code into an error
      instead.
      
      Whilst we're at it, add a tracepoint so that the abort codes of the
      individual subrequests of FS.InlineBulkStatus can be logged.  At the moment
      only the container abort code can be 0.
      
      Fixes: e49c7b2f ("afs: Build an abstraction around an "operation" concept")
      Reported-by: default avatarJeffrey Altman <jaltman@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      17ba6f0b
    • Niklas Cassel's avatar
      ata: libata-sata: improve sysfs description for ATA_LPM_UNKNOWN · 73ae7e1c
      Niklas Cassel authored
      
      Currently, both ATA_LPM_UNKNOWN (0) and ATA_LPM_MAX_POWER (1) displays
      as "max_performance" in sysfs.
      
      This is quite misleading as they are not the same.
      
      For ATA_LPM_UNKNOWN, ata_eh_set_lpm() will not be called at all,
      leaving the configuration in unknown state.
      For ATA_LPM_MAX_POWER, ata_eh_set_lpm() is called, and setting the
      policy to ATA_LPM_MAX_POWER.
      
      This also matches the description of the SATA_MOBILE_LPM_POLICY Kconfig:
      0 => Keep firmware settings
      1 => Maximum performance
      
      Thus, update the sysfs description for ATA_LPM_UNKNOWN to match reality.
      
      While at it, update libata.h to mention that the ascii descriptions
      are in libata-sata.c and not in libata-scsi.c.
      
      Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Signed-off-by: default avatarNiklas Cassel <cassel@kernel.org>
      73ae7e1c
    • Thomas Hellström's avatar
      drm/exec, drm/gpuvm: Prefer u32 over uint32_t · cf41cebf
      Thomas Hellström authored
      
      The relatively recently introduced drm/exec utility was using uint32_t
      in its interface, which was then also carried over to drm/gpuvm.
      
      Prefer u32 in new code and update drm/exec and drm/gpuvm accordingly.
      
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Danilo Krummrich <dakr@redhat.com>
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240119090557.6360-1-thomas.hellstrom@linux.intel.com
      cf41cebf
Loading