1. 21 Nov, 2022 2 commits
  2. 19 Nov, 2022 11 commits
  3. 18 Nov, 2022 12 commits
  4. 17 Nov, 2022 4 commits
    • Linus Torvalds's avatar
      Merge tag 'net-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 847ccab8
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from bpf.
      
        Current release - regressions:
      
         - tls: fix memory leak in tls_enc_skb() and tls_sw_fallback_init()
      
        Previous releases - regressions:
      
         - bridge: fix memory leaks when changing VLAN protocol
      
         - dsa: make dsa_master_ioctl() see through port_hwtstamp_get() shims
      
         - dsa: don't leak tagger-owned storage on switch driver unbind
      
         - eth: mlxsw: avoid warnings when not offloaded FDB entry with IPv6
           is removed
      
         - eth: stmmac: ensure tx function is not running in
           stmmac_xdp_release()
      
         - eth: hns3: fix return value check bug of rx copybreak
      
        Previous releases - always broken:
      
         - kcm: close race conditions on sk_receive_queue
      
         - bpf: fix alignment problem in bpf_prog_test_run_skb()
      
         - bpf: fix writing offset in case of fault in
           strncpy_from_kernel_nofault
      
         - eth: macvlan: use built-in RCU list checking
      
         - eth: marvell: add sleep time after enabling the loopback bit
      
         - eth: octeon_ep: fix potential memory leak in octep_device_setup()
      
        Misc:
      
         - tcp: configurable source port perturb table size
      
         - bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace)"
      
      * tag 'net-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits)
        net: use struct_group to copy ip/ipv6 header addresses
        net: usb: smsc95xx: fix external PHY reset
        net: usb: qmi_wwan: add Telit 0x103a composition
        netdevsim: Fix memory leak of nsim_dev->fa_cookie
        tcp: configurable source port perturb table size
        l2tp: Serialize access to sk_user_data with sk_callback_lock
        net: thunderbolt: Fix error handling in tbnet_init()
        net: microchip: sparx5: Fix potential null-ptr-deref in sparx_stats_init() and sparx5_start()
        net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init()
        net: dsa: don't leak tagger-owned storage on switch driver unbind
        net/x25: Fix skb leak in x25_lapb_receive_frame()
        net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
        bridge: switchdev: Fix memory leaks when changing VLAN protocol
        net: hns3: fix setting incorrect phy link ksettings for firmware in resetting process
        net: hns3: fix return value check bug of rx copybreak
        net: hns3: fix incorrect hw rss hash type of rx packet
        net: phy: marvell: add sleep time after enabling the loopback bit
        net: ena: Fix error handling in ena_init()
        kcm: close race conditions on sk_receive_queue
        net: ionic: Fix error handling in ionic_init_module()
        ...
      847ccab8
    • Hangbin Liu's avatar
      net: use struct_group to copy ip/ipv6 header addresses · 58e0be1e
      Hangbin Liu authored
      kernel test robot reported warnings when build bonding module with
      make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/bonding/:
      
                       from ../drivers/net/bonding/bond_main.c:35:
      In function ‘fortify_memcpy_chk’,
          inlined from ‘iph_to_flow_copy_v4addrs’ at ../include/net/ip.h:566:2,
          inlined from ‘bond_flow_ip’ at ../drivers/net/bonding/bond_main.c:3984:3:
      ../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of f
      ield (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
        413 |                         __read_overflow2_field(q_size_field, size);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘fortify_memcpy_chk’,
          inlined from ‘iph_to_flow_copy_v6addrs’ at ../include/net/ipv6.h:900:2,
          inlined from ‘bond_flow_ip’ at ../drivers/net/bonding/bond_main.c:3994:3:
      ../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of f
      ield (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
        413 |                         __read_overflow2_field(q_size_field, size);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This is because we try to copy the whole ip/ip6 address to the flow_key,
      while we only point the to ip/ip6 saddr. Note that since these are UAPI
      headers, __struct_group() is used to avoid the compiler warnings.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Fixes: c3f83241 ("net: Add full IPv6 addresses to flow_keys")
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Link: https://lore.kernel.org/r/20221115142400.1204786-1-liuhangbin@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      58e0be1e
    • Alexandru Tachici's avatar
      net: usb: smsc95xx: fix external PHY reset · 809ff97a
      Alexandru Tachici authored
      An external PHY needs settling time after power up or reset.
      In the bind() function an mdio bus is registered. If at this point
      the external PHY is still initialising, no valid PHY ID will be
      read and on phy_find_first() the bind() function will fail.
      
      If an external PHY is present, wait the maximum time specified
      in 802.3 45.2.7.1.1.
      
      Fixes: 05b35e7e ("smsc95xx: add phylib support")
      Signed-off-by: default avatarAlexandru Tachici <alexandru.tachici@analog.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20221115114434.9991-2-alexandru.tachici@analog.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      809ff97a
    • Enrico Sau's avatar
      net: usb: qmi_wwan: add Telit 0x103a composition · e103ba33
      Enrico Sau authored
      Add the following Telit LE910C4-WWX composition:
      
      0x103a: rmnet
      Signed-off-by: default avatarEnrico Sau <enrico.sau@gmail.com>
      Acked-by: default avatarBjørn Mork <bjorn@mork.no>
      Link: https://lore.kernel.org/r/20221115105859.14324-1-enrico.sau@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      e103ba33
  5. 16 Nov, 2022 11 commits
    • Wang Yufen's avatar
      netdevsim: Fix memory leak of nsim_dev->fa_cookie · 064bc731
      Wang Yufen authored
      kmemleak reports this issue:
      
      unreferenced object 0xffff8881bac872d0 (size 8):
        comm "sh", pid 58603, jiffies 4481524462 (age 68.065s)
        hex dump (first 8 bytes):
          04 00 00 00 de ad be ef                          ........
        backtrace:
          [<00000000c80b8577>] __kmalloc+0x49/0x150
          [<000000005292b8c6>] nsim_dev_trap_fa_cookie_write+0xc1/0x210 [netdevsim]
          [<0000000093d78e77>] full_proxy_write+0xf3/0x180
          [<000000005a662c16>] vfs_write+0x1c5/0xaf0
          [<000000007aabf84a>] ksys_write+0xed/0x1c0
          [<000000005f1d2e47>] do_syscall_64+0x3b/0x90
          [<000000006001c6ec>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      The issue occurs in the following scenarios:
      
      nsim_dev_trap_fa_cookie_write()
        kmalloc() fa_cookie
        nsim_dev->fa_cookie = fa_cookie
      ..
      nsim_drv_remove()
      
      The fa_cookie allocked in nsim_dev_trap_fa_cookie_write() is not freed. To
      fix, add kfree(nsim_dev->fa_cookie) to nsim_drv_remove().
      
      Fixes: d3cbb907 ("netdevsim: add ACL trap reporting cookie as a metadata")
      Signed-off-by: default avatarWang Yufen <wangyufen@huawei.com>
      Cc: Jiri Pirko <jiri@mellanox.com>
      Link: https://lore.kernel.org/r/1668504625-14698-1-git-send-email-wangyufen@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      064bc731
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · cc675d22
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "Two trivial cleanups, and three simple fixes"
      
      * tag 'for-linus-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/platform-pci: use define instead of literal number
        xen/platform-pci: add missing free_irq() in error path
        xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too
        xen/pcpu: fix possible memory leak in register_pcpu()
        x86/xen: Use kstrtobool() instead of strtobool()
      cc675d22
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 31c9c4c5
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Aere is a hopefully final round of pin control fixes. Nothing special,
        driver fixes and we caught a potential NULL pointer exception.
      
         - Fix a potential NULL dereference in the core!
      
         - Fix all pin mux routes in the Rockchop PX30 driver
      
         - Fix the UFS pins in the Qualcomm SC8280XP driver
      
         - Fix bias disabling in the Mediatek driver
      
         - Fix debounce time settings in the Mediatek driver"
      
      * tag 'pinctrl-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: mediatek: Export debounce time tables
        pinctrl: mediatek: Fix EINT pins input debounce time configuration
        pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map
        pinctrl: mediatek: common-v2: Fix bias-disable for PULL_PU_PD_RSEL_TYPE
        pinctrl: qcom: sc8280xp: Rectify UFS reset pins
        pinctrl: rockchip: list all pins in a possible mux route for PX30
      31c9c4c5
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.1-4' of... · 941209ef
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
      
       - Surface Pro 9 and Surface Laptop 5 kbd, battery, etc support (this
         is just a few hw-id additions)
      
       - A couple of other hw-id / DMI-quirk additions
      
       - A few small bug fixes + 1 build fix
      
      * tag 'platform-drivers-x86-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tables
        platform/x86: ideapad-laptop: Fix interrupt storm on fn-lock toggle on some Yoga laptops
        platform/x86: hp-wmi: Ignore Smart Experience App event
        platform/surface: aggregator_registry: Add support for Surface Laptop 5
        platform/surface: aggregator_registry: Add support for Surface Pro 9
        platform/surface: aggregator: Do not check for repeated unsequenced packets
        platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017)
        platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr()
        platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized
        platform/x86: thinkpad_acpi: Enable s2idle quirk for 21A1 machine type
        platform/x86/amd: pmc: Add new ACPI ID AMDI0009
        platform/x86/amd: pmc: Remove more CONFIG_DEBUG_FS checks
      941209ef
    • Gleb Mazovetskiy's avatar
      tcp: configurable source port perturb table size · aeac4ec8
      Gleb Mazovetskiy authored
      On embedded systems with little memory and no relevant
      security concerns, it is beneficial to reduce the size
      of the table.
      
      Reducing the size from 2^16 to 2^8 saves 255 KiB
      of kernel RAM.
      
      Makes the table size configurable as an expert option.
      
      The size was previously increased from 2^8 to 2^16
      in commit 4c2c8f03 ("tcp: increase source port perturb table to
      2^16").
      Signed-off-by: default avatarGleb Mazovetskiy <glex.spb@gmail.com>
      Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aeac4ec8
    • Jakub Sitnicki's avatar
      l2tp: Serialize access to sk_user_data with sk_callback_lock · b68777d5
      Jakub Sitnicki authored
      sk->sk_user_data has multiple users, which are not compatible with each
      other. Writers must synchronize by grabbing the sk->sk_callback_lock.
      
      l2tp currently fails to grab the lock when modifying the underlying tunnel
      socket fields. Fix it by adding appropriate locking.
      
      We err on the side of safety and grab the sk_callback_lock also inside the
      sk_destruct callback overridden by l2tp, even though there should be no
      refs allowing access to the sock at the time when sk_destruct gets called.
      
      v4:
      - serialize write to sk_user_data in l2tp sk_destruct
      
      v3:
      - switch from sock lock to sk_callback_lock
      - document write-protection for sk_user_data
      
      v2:
      - update Fixes to point to origin of the bug
      - use real names in Reported/Tested-by tags
      
      Cc: Tom Parkin <tparkin@katalix.com>
      Fixes: 3557baab ("[L2TP]: PPP over L2TP driver core")
      Reported-by: default avatarHaowei Yan <g1042620637@gmail.com>
      Signed-off-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b68777d5
    • Yuan Can's avatar
      net: thunderbolt: Fix error handling in tbnet_init() · f524b728
      Yuan Can authored
      A problem about insmod thunderbolt-net failed is triggered with following
      log given while lsmod does not show thunderbolt_net:
      
       insmod: ERROR: could not insert module thunderbolt-net.ko: File exists
      
      The reason is that tbnet_init() returns tb_register_service_driver()
      directly without checking its return value, if tb_register_service_driver()
      failed, it returns without removing property directory, resulting the
      property directory can never be created later.
      
       tbnet_init()
         tb_register_property_dir() # register property directory
         tb_register_service_driver()
           driver_register()
             bus_add_driver()
               priv = kzalloc(...) # OOM happened
         # return without remove property directory
      
      Fix by remove property directory when tb_register_service_driver() returns
      error.
      
      Fixes: e69b6c02 ("net: Add support for networking over Thunderbolt cable")
      Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
      Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f524b728
    • David S. Miller's avatar
      Merge branch 'microchip-fixes' · e4aa85cf
      David S. Miller authored
      Shang XiaoJing says:
      
      ====================
      net: microchip: Fix potential null-ptr-deref due to create_singlethread_workqueue()
      
      There are some functions call create_singlethread_workqueue() without
      checking ret value, and the NULL workqueue_struct pointer may causes
      null-ptr-deref. Will be fixed by this patch.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4aa85cf
    • Shang XiaoJing's avatar
      net: microchip: sparx5: Fix potential null-ptr-deref in sparx_stats_init() and sparx5_start() · 639f5d00
      Shang XiaoJing authored
      sparx_stats_init() calls create_singlethread_workqueue() and not
      checked the ret value, which may return NULL. And a null-ptr-deref may
      happen:
      
      sparx_stats_init()
          create_singlethread_workqueue() # failed, sparx5->stats_queue is NULL
          queue_delayed_work()
              queue_delayed_work_on()
                  __queue_delayed_work()  # warning here, but continue
                      __queue_work()      # access wq->flags, null-ptr-deref
      
      Check the ret value and return -ENOMEM if it is NULL. So as
      sparx5_start().
      
      Fixes: af4b1102 ("net: sparx5: add ethtool configuration and statistics support")
      Fixes: b37a1bae ("net: sparx5: add mactable support")
      Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      639f5d00
    • Shang XiaoJing's avatar
      net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init() · ba86af37
      Shang XiaoJing authored
      lan966x_stats_init() calls create_singlethread_workqueue() and not
      checked the ret value, which may return NULL. And a null-ptr-deref may
      happen:
      
      lan966x_stats_init()
          create_singlethread_workqueue() # failed, lan966x->stats_queue is NULL
          queue_delayed_work()
              queue_delayed_work_on()
                  __queue_delayed_work()  # warning here, but continue
                      __queue_work()      # access wq->flags, null-ptr-deref
      
      Check the ret value and return -ENOMEM if it is NULL.
      
      Fixes: 12c2d0a5 ("net: lan966x: add ethtool configuration and statistics")
      Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
      Reviewed-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba86af37
    • Hans de Goede's avatar
      platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tables · b44fd994
      Hans de Goede authored
      Add module parameters to allow setting the hw_rfkill_switch and
      set_fn_lock_led feature flags for testing these on laptops which are not
      on the DMI-id based allow lists for these 2 flags.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20221115193400.376159-1-hdegoede@redhat.com
      b44fd994