Skip to content
  1. Oct 13, 2023
    • Linus Torvalds's avatar
      Merge tag 'cgroup-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 20f4757f
      Linus Torvalds authored
      Pull cgroup fixes from Tejun Heo:
      
       - In cgroup1, the `tasks` file could have duplicate pids which can
         trigger a warning in seq_file. Fix it by removing duplicate items
         after sorting
      
       - Comment update
      
      * tag 'cgroup-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        cgroup: Fix incorrect css_set_rwsem reference in comment
        cgroup: Remove duplicates in cgroup v1 tasks file
      20f4757f
    • Linus Torvalds's avatar
      Merge tag 'wq-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · e5e11703
      Linus Torvalds authored
      Pull workqueue fixes from Tejun Heo:
      
       - Fix access-after-free in pwq allocation error path
      
       - Implicitly ordered unbound workqueues should lose the implicit
         ordering if an attribute change which isn't compatible with ordered
         operation is requested. However, attribute changes requested through
         the sysfs interface weren't doing that leaving no way to override the
         implicit ordering through the sysfs interface. Fix it.
      
       - Other doc and misc updates
      
      * tag 'wq-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: fix -Wformat-truncation in create_worker
        workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask()
        workqueue: Use the kmem_cache_free() instead of kfree() to release pwq
        workqueue: doc: Fix function and sysfs path errors
        workqueue: Fix UAF report by KASAN in pwq_release_workfn()
      e5e11703
    • Linus Torvalds's avatar
      Merge tag 'net-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · e8c127b0
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from CAN and BPF.
      
        We have a regression in TC currently under investigation, otherwise
        the things that stand off most are probably the TCP and AF_PACKET
        fixes, with both issues coming from 6.5.
      
        Previous releases - regressions:
      
         - af_packet: fix fortified memcpy() without flex array.
      
         - tcp: fix crashes trying to free half-baked MTU probes
      
         - xdp: fix zero-size allocation warning in xskq_create()
      
         - can: sja1000: always restart the tx queue after an overrun
      
         - eth: mlx5e: again mutually exclude RX-FCS and RX-port-timestamp
      
         - eth: nfp: avoid rmmod nfp crash issues
      
         - eth: octeontx2-pf: fix page pool frag allocation warning
      
        Previous releases - always broken:
      
         - mctp: perform route lookups under a RCU read-side lock
      
         - bpf: s390: fix clobbering the caller's backchain in the trampoline
      
         - phy: lynx-28g: cancel the CDR check work item on the remove path
      
         - dsa: qca8k: fix qca8k driver for Turris 1.x
      
         - eth: ravb: fix use-after-free issue in ravb_tx_timeout_work()
      
         - eth: ixgbe: fix crash with empty VF macvlan list"
      
      * tag 'net-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits)
        rswitch: Fix imbalance phy_power_off() calling
        rswitch: Fix renesas_eth_sw_remove() implementation
        octeontx2-pf: Fix page pool frag allocation warning
        nfc: nci: assert requested protocol is valid
        af_packet: Fix fortified memcpy() without flex array.
        net: tcp: fix crashes trying to free half-baked MTU probes
        net/smc: Fix pos miscalculation in statistics
        nfp: flower: avoid rmmod nfp crash issues
        net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read
        ethtool: Fix mod state of verbose no_mask bitset
        net: nfc: fix races in nfc_llcp_sock_get() and nfc_llcp_sock_get_sn()
        mctp: perform route lookups under a RCU read-side lock
        net: skbuff: fix kernel-doc typos
        s390/bpf: Fix unwinding past the trampoline
        s390/bpf: Fix clobbering the caller's backchain in the trampoline
        net/mlx5e: Again mutually exclude RX-FCS and RX-port-timestamp
        net/smc: Fix dependency of SMC on ISM
        ixgbe: fix crash with empty VF macvlan list
        net/mlx5e: macsec: use update_pn flag instead of PN comparation
        net: phy: mscc: macsec: reject PN update requests
        ...
      e8c127b0
    • Lucy Mielke's avatar
      workqueue: fix -Wformat-truncation in create_worker · 5d9c7a1e
      Lucy Mielke authored
      
      
      Compiling with W=1 emitted the following warning
      (Compiler: gcc (x86-64, ver. 13.2.1, .config: result of make allyesconfig,
      "Treat warnings as errors" turned off):
      
      kernel/workqueue.c:2188:54: warning: ‘%d’ directive output may be
      	truncated writing between 1 and 10 bytes into a region of size
      	between 5 and 14 [-Wformat-truncation=]
      kernel/workqueue.c:2188:50: note: directive argument in the range
      	[0, 2147483647]
      kernel/workqueue.c:2188:17: note: ‘snprintf’ output between 4 and 23 bytes
      	into a destination of size 16
      
      setting "id_buf" to size 23 will silence the warning, since GCC
      determines snprintf's output to be max. 23 bytes in line 2188.
      
      Please let me know if there are any mistakes in my patch!
      
      Signed-off-by: default avatarLucy Mielke <lucymielke@icloud.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      5d9c7a1e
    • Waiman Long's avatar
      workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask() · ca10d851
      Waiman Long authored
      Commit 5c0338c6 ("workqueue: restore WQ_UNBOUND/max_active==1
      to be ordered") enabled implicit ordered attribute to be added to
      WQ_UNBOUND workqueues with max_active of 1. This prevented the changing
      of attributes to these workqueues leading to fix commit 0a94efb5
      ("workqueue: implicit ordered attribute should be overridable").
      
      However, workqueue_apply_unbound_cpumask() was not updated at that time.
      So sysfs changes to wq_unbound_cpumask has no effect on WQ_UNBOUND
      workqueues with implicit ordered attribute. Since not all WQ_UNBOUND
      workqueues are visible on sysfs, we are not able to make all the
      necessary cpumask changes even if we iterates all the workqueue cpumasks
      in sysfs and changing them one by one.
      
      Fix this problem by applying the corresponding change made
      to apply_workqueue_attrs_locked() in the fix commit to
      workqueue_apply_unbound_cpumask().
      
      Fixes: 5c0338c6
      
       ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered")
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      ca10d851
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 9a5a1494
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "AngeloGioacchino Del Regno is stepping in as co-maintainer for the
        MediaTek SoC platform and starts by sending some dts fixes for the
        mt8195 platform that had been pending for a while.
      
        On the ixp4xx platform, Krzysztof Halasa steps down as co-maintainer,
        reflecting that Linus Walleij has been handling this on his own for
        the past few years.
      
        Generic RISC-V kernels are now marked as incompatible with the RZ/Five
        platform that requires custom hacks both for managing its DMA bounce
        buffers and for addressing low virtual memory.
      
       Finally, there is one bugfix for the AMDTEE firmware driver to prevent
       a use-after-free bug"
      
      * tag 'soc-fixes-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        IXP4xx MAINTAINERS entries
        arm64: dts: mediatek: mt8195: Set DSU PMU status to fail
        arm64: dts: mediatek: fix t-phy unit name
        arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
        arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
        MAINTAINERS: Add Angelo as MediaTek SoC co-maintainer
        soc: renesas: Make ARCH_R9A07G043 (riscv version) depend on NONPORTABLE
        tee: amdtee: fix use-after-free vulnerability in amdtee_close_session
      9a5a1494
    • Linus Torvalds's avatar
      Merge tag 'pmdomain-v6.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm · 9b1ad4ba
      Linus Torvalds authored
      Pull pmdomain fix from Ulf Hansson:
      
       - imx: scu-pd: Correct the DMA2 channel
      
      * tag 'pmdomain-v6.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
        pmdomain: imx: scu-pd: correct DMA2 channel
      9b1ad4ba
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 82a040a8
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Some pin control fixes for v6.6 which have been stacking up in my
        tree.
      
        Dmitry's fix to some locking in the core is the most substantial, that
        was a really neat fix.
      
        The rest is the usual assorted spray of minor driver fixes.
      
         - Drop some minor code causing warnings in the Lantiq driver
      
         - Fix out of bounds write in the Nuvoton driver
      
         - Fix lost IRQs with CONFIG_PM in the Starfive driver
      
         - Fix a locking issue in find_pinctrl()
      
         - Revert a regressive Tegra debug patch
      
         - Fix the Renesas RZN1 pin muxing"
      
      * tag 'pinctrl-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: renesas: rzn1: Enable missing PINMUX
        Revert "pinctrl: tegra: Add support to display pin function"
        pinctrl: avoid unsafe code pattern in find_pinctrl()
        pinctrl: starfive: jh7110: Add system pm ops to save and restore context
        pinctrl: starfive: jh7110: Fix failure to set irq after CONFIG_PM is enabled
        pinctrl: nuvoton: wpcm450: fix out of bounds write
        pinctrl: lantiq: Remove unsued declaration ltq_pinctrl_unregister()
      82a040a8
    • Zqiang's avatar
      workqueue: Use the kmem_cache_free() instead of kfree() to release pwq · 7b42f401
      Zqiang authored
      
      
      Currently, the kfree() be used for pwq objects allocated with
      kmem_cache_alloc() in alloc_and_link_pwqs(), this isn't wrong.
      but usually, use "trace_kmem_cache_alloc/trace_kmem_cache_free"
      to track memory allocation and free. this commit therefore use
      kmem_cache_free() instead of kfree() in alloc_and_link_pwqs()
      and also consistent with release of the pwq in rcu_free_pwq().
      
      Signed-off-by: default avatarZqiang <qiang.zhang1211@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      7b42f401
    • WangJinchao's avatar
      workqueue: doc: Fix function and sysfs path errors · bd9e7326
      WangJinchao authored
      
      
      alloc_ordered_queue -> alloc_ordered_workqueue
      /sys/devices/virtual/WQ_NAME/
          -> /sys/devices/virtual/workqueue/WQ_NAME/
      
      Signed-off-by: default avatarWangJinchao <wangjinchao@xfusion.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      bd9e7326
    • Waiman Long's avatar
      cgroup: Fix incorrect css_set_rwsem reference in comment · 13cc9ee8
      Waiman Long authored
      Since commit f0d9a5f1
      
       ("cgroup: make css_set_rwsem a spinlock
      and rename it to css_set_lock"), css_set_rwsem has been replaced by
      css_set_lock. That commit, however, missed the css_set_rwsem reference
      in include/linux/cgroup-defs.h. Fix that by changing it to css_set_lock
      as well.
      
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      13cc9ee8
  2. Oct 12, 2023
    • Krzysztof Hałasa's avatar
      IXP4xx MAINTAINERS entries · 26de1483
      Krzysztof Hałasa authored
      
      
      Update MAINTAINERS entries for Intel IXP4xx SoCs.
      
      Linus has been handling all IXP4xx stuff since 2019 or so.
      
      Signed-off-by: default avatarKrzysztof Hałasa <khalasa@piap.pl>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarDeepak Saxena <dsaxena@plexity.net>
      Link: https://lore.kernel.org/r/m3ttqxu4ru.fsf@t19.piap.pl
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      26de1483
    • Paolo Abeni's avatar
      Merge branch 'rswitch-fix-issues-on-specific-conditions' · b91e8403
      Paolo Abeni authored
      
      
      Yoshihiro Shimoda says:
      
      ====================
      rswitch: Fix issues on specific conditions
      
      This patch series fix some issues of rswitch driver on specific
      condtions.
      ====================
      
      Link: https://lore.kernel.org/r/20231010124858.183891-1-yoshihiro.shimoda.uh@renesas.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      b91e8403
    • Yoshihiro Shimoda's avatar
      rswitch: Fix imbalance phy_power_off() calling · 053f13f6
      Yoshihiro Shimoda authored
      The phy_power_off() should not be called if phy_power_on() failed.
      So, add a condition .power_count before calls phy_power_off().
      
      Fixes: 5cb63092
      
       ("net: renesas: rswitch: Add phy_power_{on,off}() calling")
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      053f13f6
    • Yoshihiro Shimoda's avatar
      rswitch: Fix renesas_eth_sw_remove() implementation · 510b18cf
      Yoshihiro Shimoda authored
      Fix functions calling order and a condition in renesas_eth_sw_remove().
      Otherwise, kernel NULL pointer dereference happens from phy_stop() if
      a net device opens.
      
      Fixes: 3590918b
      
       ("net: ethernet: renesas: Add support for "Ethernet Switch"")
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      510b18cf
    • Ratheesh Kannoth's avatar
      octeontx2-pf: Fix page pool frag allocation warning · 50e49214
      Ratheesh Kannoth authored
      Since page pool param's "order" is set to 0, will result
      in below warn message if interface is configured with higher
      rx buffer size.
      
      Steps to reproduce the issue.
      1. devlink dev param set pci/0002:04:00.0 name receive_buffer_size \
         value 8196 cmode runtime
      2. ifconfig eth0 up
      
      [   19.901356] ------------[ cut here ]------------
      [   19.901361] WARNING: CPU: 11 PID: 12331 at net/core/page_pool.c:567 page_pool_alloc_frag+0x3c/0x230
      [   19.901449] pstate: 82401009 (Nzcv daif +PAN -UAO +TCO -DIT +SSBS BTYPE=--)
      [   19.901451] pc : page_pool_alloc_frag+0x3c/0x230
      [   19.901453] lr : __otx2_alloc_rbuf+0x60/0xbc [rvu_nicpf]
      [   19.901460] sp : ffff80000f66b970
      [   19.901461] x29: ffff80000f66b970 x28: 0000000000000000 x27: 0000000000000000
      [   19.901464] x26: ffff800000d15b68 x25: ffff000195b5c080 x24: ffff0002a5a32dc0
      [   19.901467] x23: ffff0001063c0878 x22: 0000000000000100 x21: 0000000000000000
      [   19.901469] x20: 0000000000000000 x19: ffff00016f781000 x18: 0000000000000000
      [   19.901472] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
      [   19.901474] x14: 0000000000000000 x13: ffff0005ffdc9c80 x12: 0000000000000000
      [   19.901477] x11: ffff800009119a38 x10: 4c6ef2e3ba300519 x9 : ffff800000d13844
      [   19.901479] x8 : ffff0002a5a33cc8 x7 : 0000000000000030 x6 : 0000000000000030
      [   19.901482] x5 : 0000000000000005 x4 : 0000000000000000 x3 : 0000000000000a20
      [   19.901484] x2 : 0000000000001080 x1 : ffff80000f66b9d4 x0 : 0000000000001000
      [   19.901487] Call trace:
      [   19.901488]  page_pool_alloc_frag+0x3c/0x230
      [   19.901490]  __otx2_alloc_rbuf+0x60/0xbc [rvu_nicpf]
      [   19.901494]  otx2_rq_aura_pool_init+0x1c4/0x240 [rvu_nicpf]
      [   19.901498]  otx2_open+0x228/0xa70 [rvu_nicpf]
      [   19.901501]  otx2vf_open+0x20/0xd0 [rvu_nicvf]
      [   19.901504]  __dev_open+0x114/0x1d0
      [   19.901507]  __dev_change_flags+0x194/0x210
      [   19.901510]  dev_change_flags+0x2c/0x70
      [   19.901512]  devinet_ioctl+0x3a4/0x6c4
      [   19.901515]  inet_ioctl+0x228/0x240
      [   19.901518]  sock_ioctl+0x2ac/0x480
      [   19.901522]  __arm64_sys_ioctl+0x564/0xe50
      [   19.901525]  invoke_syscall.constprop.0+0x58/0xf0
      [   19.901529]  do_el0_svc+0x58/0x150
      [   19.901531]  el0_svc+0x30/0x140
      [   19.901533]  el0t_64_sync_handler+0xe8/0x114
      [   19.901535]  el0t_64_sync+0x1a0/0x1a4
      [   19.901537] ---[ end trace 678c0bf660ad8116 ]---
      
      Fixes: b2e3406a
      
       ("octeontx2-pf: Add support for page pool")
      Signed-off-by: default avatarRatheesh Kannoth <rkannoth@marvell.com>
      Reviewed-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
      Link: https://lore.kernel.org/r/20231010034842.3807816-1-rkannoth@marvell.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      50e49214
    • Jeremy Cline's avatar
      nfc: nci: assert requested protocol is valid · 354a6e70
      Jeremy Cline authored
      The protocol is used in a bit mask to determine if the protocol is
      supported. Assert the provided protocol is less than the maximum
      defined so it doesn't potentially perform a shift-out-of-bounds and
      provide a clearer error for undefined protocols vs unsupported ones.
      
      Fixes: 6a2968aa
      
       ("NFC: basic NCI protocol implementation")
      Reported-and-tested-by: default avatar <syzbot+0839b78e119aae1fec78@syzkaller.appspotmail.com>
      Closes: https://syzkaller.appspot.com/bug?extid=0839b78e119aae1fec78
      Signed-off-by: default avatarJeremy Cline <jeremy@jcline.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20231009200054.82557-1-jeremy@jcline.org
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      354a6e70
    • Kuniyuki Iwashima's avatar
      af_packet: Fix fortified memcpy() without flex array. · e2bca487
      Kuniyuki Iwashima authored
      Sergei Trofimovich reported a regression [0] caused by commit a0ade840
      
      
      ("af_packet: Fix warning of fortified memcpy() in packet_getname().").
      
      It introduced a flex array sll_addr_flex in struct sockaddr_ll as a
      union-ed member with sll_addr to work around the fortified memcpy() check.
      
      However, a userspace program uses a struct that has struct sockaddr_ll in
      the middle, where a flex array is illegal to exist.
      
        include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct packet_info_t'
           24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
              |                 ^~~~~~~~~~~~~~~~~~~~
      
      To fix the regression, let's go back to the first attempt [1] telling
      memcpy() the actual size of the array.
      
      Reported-by: default avatarSergei Trofimovich <slyich@gmail.com>
      Closes: https://github.com/NixOS/nixpkgs/pull/252587#issuecomment-1741733002 [0]
      Link: https://lore.kernel.org/netdev/20230720004410.87588-3-kuniyu@amazon.com/ [1]
      Fixes: a0ade840
      
       ("af_packet: Fix warning of fortified memcpy() in packet_getname().")
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Link: https://lore.kernel.org/r/20231009153151.75688-1-kuniyu@amazon.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      e2bca487
    • Ralph Siemsen's avatar
      pinctrl: renesas: rzn1: Enable missing PINMUX · f055ff23
      Ralph Siemsen authored
      Enable pin muxing (eg. programmable function), so that the RZ/N1 GPIO
      pins will be configured as specified by the pinmux in the DTS.
      
      This used to be enabled implicitly via CONFIG_GENERIC_PINMUX_FUNCTIONS,
      however that was removed, since the RZ/N1 driver does not call any of
      the generic pinmux functions.
      
      Fixes: 1308fb4e
      
       ("pinctrl: rzn1: Do not select GENERIC_PIN{CTRL_GROUPS,MUX_FUNCTIONS}")
      Signed-off-by: default avatarRalph Siemsen <ralph.siemsen@linaro.org>
      Reviewed-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Link: https://lore.kernel.org/r/20231004200008.1306798-1-ralph.siemsen@linaro.org
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      f055ff23
    • Jakub Kicinski's avatar
      net: tcp: fix crashes trying to free half-baked MTU probes · 71c299c7
      Jakub Kicinski authored
      tcp_stream_alloc_skb() initializes the skb to use tcp_tsorted_anchor
      which is a union with the destructor. We need to clean that
      TCP-iness up before freeing.
      
      Fixes: 73601329
      
       ("tcp: let tcp_mtu_probe() build headless packets")
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20231010173651.3990234-1-kuba@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      71c299c7
    • Jakub Kicinski's avatar
      Merge tag 'ieee802154-for-net-2023-10-10' of... · 8bcfc9de
      Jakub Kicinski authored
      
      Merge tag 'ieee802154-for-net-2023-10-10' of git://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan
      
      Stefan Schmidt says:
      
      ====================
      pull-request: ieee802154 for net 2023-10-10
      
      Just one small fix this time around.
      
      Dinghao Liu fixed a potential use-after-free in the ca8210 driver probe
      function.
      
      * tag 'ieee802154-for-net-2023-10-10' of git://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan:
        ieee802154: ca8210: Fix a potential UAF in ca8210_probe
      ====================
      
      Link: https://lore.kernel.org/r/20231010200943.82225-1-stefan@datenfreihafen.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8bcfc9de
    • Linus Torvalds's avatar
      Merge tag 'fs_for_v6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 40164485
      Linus Torvalds authored
      Pull quota regression fix from Jan Kara.
      
      * tag 'fs_for_v6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        quota: Fix slow quotaoff
      40164485
    • Linus Torvalds's avatar
      Merge tag 'for-6.6-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 759d1b65
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "A revert of recent mount option parsing fix, this breaks mounts with
        security options.
      
        The second patch is a flexible array annotation"
      
      * tag 'for-6.6-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: add __counted_by for struct btrfs_delayed_item and use struct_size()
        Revert "btrfs: reject unknown mount options early"
      759d1b65
    • Linus Torvalds's avatar
      Merge tag 'ata-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · 8182d7a3
      Linus Torvalds authored
      Pull ata fixes from Damien Le Moal:
      
       - Three fixes for the pata_parport driver to address a typo in the
         code, a missing operation implementation and port reset handling in
         the presence of slave devices (Ondrej)
      
       - Fix handling of ATAPI devices reset with the fit3 protocol driver of
         the pata_parport driver (Ondrej)
      
       - A follow up fix for the recent suspend/resume corrections to avoid
         attempting rescanning on resume the scsi device associated with an
         ata disk when the request queue of the scsi device is still suspended
         (in addition to not doing the rescan if the scsi device itself is
         still suspended) (me)
      
      * tag 'ata-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        scsi: Do not rescan devices with a suspended queue
        ata: pata_parport: fit3: implement IDE command set registers
        ata: pata_parport: add custom version of wait_after_reset
        ata: pata_parport: implement set_devctl
        ata: pata_parport: fix pata_parport_devchk
      8182d7a3
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2023101101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · bab19d1b
      Linus Torvalds authored
      Pull HID fixes from Benjamin Tissoires:
      
       - regression fix for i2c-hid when used on DT platforms (Johan Hovold)
      
       - kernel crash fix on removal of the Logitech USB receiver (Hans de
         Goede)
      
      * tag 'for-linus-2023101101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: logitech-hidpp: Fix kernel crash on receiver USB disconnect
        HID: i2c-hid: fix handling of unpopulated devices
      bab19d1b
    • Linus Torvalds's avatar
      Merge tag 'printk-for-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux · 4524565e
      Linus Torvalds authored
      Pull printk regression fix from Petr Mladek:
      
       - Avoid unnecessary wait and try to flush messages before checking
         pending ones
      
      * tag 'printk-for-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
        printk: flush consoles before checking progress
      4524565e
  3. Oct 11, 2023
    • Petr Mladek's avatar
      9277abd2
    • Gustavo A. R. Silva's avatar
      btrfs: add __counted_by for struct btrfs_delayed_item and use struct_size() · 75f5f60b
      Gustavo A. R. Silva authored
      
      
      Prepare for the coming implementation by GCC and Clang of the __counted_by
      attribute. Flexible array members annotated with __counted_by can have
      their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
      array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
      functions).
      
      While there, use struct_size() helper, instead of the open-coded
      version, to calculate the size for the allocation of the whole
      flexible structure, including of course, the flexible-array member.
      
      This code was found with the help of Coccinelle, and audited and
      fixed manually.
      
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      75f5f60b
    • Nils Hoppmann's avatar
      net/smc: Fix pos miscalculation in statistics · a950a592
      Nils Hoppmann authored
      SMC_STAT_PAYLOAD_SUB(_smc_stats, _tech, key, _len, _rc) will calculate
      wrong bucket positions for payloads of exactly 4096 bytes and
      (1 << (m + 12)) bytes, with m == SMC_BUF_MAX - 1.
      
      Intended bucket distribution:
      Assume l == size of payload, m == SMC_BUF_MAX - 1.
      
      Bucket 0                : 0 < l <= 2^13
      Bucket n, 1 <= n <= m-1 : 2^(n+12) < l <= 2^(n+13)
      Bucket m                : l > 2^(m+12)
      
      Current solution:
      _pos = fls64((l) >> 13)
      [...]
      _pos = (_pos < m) ? ((l == 1 << (_pos + 12)) ? _pos - 1 : _pos) : m
      
      For l == 4096, _pos == -1, but should be _pos == 0.
      For l == (1 << (m + 12)), _pos == m, but should be _pos == m - 1.
      
      In order to avoid special treatment of these corner cases, the
      calculation is adjusted. The new solution first subtracts the length by
      one, and then calculates the correct bucket by shifting accordingly,
      i.e. _pos = fls64((l - 1) >> 13), l > 0.
      This not only fixes the issues named above, but also makes the whole
      bucket assignment easier to follow.
      
      Same is done for SMC_STAT_RMB_SIZE_SUB(_smc_stats, _tech, k, _len),
      where the calculation of the bucket position is similar to the one
      named above.
      
      Fixes: e0e4b8fa
      
       ("net/smc: Add SMC statistics support")
      Suggested-by: default avatarHalil Pasic <pasic@linux.ibm.com>
      Signed-off-by: default avatarNils Hoppmann <niho@linux.ibm.com>
      Reviewed-by: default avatarHalil Pasic <pasic@linux.ibm.com>
      Reviewed-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
      Reviewed-by: default avatarDust Li <dust.li@linux.alibaba.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a950a592
    • Yanguo Li's avatar
      nfp: flower: avoid rmmod nfp crash issues · 14690995
      Yanguo Li authored
      When there are CT table entries, and you rmmod nfp, the following
      events can happen:
      
      task1:
          nfp_net_pci_remove
                ↓
          nfp_flower_stop->(asynchronous)tcf_ct_flow_table_cleanup_work(3)
                ↓
          nfp_zone_table_entry_destroy(1)
      
      task2:
          nfp_fl_ct_handle_nft_flow(2)
      
      When the execution order is (1)->(2)->(3), it will crash. Therefore, in
      the function nfp_fl_ct_del_flow, nf_flow_table_offload_del_cb needs to
      be executed synchronously.
      
      At the same time, in order to solve the deadlock problem and the problem
      of rtnl_lock sometimes failing, replace rtnl_lock with the private
      nfp_fl_lock.
      
      Fixes: 7cc93d88
      
       ("nfp: flower-ct: remove callback delete deadlock")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarYanguo Li <yanguo.li@corigine.com>
      Signed-off-by: default avatarLouis Peens <louis.peens@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      14690995
    • Javier Carrasco's avatar
      net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read · 8f8abb86
      Javier Carrasco authored
      
      
      syzbot has found an uninit-value bug triggered by the dm9601 driver [1].
      
      This error happens because the variable res is not updated if the call
      to dm_read_shared_word returns an error. In this particular case -EPROTO
      was returned and res stayed uninitialized.
      
      This can be avoided by checking the return value of dm_read_shared_word
      and propagating the error if the read operation failed.
      
      [1] https://syzkaller.appspot.com/bug?extid=1f53a30781af65d2c955
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJavier Carrasco <javier.carrasco.cruz@gmail.com>
      Reported-and-tested-by: default avatar <syzbot+1f53a30781af65d2c955@syzkaller.appspotmail.com>
      Acked-by: default avatarPeter Korsgaard <peter@korsgaard.com>
      Fixes: d0374f4f
      
       ("USB: Davicom DM9601 usbnet driver")
      Link: https://lore.kernel.org/r/20231009-topic-dm9601_uninit_mdio_read-v2-1-f2fe39739b6c@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8f8abb86
    • Jakub Kicinski's avatar
      Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · ad98426a
      Jakub Kicinski authored
      
      
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2023-10-11
      
      We've added 14 non-merge commits during the last 5 day(s) which contain
      a total of 12 files changed, 398 insertions(+), 104 deletions(-).
      
      The main changes are:
      
      1) Fix s390 JIT backchain issues in the trampoline code generation which
         previously clobbered the caller's backchain, from Ilya Leoshkevich.
      
      2) Fix zero-size allocation warning in xsk sockets when the configured
         ring size was close to SIZE_MAX, from Andrew Kanner.
      
      3) Fixes for bpf_mprog API that were found when implementing support
         in the ebpf-go library along with selftests, from Daniel Borkmann
         and Lorenz Bauer.
      
      4) Fix riscv JIT to properly sign-extend the return register in programs.
         This fixes various test_progs selftests on riscv, from Björn Töpel.
      
      5) Fix verifier log for async callback return values where the allowed
         range was displayed incorrectly, from David Vernet.
      
      * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        s390/bpf: Fix unwinding past the trampoline
        s390/bpf: Fix clobbering the caller's backchain in the trampoline
        selftests/bpf: Add testcase for async callback return value failure
        bpf: Fix verifier log for async callback return values
        xdp: Fix zero-size allocation warning in xskq_create()
        riscv, bpf: Track both a0 (RISC-V ABI) and a5 (BPF) return values
        riscv, bpf: Sign-extend return values
        selftests/bpf: Make seen_tc* variable tests more robust
        selftests/bpf: Test query on empty mprog and pass revision into attach
        selftests/bpf: Adapt assert_mprog_count to always expect 0 count
        selftests/bpf: Test bpf_mprog query API via libbpf and raw syscall
        bpf: Refuse unused attributes in bpf_prog_{attach,detach}
        bpf: Handle bpf_mprog_query with NULL entry
        bpf: Fix BPF_PROG_QUERY last field check
      ====================
      
      Link: https://lore.kernel.org/r/20231010223610.3984-1-daniel@iogearbox.net
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ad98426a
    • Kory Maincent's avatar
      ethtool: Fix mod state of verbose no_mask bitset · 108a36d0
      Kory Maincent authored
      A bitset without mask in a _SET request means we want exactly the bits in
      the bitset to be set. This works correctly for compact format but when
      verbose format is parsed, ethnl_update_bitset32_verbose() only sets the
      bits present in the request bitset but does not clear the rest. The commit
      66991703 fixes this issue by clearing the whole target bitmap before we
      start iterating. The solution proposed brought an issue with the behavior
      of the mod variable. As the bitset is always cleared the old val will
      always differ to the new val.
      
      Fix it by adding a new temporary variable which save the state of the old
      bitmap.
      
      Fixes: 66991703
      
       ("ethtool: fix application of verbose no_mask bitset")
      Signed-off-by: default avatarKory Maincent <kory.maincent@bootlin.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20231009133645.44503-1-kory.maincent@bootlin.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      108a36d0
    • Jakub Kicinski's avatar
      Merge tag 'linux-can-fixes-for-6.6-20231009' of... · b52acd02
      Jakub Kicinski authored
      
      Merge tag 'linux-can-fixes-for-6.6-20231009' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2023-10-09
      
      Lukas Magel's patch for the CAN ISO-TP protocol fixes the TX state
      detection and wait behavior.
      
      John Watts contributes a patch to only show the sun4i_can Kconfig
      option on ARCH_SUNXI.
      
      A patch by Miquel Raynal fixes the soft-reset workaround for Renesas
      SoCs in the sja1000 driver.
      
      Markus Schneider-Pargmann's patch for the tcan4x5x m_can glue driver
      fixes the id2 register for the tcan4553.
      
      2 patches by Haibo Chen fix the flexcan stop mode for the imx93 SoC.
      
      * tag 'linux-can-fixes-for-6.6-20231009' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
        can: tcan4x5x: Fix id2_register for tcan4553
        can: flexcan: remove the auto stop mode for IMX93
        can: sja1000: Always restart the Tx queue after an overrun
        arm64: dts: imx93: add the Flex-CAN stop mode by GPR
        can: sun4i_can: Only show Kconfig if ARCH_SUNXI is set
        can: isotp: isotp_sendmsg(): fix TX state detection and wait behavior
      ====================
      
      Link: https://lore.kernel.org/r/20231009085256.693378-1-mkl@pengutronix.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b52acd02
    • Eric Dumazet's avatar
      net: nfc: fix races in nfc_llcp_sock_get() and nfc_llcp_sock_get_sn() · 31c07dff
      Eric Dumazet authored
      Sili Luo reported a race in nfc_llcp_sock_get(), leading to UAF.
      
      Getting a reference on the socket found in a lookup while
      holding a lock should happen before releasing the lock.
      
      nfc_llcp_sock_get_sn() has a similar problem.
      
      Finally nfc_llcp_recv_snl() needs to make sure the socket
      found by nfc_llcp_sock_from_sn() does not disappear.
      
      Fixes: 8f50020e
      
       ("NFC: LLCP late binding")
      Reported-by: default avatarSili Luo <rootlab@huawei.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willy Tarreau <w@1wt.eu>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Link: https://lore.kernel.org/r/20231009123110.3735515-1-edumazet@google.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      31c07dff
    • Jeremy Kerr's avatar
      mctp: perform route lookups under a RCU read-side lock · 5093bbfc
      Jeremy Kerr authored
      
      
      Our current route lookups (mctp_route_lookup and mctp_route_lookup_null)
      traverse the net's route list without the RCU read lock held. This means
      the route lookup is subject to preemption, resulting in an potential
      grace period expiry, and so an eventual kfree() while we still have the
      route pointer.
      
      Add the proper read-side critical section locks around the route
      lookups, preventing premption and a possible parallel kfree.
      
      The remaining net->mctp.routes accesses are already under a
      rcu_read_lock, or protected by the RTNL for updates.
      
      Based on an analysis from Sili Luo <rootlab@huawei.com>, where
      introducing a delay in the route lookup could cause a UAF on
      simultaneous sendmsg() and route deletion.
      
      Reported-by: default avatarSili Luo <rootlab@huawei.com>
      Fixes: 889b7da2
      
       ("mctp: Add initial routing framework")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJeremy Kerr <jk@codeconstruct.com.au>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/29c4b0e67dc1bf3571df3982de87df90cae9b631.1696837310.git.jk@codeconstruct.com.au
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5093bbfc
    • Randy Dunlap's avatar
      net: skbuff: fix kernel-doc typos · 8527ca77
      Randy Dunlap authored
      
      
      Correct punctuation and drop an extraneous word.
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20231008214121.25940-1-rdunlap@infradead.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8527ca77
    • Ilya Leoshkevich's avatar
      s390/bpf: Fix unwinding past the trampoline · 5356ba1f
      Ilya Leoshkevich authored
      When functions called by the trampoline panic, the backtrace that is
      printed stops at the trampoline, because the trampoline does not store
      its caller's frame address (backchain) on stack; it also stores the
      return address at a wrong location.
      
      Store both the same way as is already done for the regular eBPF programs.
      
      Fixes: 528eb2cb
      
       ("s390/bpf: Implement arch_prepare_bpf_trampoline()")
      Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20231010203512.385819-3-iii@linux.ibm.com
      5356ba1f
    • Ilya Leoshkevich's avatar
      s390/bpf: Fix clobbering the caller's backchain in the trampoline · ce10fc06
      Ilya Leoshkevich authored
      One of the first things that s390x kernel functions do is storing the
      the caller's frame address (backchain) on stack. This makes unwinding
      possible. The backchain is always stored at frame offset 152, which is
      inside the 160-byte stack area, that the functions allocate for their
      callees. The callees must preserve the backchain; the remaining 152
      bytes they may use as they please.
      
      Currently the trampoline uses all 160 bytes, clobbering the backchain.
      This causes kernel panics when using __builtin_return_address() in
      functions called by the trampoline.
      
      Fix by reducing the usage of the caller-reserved stack area by 8 bytes
      in the trampoline.
      
      Fixes: 528eb2cb
      
       ("s390/bpf: Implement arch_prepare_bpf_trampoline()")
      Reported-by: default avatarSong Liu <song@kernel.org>
      Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20231010203512.385819-2-iii@linux.ibm.com
      ce10fc06
    • Linus Torvalds's avatar
      Merge tag 'xsa441-6.6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 1c8b86a3
      Linus Torvalds authored
      Pull xen fix from Juergen Gross:
       "A fix for the xen events driver:
      
        Closing of an event channel in the Linux kernel can result in a
        deadlock. This happens when the close is being performed in parallel
        to an unrelated Xen console action and the handling of a Xen console
        interrupt in an unprivileged guest.
      
        The closing of an event channel is e.g. triggered by removal of a
        paravirtual device on the other side. As this action will cause
        console messages to be issued on the other side quite often, the
        chance of triggering the deadlock is not negligible"
      
      * tag 'xsa441-6.6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/events: replace evtchn_rwlock with RCU
      1c8b86a3