Netdev List
 help / color / mirror / Atom feed
* build failure of next-20220811 due to 332f1795ca20 ("Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression")
From: Sudip Mukherjee (Codethink) @ 2022-08-11 18:53 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, Johan Hedberg, Marcel Holtmann,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-kernel, netdev, linux-bluetooth, linux-next,
	Thomas Bogendoerfer, linux-mips

Hi All,

Not sure if it has been reported, builds of csky and mips allmodconfig
failed to build next-20220811 with gcc-12.

mips error is:

In function 'memcmp',
    inlined from 'bacmp' at ./include/net/bluetooth/bluetooth.h:347:9,
    inlined from 'l2cap_global_chan_by_psm' at net/bluetooth/l2cap_core.c:2003:15:
./include/linux/fortify-string.h:44:33: error: '__builtin_memcmp' specified bound 6 exceeds source size 0 [-Werror=stringop-overread]
   44 | #define __underlying_memcmp     __builtin_memcmp
      |                                 ^
./include/linux/fortify-string.h:420:16: note: in expansion of macro '__underlying_memcmp'
  420 |         return __underlying_memcmp(p, q, size);
      |                ^~~~~~~~~~~~~~~~~~~
In function 'memcmp',
    inlined from 'bacmp' at ./include/net/bluetooth/bluetooth.h:347:9,
    inlined from 'l2cap_global_chan_by_psm' at net/bluetooth/l2cap_core.c:2004:15:
./include/linux/fortify-string.h:44:33: error: '__builtin_memcmp' specified bound 6 exceeds source size 0 [-Werror=stringop-overread]
   44 | #define __underlying_memcmp     __builtin_memcmp
      |                                 ^
./include/linux/fortify-string.h:420:16: note: in expansion of macro '__underlying_memcmp'
  420 |         return __underlying_memcmp(p, q, size);
      |                ^~~~~~~~~~~~~~~~~~~


csky error is:

In file included from net/bluetooth/l2cap_core.c:37:
In function 'bacmp',
    inlined from 'l2cap_global_chan_by_psm' at net/bluetooth/l2cap_core.c:2003:15:
./include/net/bluetooth/bluetooth.h:347:16: error: 'memcmp' specified bound 6 exceeds source size 0 [-Werror=stringop-overread]
  347 |         return memcmp(ba1, ba2, sizeof(bdaddr_t));
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'bacmp',
    inlined from 'l2cap_global_chan_by_psm' at net/bluetooth/l2cap_core.c:2004:15:
./include/net/bluetooth/bluetooth.h:347:16: error: 'memcmp' specified bound 6 exceeds source size 0 [-Werror=stringop-overread]
  347 |         return memcmp(ba1, ba2, sizeof(bdaddr_t));
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


git bisect pointed to 332f1795ca20 ("Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression").
And, reverting that commit has fixed the build failure.

I will be happy to test any patch or provide any extra log if needed.

--
Regards
Sudip

^ permalink raw reply

* [PULL] Networking for 6.0-rc1
From: Jakub Kicinski @ 2022-08-11 18:51 UTC (permalink / raw)
  To: torvalds; +Cc: kuba, davem, netdev, linux-kernel, pabeni

Hi Linus!

The following changes since commit f86d1fbbe7858884d6754534a0afbb74fc30bc26:

  Merge tag 'net-next-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next (2022-08-03 16:29:08 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git tags/net-6.0-rc1

for you to fetch changes up to c2e75634cbe368065f140dd30bf8b1a0355158fd:

  net: atm: bring back zatm uAPI (2022-08-11 10:31:19 -0700)

----------------------------------------------------------------
Including fixes from bluetooth, bpf, can and netfilter.

A little longer PR than usual but it's all fixes, no late features.
It's long partially because of timing, and partially because of
follow ups to stuff that got merged a week or so before the merge
window and wasn't as widely tested. Maybe the Bluetooth fixes are
a little alarming so we'll address that, but the rest seems okay
and not scary.

Notably we're including a fix for the netfilter Kconfig [1], your
WiFi warning [2] and a bluetooth fix which should unblock syzbot [3].

Current release - regressions:

 - Bluetooth:
   - don't try to cancel uninitialized works [3]
   - L2CAP: fix use-after-free caused by l2cap_chan_put

 - tls: rx: fix device offload after recent rework

 - devlink: fix UAF on failed reload and leftover locks in mlxsw

Current release - new code bugs:

 - netfilter:
   - flowtable: fix incorrect Kconfig dependencies [1]
   - nf_tables: fix crash when nf_trace is enabled

 - bpf:
   - use proper target btf when exporting attach_btf_obj_id
   - arm64: fixes for bpf trampoline support

 - Bluetooth:
   - ISO: unlock on error path in iso_sock_setsockopt()
   - ISO: fix info leak in iso_sock_getsockopt()
   - ISO: fix iso_sock_getsockopt for BT_DEFER_SETUP
   - ISO: fix memory corruption on iso_pinfo.base
   - ISO: fix not using the correct QoS
   - hci_conn: fix updating ISO QoS PHY

 - phy: dp83867: fix get nvmem cell fail

Previous releases - regressions:

 - wifi: cfg80211: fix validating BSS pointers in
   __cfg80211_connect_result [2]

 - atm: bring back zatm uAPI after ATM had been removed

 - properly fix old bug making bonding ARP monitor mode not being
   able to work with software devices with lockless Tx

 - tap: fix null-deref on skb->dev in dev_parse_header_protocol

 - revert "net: usb: ax88179_178a needs FLAG_SEND_ZLP" it helps
   some devices and breaks others

 - netfilter:
   - nf_tables: many fixes rejecting cross-object linking
     which may lead to UAFs
   - nf_tables: fix null deref due to zeroed list head
   - nf_tables: validate variable length element extension

 - bgmac: fix a BUG triggered by wrong bytes_compl

 - bcmgenet: indicate MAC is in charge of PHY PM

Previous releases - always broken:

 - bpf:
   - fix bad pointer deref in bpf_sys_bpf() injected via test infra
   - disallow non-builtin bpf programs calling the prog_run command
   - don't reinit map value in prealloc_lru_pop
   - fix UAFs during the read of map iterator fd
   - fix invalidity check for values in sk local storage map
   - reject sleepable program for non-resched map iterator

 - mptcp:
   - move subflow cleanup in mptcp_destroy_common()
   - do not queue data on closed subflows

 - virtio_net: fix memory leak inside XDP_TX with mergeable

 - vsock: fix memory leak when multiple threads try to connect()

 - rework sk_user_data sharing to prevent psock leaks

 - geneve: fix TOS inheriting for ipv4

 - tunnels & drivers: do not use RT_TOS for IPv6 flowlabel

 - phy: c45 baset1: do not skip aneg configuration if clock role
   is not specified

 - rose: avoid overflow when /proc displays timer information

 - x25: fix call timeouts in blocking connects

 - can: mcp251x: fix race condition on receive interrupt

 - can: j1939:
   - replace user-reachable WARN_ON_ONCE() with netdev_warn_once()
   - fix memory leak of skbs in j1939_session_destroy()

Misc:

 - docs: bpf: clarify that many things are not uAPI

 - seg6: initialize induction variable to first valid array index
   (to silence clang vs objtool warning)

 - can: ems_usb: fix clang 14's -Wunaligned-access warning

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

----------------------------------------------------------------
Aijun Sun (1):
      bpf, arm64: Allocate program buffer using kvcalloc instead of kcalloc

Alexandra Winter (1):
      s390/qeth: cache link_info for ethtool

Alexei Starovoitov (4):
      Merge branch 'Don't reinit map value in prealloc_lru_pop'
      bpf: Disallow bpf programs call prog_run command.
      Merge branch 'fixes for bpf map iterator'
      bpf: Shut up kern_sys_bpf warning.

Cezar Bulinaru (2):
      net: tap: NULL pointer derefence in dev_parse_header_protocol when skb->dev is null
      selftests: add few test cases for tap driver

Chen Lin (1):
      dpaa2-eth: trace the allocated address instead of page struct

Chia-Lin Kao (AceLan) (1):
      net: atlantic: fix aq_vec index out of range error

Christophe JAILLET (2):
      netfilter: ip6t_LOG: Fix a typo in a comment
      ax88796: Fix some typo in a comment

Clayton Yager (1):
      macsec: Fix traffic counters/statistics

Dan Carpenter (1):
      Bluetooth: ISO: unlock on error path in iso_sock_setsockopt()

David S. Miller (2):
      Merge branch 'mptcp-fixes'
      Merge tag 'linux-can-fixes-for-6.0-20220810' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can

Duoming Zhou (1):
      atm: idt77252: fix use-after-free bugs caused by tst_timer

Fedor Pchelkin (2):
      can: j1939: j1939_sk_queue_activate_next_locked(): replace WARN_ON_ONCE with netdev_warn_once()
      can: j1939: j1939_session_destroy(): fix memory leak of skbs

Florian Fainelli (2):
      net: phy: Warn about incorrect mdio_bus_phy_resume() state
      net: bcmgenet: Indicate MAC is in charge of PHY PM

Florian Westphal (5):
      selftests: mptcp: make sendfile selftest work
      netfilter: nf_tables: fix crash when nf_trace is enabled
      selftests: netfilter: add test case for nf trace infrastructure
      netfilter: nf_tables: fix null deref due to zeroed list head
      plip: avoid rcu debug splat

Francois Romieu (1):
      net: avoid overflow when rose /proc displays timer information.

Gao Feng (1):
      net: bpf: Use the protocol's set_rcvlowat behavior if there is one

Gerhard Engleder (2):
      tsnep: Fix unused warning for 'tsnep_of_match'
      tsnep: Fix tsnep_tx_unmap() error path usage

Harman Kalra (1):
      octeontx2-af: suppress external profile loading warning

Hawkins Jiawei (2):
      net: fix refcount bug in sk_psock_get (2)
      net: refactor bpf_sk_reuseport_detach()

Hou Tao (9):
      bpf: Acquire map uref in .init_seq_private for array map iterator
      bpf: Acquire map uref in .init_seq_private for hash map iterator
      bpf: Acquire map uref in .init_seq_private for sock local storage map iterator
      bpf: Acquire map uref in .init_seq_private for sock{map,hash} iterator
      bpf: Check the validity of max_rdwr_access for sock local storage map iterator
      bpf: Only allow sleepable program for resched-able iterator
      selftests/bpf: Add tests for reading a dangling map iter fd
      selftests/bpf: Add write tests for sk local storage map iterator
      selftests/bpf: Ensure sleepable program is rejected by hash map iter

Ido Schimmel (2):
      devlink: Fix use-after-free after a failed reload
      selftests: forwarding: Fix failing tests with old libnet

Jakub Kicinski (18):
      Merge branch 'make-dsa-work-with-bonding-s-arp-monitor'
      Merge branch 'netfilter-followup-fixes-for-net'
      Merge branch 'octeontx2-af-driver-fixes-for-npc'
      eth: fix the help in Wangxun's Kconfig
      Merge branch 'tsnep-two-fixes-for-the-driver'
      Merge tag 'for-net-2022-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
      Merge tag 'wireless-2022-08-09' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
      Merge branch 'do-not-use-rt_tos-for-ipv6-flowlabel'
      genetlink: correct uAPI defines
      Merge branch 'net-enhancements-to-sk_user_data-field'
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
      tls: rx: device: bound the frag walk
      tls: rx: device: don't try to copy too much on detach
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
      MAINTAINERS: use my korg address for mt7601u
      net: add missing kdoc for struct genl_multicast_group::flags
      net: atm: bring back zatm uAPI

Jay Vosburgh (1):
      bonding: fix reference count leak in balance-alb mode

Jialiang Wang (1):
      nfp: fix use-after-free in area_cache_get()

Jinghao Jia (1):
      BPF: Fix potential bad pointer dereference in bpf_sys_bpf()

Jiri Olsa (2):
      bpf: Cleanup ftrace hash in bpf_trampoline_put
      mptcp, btf: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled

Jose Alonso (1):
      Revert "net: usb: ax88179_178a needs FLAG_SEND_ZLP"

Kalle Valo (1):
      wifi: wilc1000: fix spurious inline in wilc_handle_disconnect()

Kumar Kartikeya Dwivedi (3):
      bpf: Allow calling bpf_prog_test kfuncs in tracing programs
      bpf: Don't reinit map value in prealloc_lru_pop
      selftests/bpf: Add test for prealloc_lru_pop bug

Luiz Augusto von Dentz (8):
      Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression
      Bluetooth: hci_conn: Fix updating ISO QoS PHY
      Bluetooth: ISO: Fix info leak in iso_sock_getsockopt()
      Bluetooth: ISO: Fix memory corruption
      Bluetooth: hci_event: Fix build warning with C=1
      Bluetooth: MGMT: Fixes build warnings with C=1
      Bluetooth: ISO: Fix iso_sock_getsockopt for BT_DEFER_SETUP
      Bluetooth: ISO: Fix not using the correct QoS

Marc Kleine-Budde (1):
      can: ems_usb: fix clang's -Wunaligned-access warning

Martin Schiller (1):
      net/x25: fix call timeouts in blocking connects

Matthias May (5):
      geneve: fix TOS inheriting for ipv4
      geneve: do not use RT_TOS for IPv6 flowlabel
      vxlan: do not use RT_TOS for IPv6 flowlabel
      mlx5: do not use RT_TOS for IPv6 flowlabel
      ipv6: do not use RT_TOS for IPv6 flowlabel

Maxim Mikityanskiy (1):
      net/tls: Use RCU API to access tls_ctx->netdev

Naveen Mamindlapalli (1):
      octeontx2-pf: Fix NIX_AF_TL3_TL2X_LINKX_CFG register configuration

Nick Child (1):
      MAINTAINERS: Update ibmveth maintainer

Nick Desaulniers (1):
      net: seg6: initialize induction variable to first valid array index

Nikita Shubin (1):
      net: phy: dp83867: fix get nvmem cell fail

Oleksij Rempel (1):
      net: phy: c45 baset1: do not skip aneg configuration if clock role is not specified

Pablo Neira Ayuso (4):
      netfilter: flowtable: fix incorrect Kconfig dependencies
      netfilter: nf_tables: validate variable length element extension
      netfilter: nf_tables: upfront validation of data via nft_data_init()
      netfilter: nf_tables: disallow jump to implicit chain from set element

Paolo Abeni (2):
      mptcp: move subflow cleanup in mptcp_destroy_common()
      mptcp: do not queue data on closed subflows

Paul E. McKenney (3):
      bpf: Update bpf_design_QA.rst to clarify that kprobes is not ABI
      bpf: Update bpf_design_QA.rst to clarify that attaching to functions is not ABI
      bpf: Update bpf_design_QA.rst to clarify that BTF_ID does not ABIify a function

Peilin Ye (2):
      vsock: Fix memory leak in vsock_connect()
      vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout()

Sandor Bodo-Merle (1):
      net: bgmac: Fix a BUG triggered by wrong bytes_compl

Sebastian Würl (1):
      can: mcp251x: Fix race condition on receive interrupt

Slark Xiao (1):
      net: usb: qmi_wwan: Add support for Cinterion MV32

Soenke Huster (1):
      Bluetooth: Fix null pointer deref on unexpected status event

Stanislav Fomichev (2):
      bpf: Use proper target btf when exporting attach_btf_obj_id
      selftests/bpf: Excercise bpf_obj_get_info_by_fd for bpf2bpf

Stanislaw Kardach (1):
      octeontx2-af: Apply tx nibble fixup always

Subbaraya Sundeep (2):
      octeontx2-af: Fix mcam entry resource leak
      octeontx2-af: Fix key checking for source mac

Sun Shouxin (1):
      net:bonding:support balance-alb interface with vlan to bridge

Tetsuo Handa (1):
      Bluetooth: don't try to cancel uninitialized works at mgmt_index_removed()

Thadeu Lima de Souza Cascardo (4):
      netfilter: nf_tables: do not allow SET_ID to refer to another table
      netfilter: nf_tables: do not allow CHAIN_ID to refer to another table
      netfilter: nf_tables: do not allow RULE_ID to refer to another chain
      net_sched: cls_route: remove from list when handle is 0

Topi Miettinen (1):
      netlabel: fix typo in comment

Vadim Pasternak (1):
      mlxsw: minimal: Fix deadlock in ports creation

Veerendranath Jakkam (1):
      wifi: cfg80211: Fix validating BSS pointers in __cfg80211_connect_result

Vladimir Oltean (6):
      net: bonding: replace dev_trans_start() with the jiffies of the last ARP/NS
      net/sched: remove hacks added to dev_trans_start() for bonding to work
      Revert "veth: Add updating of trans_start"
      docs: net: bonding: remove mentions of trans_start
      net: dsa: felix: fix min gate len calculation for tc when its first gate is closed
      net: dsa: felix: suppress non-changes to the tagging protocol

Xu Kuohai (1):
      bpf, arm64: Fix bpf trampoline instruction endianness

Xuan Zhuo (1):
      virtio_net: fix memory leak inside XPD_TX with mergeable

Yang Li (1):
      bnxt_en: Remove duplicated include bnxt_devlink.c

Yu Xiao (1):
      nfp: ethtool: fix the display error of `ethtool -m DEVNAME`

 Documentation/bpf/bpf_design_QA.rst                |  25 ++
 Documentation/networking/bonding.rst               |   9 -
 MAINTAINERS                                        |   4 +-
 arch/arm64/net/bpf_jit_comp.c                      |  16 +-
 drivers/atm/idt77252.c                             |   1 +
 drivers/net/bonding/bond_alb.c                     |  10 +
 drivers/net/bonding/bond_main.c                    |  45 ++-
 drivers/net/can/spi/mcp251x.c                      |  18 +-
 drivers/net/can/usb/ems_usb.c                      |   2 +-
 drivers/net/dsa/ocelot/felix.c                     |   3 +
 drivers/net/dsa/ocelot/felix_vsc9959.c             |  15 +-
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    |  21 +-
 drivers/net/ethernet/broadcom/bgmac.c              |   2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c  |   1 -
 drivers/net/ethernet/broadcom/genet/bcmmii.c       |   3 +
 .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c      |   8 +-
 drivers/net/ethernet/engleder/tsnep_main.c         |  10 +-
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c   |   4 +-
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c    |   6 +
 .../net/ethernet/marvell/octeontx2/af/rvu_npc.c    |  15 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c |   3 +-
 .../ethernet/marvell/octeontx2/nic/otx2_common.c   |  19 +-
 .../ethernet/marvell/octeontx2/nic/otx2_common.h   |   1 +
 .../net/ethernet/mellanox/mlx5/core/en/tc_tun.c    |   4 +-
 .../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c |   8 +-
 drivers/net/ethernet/mellanox/mlxsw/minimal.c      |   7 -
 .../net/ethernet/netronome/nfp/nfp_net_ethtool.c   |   2 +
 .../ethernet/netronome/nfp/nfpcore/nfp_cppcore.c   |   3 +-
 drivers/net/ethernet/wangxun/Kconfig               |   6 +-
 drivers/net/geneve.c                               |  15 +-
 drivers/net/macsec.c                               |  58 ++-
 drivers/net/phy/dp83867.c                          |   2 +-
 drivers/net/phy/phy-c45.c                          |  34 +-
 drivers/net/phy/phy_device.c                       |   6 +
 drivers/net/plip/plip.c                            |   2 +-
 drivers/net/tap.c                                  |  20 +-
 drivers/net/usb/ax88179_178a.c                     |  26 +-
 drivers/net/usb/qmi_wwan.c                         |   2 +
 drivers/net/veth.c                                 |   4 -
 drivers/net/virtio_net.c                           |   5 +-
 drivers/net/vxlan/vxlan_core.c                     |   2 +-
 drivers/net/wireless/microchip/wilc1000/hif.c      |   2 +-
 drivers/net/wireless/microchip/wilc1000/hif.h      |   3 +-
 drivers/s390/net/qeth_core_main.c                  | 168 +++-----
 drivers/s390/net/qeth_ethtool.c                    |  12 +-
 include/linux/bpfptr.h                             |   8 +-
 include/linux/skmsg.h                              |   3 +-
 include/net/ax88796.h                              |   4 +-
 include/net/bonding.h                              |  13 +-
 include/net/genetlink.h                            |   5 +-
 include/net/mptcp.h                                |   4 +
 include/net/netfilter/nf_tables.h                  |  13 +-
 include/net/sock.h                                 |  68 +++-
 include/net/tls.h                                  |   2 +-
 include/uapi/linux/atm_zatm.h                      |  47 +++
 include/uapi/linux/genetlink.h                     |   5 +-
 include/uapi/linux/netfilter_ipv6/ip6t_LOG.h       |   2 +-
 kernel/bpf/arraymap.c                              |   6 +
 kernel/bpf/bpf_iter.c                              |  11 +-
 kernel/bpf/hashtab.c                               |   8 +-
 kernel/bpf/reuseport_array.c                       |   9 +-
 kernel/bpf/syscall.c                               |  35 +-
 kernel/bpf/trampoline.c                            |   5 +-
 net/ax25/ax25_timer.c                              |   4 +-
 net/bluetooth/aosp.c                               |  15 +-
 net/bluetooth/hci_conn.c                           |  11 +-
 net/bluetooth/hci_event.c                          |   7 +-
 net/bluetooth/iso.c                                |  35 +-
 net/bluetooth/l2cap_core.c                         |  13 +-
 net/bluetooth/mgmt.c                               |   7 +-
 net/bluetooth/msft.c                               |  15 +-
 net/bpf/test_run.c                                 |   1 +
 net/can/j1939/socket.c                             |   5 +-
 net/can/j1939/transport.c                          |   8 +-
 net/core/bpf_sk_storage.c                          |  12 +-
 net/core/devlink.c                                 |   4 +-
 net/core/filter.c                                  |   5 +-
 net/core/skmsg.c                                   |   4 +-
 net/core/sock_map.c                                |  20 +-
 net/ipv6/ip6_output.c                              |   3 +-
 net/ipv6/seg6_local.c                              |  10 +-
 net/mptcp/protocol.c                               |  47 ++-
 net/mptcp/protocol.h                               |  13 +-
 net/mptcp/subflow.c                                |   3 +-
 net/netfilter/Kconfig                              |   3 +-
 net/netfilter/nf_tables_api.c                      | 184 ++++++---
 net/netfilter/nf_tables_core.c                     |  21 +-
 net/netfilter/nft_bitwise.c                        |  66 ++--
 net/netfilter/nft_cmp.c                            |  44 +--
 net/netfilter/nft_dynset.c                         |   2 +-
 net/netfilter/nft_immediate.c                      |  22 +-
 net/netfilter/nft_range.c                          |  27 +-
 net/netlabel/netlabel_unlabeled.c                  |   2 +-
 net/sched/cls_route.c                              |   2 +-
 net/sched/sch_generic.c                            |   8 +-
 net/tls/tls_device.c                               |  46 ++-
 net/tls/tls_device_fallback.c                      |   3 +-
 net/tls/tls_strp.c                                 |   2 +-
 net/vmw_vsock/af_vsock.c                           |  10 +-
 net/wireless/sme.c                                 |   8 +-
 net/x25/af_x25.c                                   |   5 +
 tools/lib/bpf/skel_internal.h                      |   4 +-
 tools/testing/selftests/bpf/prog_tests/bpf_iter.c  | 116 +++++-
 .../selftests/bpf/prog_tests/fexit_bpf2bpf.c       |  95 +++++
 tools/testing/selftests/bpf/prog_tests/lru_bug.c   |  21 +
 .../selftests/bpf/progs/bpf_iter_bpf_hash_map.c    |   9 +
 .../bpf/progs/bpf_iter_bpf_sk_storage_map.c        |  22 +-
 tools/testing/selftests/bpf/progs/lru_bug.c        |  49 +++
 tools/testing/selftests/net/.gitignore             |   3 +-
 tools/testing/selftests/net/Makefile               |   2 +-
 .../net/forwarding/custom_multipath_hash.sh        |  24 +-
 .../net/forwarding/gre_custom_multipath_hash.sh    |  24 +-
 .../net/forwarding/ip6gre_custom_multipath_hash.sh |  24 +-
 tools/testing/selftests/net/mptcp/mptcp_connect.c  |  26 +-
 tools/testing/selftests/net/tap.c                  | 434 +++++++++++++++++++++
 .../selftests/netfilter/nft_trans_stress.sh        |  81 +++-
 116 files changed, 1865 insertions(+), 646 deletions(-)
 create mode 100644 include/uapi/linux/atm_zatm.h
 create mode 100644 tools/testing/selftests/bpf/prog_tests/lru_bug.c
 create mode 100644 tools/testing/selftests/bpf/progs/lru_bug.c
 create mode 100644 tools/testing/selftests/net/tap.c

^ permalink raw reply

* Re: [PATCH net-next] net: skb: prevent the split of kfree_skb_reason() by gcc
From: kernel test robot @ 2022-08-11 18:27 UTC (permalink / raw)
  To: menglong8.dong, kuba
  Cc: llvm, kbuild-all, ojeda, ndesaulniers, davem, edumazet, pabeni,
	asml.silence, imagedong, luiz.von.dentz, vasily.averin, jk,
	linux-kernel, netdev
In-Reply-To: <20220811120708.34912-1-imagedong@tencent.com>

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/menglong8-dong-gmail-com/net-skb-prevent-the-split-of-kfree_skb_reason-by-gcc/20220811-200919
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git f86d1fbbe7858884d6754534a0afbb74fc30bc26
config: riscv-randconfig-r042-20220811 (https://download.01.org/0day-ci/archive/20220812/202208120238.cz3RvV74-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 5f1c7e2cc5a3c07cbc2412e851a7283c1841f520)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/8e014b654d9e51abed132155237d855b25da06a0
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review menglong8-dong-gmail-com/net-skb-prevent-the-split-of-kfree_skb_reason-by-gcc/20220811-200919
        git checkout 8e014b654d9e51abed132155237d855b25da06a0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash net/core/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/core/skbuff.c:780:6: warning: unknown attribute 'optimize' ignored [-Wunknown-attributes]
   void __nofnsplit
        ^~~~~~~~~~~
   include/linux/compiler_attributes.h:374:56: note: expanded from macro '__nofnsplit'
   #define __nofnsplit                     __attribute__((optimize("O1")))
                                                          ^~~~~~~~~~~~~~
   1 warning generated.


vim +/optimize +780 net/core/skbuff.c

   770	
   771	/**
   772	 *	kfree_skb_reason - free an sk_buff with special reason
   773	 *	@skb: buffer to free
   774	 *	@reason: reason why this skb is dropped
   775	 *
   776	 *	Drop a reference to the buffer and free it if the usage count has
   777	 *	hit zero. Meanwhile, pass the drop reason to 'kfree_skb'
   778	 *	tracepoint.
   779	 */
 > 780	void __nofnsplit
   781	kfree_skb_reason(struct sk_buff *skb, enum skb_drop_reason reason)
   782	{
   783		if (!skb_unref(skb))
   784			return;
   785	
   786		DEBUG_NET_WARN_ON_ONCE(reason <= 0 || reason >= SKB_DROP_REASON_MAX);
   787	
   788		trace_kfree_skb(skb, __builtin_return_address(0), reason);
   789		__kfree_skb(skb);
   790	}
   791	EXPORT_SYMBOL(kfree_skb_reason);
   792	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply

* Re: [PATCH net] net: atm: bring back zatm uAPI
From: patchwork-bot+netdevbpf @ 2022-08-11 17:40 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, jirislaby, arnd
In-Reply-To: <20220810164547.484378-1-kuba@kernel.org>

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 10 Aug 2022 09:45:47 -0700 you wrote:
> Jiri reports that linux-atm does not build without this header.
> Bring it back. It's completely dead code but we can't break
> the build for user space :(
> 
> Reported-by: Jiri Slaby <jirislaby@kernel.org>
> Fixes: 052e1f01bfae ("net: atm: remove support for ZeitNet ZN122x ATM devices")
> Link: https://lore.kernel.org/all/8576aef3-37e4-8bae-bab5-08f82a78efd3@kernel.org/
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net] net: atm: bring back zatm uAPI
    https://git.kernel.org/netdev/net/c/c2e75634cbe3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply

* Re: [PATCH v2] dpaa2-eth: trace the allocated address instead of page struct
From: patchwork-bot+netdevbpf @ 2022-08-11 17:40 UTC (permalink / raw)
  To: Chen Lin
  Cc: ioana.ciornei, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, yi.liu, chen.lin5
In-Reply-To: <20220811151651.3327-1-chen45464546@163.com>

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 11 Aug 2022 23:16:51 +0800 you wrote:
> We should trace the allocated address instead of page struct.
> 
> Fixes: 27c874867c4 ("dpaa2-eth: Use a single page per Rx buffer")
> Signed-off-by: Chen Lin <chen.lin5@zte.com.cn>
> Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> ---
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Here is the summary with links:
  - [v2] dpaa2-eth: trace the allocated address instead of page struct
    https://git.kernel.org/netdev/net/c/e34f49348f8b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply

* Re: [PATCH net] net: add missing kdoc for struct genl_multicast_group::flags
From: patchwork-bot+netdevbpf @ 2022-08-11 17:40 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, fw
In-Reply-To: <20220809232012.403730-1-kuba@kernel.org>

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  9 Aug 2022 16:20:12 -0700 you wrote:
> Multicast group flags were added in commit 4d54cc32112d ("mptcp: avoid
> lock_fast usage in accept path"), but it missed adding the kdoc.
> 
> Mention which flags go into that field, and do the same for
> op structs.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net] net: add missing kdoc for struct genl_multicast_group::flags
    https://git.kernel.org/netdev/net/c/5c221f0af68c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply

* Re: [PATCH vhost 0/2] virtio_net: fix for stuck when change ring size with dev down
From: Jakub Kicinski @ 2022-08-11 17:37 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Xuan Zhuo, virtualization, Jason Wang, David S. Miller,
	Eric Dumazet, Paolo Abeni, netdev
In-Reply-To: <20220811041041-mutt-send-email-mst@kernel.org>

On Thu, 11 Aug 2022 04:11:22 -0400 Michael S. Tsirkin wrote:
> Which patches does this fix?
> Maybe I should squash.

Side question to make sure I understand the terminology - this 
is *not* a vhost patch, right? vhost is the host side of virtio?
Is the work going via the vhost tree because of some dependencies?

^ permalink raw reply

* Re: [PATCH net] l2tp: Serialize access to sk_user_data with sock lock
From: Jakub Kicinski @ 2022-08-11 17:23 UTC (permalink / raw)
  To: Jakub Sitnicki; +Cc: netdev, kernel-team, van fantasy
In-Reply-To: <20220810102848.282778-1-jakub@cloudflare.com>

On Wed, 10 Aug 2022 12:28:48 +0200 Jakub Sitnicki wrote:
> Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")

That tag immediately sets off red flags. Please find the commit where
to code originates, not where it was last moved.

> Reported-by: van fantasy <g1042620637@gmail.com>
> Tested-by: van fantasy <g1042620637@gmail.com>

Can we get real names? Otherwise let's just drop those tags.
I know that the legal name requirement is only for S-o-b tags,
technically, but it feels silly.

^ permalink raw reply

* Re: [PATCH] Bluetooth: Honor name resolve evt regardless of discov state
From: Luiz Augusto von Dentz @ 2022-08-11 17:20 UTC (permalink / raw)
  To: Archie Pusaka
  Cc: linux-bluetooth, Marcel Holtmann, CrosBT Upstreaming,
	Archie Pusaka, Ying Hsu, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Johan Hedberg, Paolo Abeni,
	Linux Kernel Mailing List, open list:NETWORKING [GENERAL]
In-Reply-To: <CAJQfnxGOcALAOGQb57bMKfU9qe1jBKXFgnPJhHcoVtSGaVk0zQ@mail.gmail.com>

Hi Archie,

On Thu, Aug 11, 2022 at 12:00 AM Archie Pusaka <apusaka@google.com> wrote:
>
> Hi Luiz,
>
> On Thu, 11 Aug 2022 at 03:58, Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > Hi Archie,
> >
> > On Wed, Aug 10, 2022 at 1:47 AM Archie Pusaka <apusaka@google.com> wrote:
> > >
> > > From: Archie Pusaka <apusaka@chromium.org>
> > >
> > > Currently, we don't update the name resolving cache when receiving
> > > a name resolve event if the discovery phase is not in the resolving
> > > stage.
> > >
> > > However, if the user connect to a device while we are still resolving
> > > remote name for another device, discovery will be stopped, and because
> > > we are no longer in the discovery resolving phase, the corresponding
> > > remote name event will be ignored, and thus the device being resolved
> > > will stuck in NAME_PENDING state.
> > >
> > > If discovery is then restarted and then stopped, this will cause us to
> > > try cancelling the name resolve of the same device again, which is
> > > incorrect and might upset the controller.
> >
> > Please add the Fixes tag.
>
> Unfortunately I don't know when was the issue introduced, I don't even
> know whether this is a recent issue or an old one.
> Looking back, this part of the code has stayed this way since 2012.
> Do I still need to add the fixes tag? If so, does it have to be accurate?

Hmm I thought this was related to some recent changes of RNR, we will
need to trace back with git blame, note it important to have the fixes
tag so we can add this change to stable kernels and if that is really
since 2012 that have this bug it probably even more important since it
might be applied to more stable versions.

> >
> > > Signed-off-by: Archie Pusaka <apusaka@chromium.org>
> > > Reviewed-by: Ying Hsu <yinghsu@chromium.org>
> > >
> > > ---
> > > The following steps are performed:
> > >     (1) Prepare 2 classic peer devices that needs RNR. Put device A
> > >         closer to DUT and device B (much) farther from DUT.
> > >     (2) Remove all cache and previous connection from DUT
> > >     (3) Put both peers into pairing mode, then start scanning on DUT
> > >     (4) After ~8 sec, turn off peer B.
> > >     *This is done so DUT can discover peer B (discovery time is 10s),
> > >     but it hasn't started RNR. Peer is turned off to buy us the max
> > >     time in the RNR phase (5s).
> > >     (5) Immediately as device A is shown on UI, click to connect.
> > >     *We thus know that the DUT is in the RNR phase and trying to
> > >     resolve the name of peer B when we initiate connection to peer A.
> > >     (6) Forget peer A.
> > >     (7) Restart scan and stop scan.
> > >     *Before the CL, stop scan is broken because we will try to cancel
> > >     a nonexistent RNR
> > >     (8) Restart scan again. Observe DUT can scan normally.
> > >
> > >
> > >  net/bluetooth/hci_event.c | 17 ++++++++++-------
> > >  1 file changed, 10 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> > > index 395c6479456f..95e145e278c9 100644
> > > --- a/net/bluetooth/hci_event.c
> > > +++ b/net/bluetooth/hci_event.c
> > > @@ -2453,6 +2453,16 @@ static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn,
> > >             !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
> > >                 mgmt_device_connected(hdev, conn, name, name_len);
> > >
> > > +       e = hci_inquiry_cache_lookup_resolve(hdev, bdaddr, NAME_PENDING);
> > > +
> > > +       if (e) {
> > > +               list_del(&e->list);
> > > +
> > > +               e->name_state = name ? NAME_KNOWN : NAME_NOT_KNOWN;
> > > +               mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00, e->data.rssi,
> > > +                                name, name_len);
> > > +       }
> > > +
> > >         if (discov->state == DISCOVERY_STOPPED)
> > >                 return;
> > >
> > > @@ -2462,7 +2472,6 @@ static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn,
> > >         if (discov->state != DISCOVERY_RESOLVING)
> > >                 return;
> > >
> > > -       e = hci_inquiry_cache_lookup_resolve(hdev, bdaddr, NAME_PENDING);
> > >         /* If the device was not found in a list of found devices names of which
> > >          * are pending. there is no need to continue resolving a next name as it
> > >          * will be done upon receiving another Remote Name Request Complete
> > > @@ -2470,12 +2479,6 @@ static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn,
> > >         if (!e)
> > >                 return;
> > >
> > > -       list_del(&e->list);
> > > -
> > > -       e->name_state = name ? NAME_KNOWN : NAME_NOT_KNOWN;
> > > -       mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00, e->data.rssi,
> > > -                        name, name_len);
> > > -
> > >         if (hci_resolve_next_name(hdev))
> > >                 return;
> > >
> > > --
> > > 2.37.1.595.g718a3a8f04-goog
> > >
> >
> >
> > --
> > Luiz Augusto von Dentz
>
> Thanks,
> Archie



-- 
Luiz Augusto von Dentz

^ permalink raw reply

* Re: [PATCH v3 bpf-next 00/15] bpf: net: Remove duplicated code from bpf_setsockopt()
From: sdf @ 2022-08-11 17:04 UTC (permalink / raw)
  To: Martin KaFai Lau
  Cc: bpf, netdev, Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	David Miller, Eric Dumazet, Jakub Kicinski, kernel-team,
	Paolo Abeni
In-Reply-To: <20220810190724.2692127-1-kafai@fb.com>

On 08/10, Martin KaFai Lau wrote:
> The code in bpf_setsockopt() is mostly a copy-and-paste from
> the sock_setsockopt(), do_tcp_setsockopt(), do_ipv6_setsockopt(),
> and do_ip_setsockopt().  As the allowed optnames in bpf_setsockopt()
> grows, so are the duplicated code.  The code between the copies
> also slowly drifted.

> This set is an effort to clean this up and reuse the existing
> {sock,do_tcp,do_ipv6,do_ip}_setsockopt() as much as possible.

> After the clean up, this set also adds a few allowed optnames
> that we need to the bpf_setsockopt().

> The initial attempt was to clean up both bpf_setsockopt() and
> bpf_getsockopt() together.  However, the patch set was getting
> too long.  It is beneficial to leave the bpf_getsockopt()
> out for another patch set.  Thus, this set is focusing
> on the bpf_setsockopt().

> v3:
> - s/in_bpf/has_current_bpf_ctx/ (Andrii)
> - Add comments to has_current_bpf_ctx() and sockopt_lock_sock()
>    (Stanislav)
> - Use vmlinux.h in selftest and add defines to bpf_tracing_net.h
>    (Stanislav)
> - Use bpf_getsockopt(SO_MARK) in selftest (Stanislav)
> - Use BPF_CORE_READ_BITFIELD in selftest (Yonghong)

Reviewed-by: Stanislav Fomichev <sdf@google.com>

(I didn't go super deep on the selftest)

^ permalink raw reply

* Re: [PATCH bpf-next 05/15] bpf: Fix incorrect mem_cgroup_put
From: Roman Gushchin @ 2022-08-11 16:48 UTC (permalink / raw)
  To: Yafang Shao
  Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, sdf, haoluo, jolsa, hannes, mhocko, shakeelb, songmuchun,
	akpm, netdev, bpf, linux-mm
In-Reply-To: <20220810151840.16394-6-laoar.shao@gmail.com>

On Wed, Aug 10, 2022 at 03:18:30PM +0000, Yafang Shao wrote:
> The memcg may be the root_mem_cgroup, in which case we shouldn't put it.
> So a new helper bpf_map_put_memcg() is introduced to pair with
> bpf_map_get_memcg().
> 
> Fixes: 4201d9ab3e42 ("bpf: reparent bpf maps on memcg offlining")
> Cc: Roman Gushchin <roman.gushchin@linux.dev>
> Cc: Shakeel Butt <shakeelb@google.com>
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
>  kernel/bpf/syscall.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 83c7136..51ab8b1 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -441,6 +441,14 @@ static struct mem_cgroup *bpf_map_get_memcg(const struct bpf_map *map)
>  	return root_mem_cgroup;
>  }
>  
> +static void bpf_map_put_memcg(struct mem_cgroup *memcg)
> +{
> +	if (mem_cgroup_is_root(memcg))
> +		return;
> +
> +	mem_cgroup_put(memcg);
> +}

+1 to what Shakeel said. mem_cgroup_put(root_mem_cgroup) is totally valid.
So this change does absolutely nothing.

The fixes tag assumes there is a bug in the existing code. If so, please,
describe the problem and how to reproduce it.

Also, if it's not related to the rest of the patchset, please, send it
separately.

Thanks!

^ permalink raw reply

* Re: [PATCH] fec: Restart PPS after link state change
From: Richard Cochran @ 2022-08-11 16:38 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Csókás Bence, netdev, Fugang Duan
In-Reply-To: <YvRjzwMsMWv3AG1H@lunn.ch>

On Thu, Aug 11, 2022 at 04:05:03AM +0200, Andrew Lunn wrote:
> So your answer also implies PPS can be used before the interface is
> set administratively up?

Why not?

After all, the clock is (or should be) independent from the MAC.
It works all by itself.

Thanks,
Richard


^ permalink raw reply

* Re: [RFC net-next 0/4] ynl: YAML netlink protocol descriptions
From: sdf @ 2022-08-11 16:28 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Stephen Hemminger, netdev, davem, edumazet, pabeni,
	jacob.e.keller, vadfed, johannes, jiri, dsahern, fw, linux-doc,
	Michal Kubecek
In-Reply-To: <20220811083435.1b271c7f@kernel.org>

On 08/11, Jakub Kicinski wrote:
> Randomly adding Michal to CC since I just realized I forgot
> to CC him on the series.

> On Thu, 11 Aug 2022 08:01:52 -0700 Stephen Hemminger wrote:
> > > On Wed, 10 Aug 2022 21:15:34 -0700 Stephen Hemminger wrote:
> > > > Would rather this be part of iproute2 rather than requiring it
> > > > to be maintained separately and part of the kernel tree.
> > >
> > > I don't understand what you're trying to say. What is "this",
> > > what is "separate" from what?
> >
> > I am saying that ynl could live as a standalone project or as
> > part of the iproute2 tools collection.

> It's a bit of a strange beast, because the YNL C library ends up being
> relatively small:

>   tools/net/ynl/lib/ynl.c                  | 528 +++++++++++++++++++++++++
>   tools/net/ynl/lib/ynl.h                  | 112 ++++++

> The logic is mostly in the codegen:

>   gen.py                                   | 1601 +++++++++++++++++++++++++

> but that part we need for kernel C code as well.

> The generated code is largish:

>   tools/net/ynl/generated/dpll-user.c      | 371 ++++++++++++++++++
>   tools/net/ynl/generated/dpll-user.h      | 204 ++++++++++
>   tools/net/ynl/generated/ethtool-user.c   | 367 ++++++++++++++++++
>   tools/net/ynl/generated/ethtool-user.h   | 190 +++++++++
>   tools/net/ynl/generated/fou-user.c       | 322 ++++++++++++++++
>   tools/net/ynl/generated/fou-user.h       | 287 ++++++++++++++
>   tools/net/ynl/generated/genetlink-user.c | 635  
> +++++++++++++++++++++++++++++++
>   tools/net/ynl/generated/genetlink-user.h | 201 ++++++++++

> but we don't have to commit it, it can be created on the fly
> (for instance when a selftest wants to make use of YNL).

> Then again it would feel a lot cleaner for the user space library
> to be a separate project. I've been putting off thinking about the
> distribution until I'm done coding, TBH. Dunno.

my 2c:

Putting it into iproute2 will make it carry a 'networking' badge on it
meaning no other subsystem would look into it.

I'd rather make netlink more generic (s/netlink/kernelink/?) and remove
CONFIG_NET dependency to address https://lwn.net/Articles/897202/

^ permalink raw reply

* Re: [PATCH net 1/1] net: macsec: Fix XPN properties passing to macsec offload
From: Jakub Kicinski @ 2022-08-11 16:25 UTC (permalink / raw)
  To: Emeel Hakim
  Cc: edumazet, mayflowerera, pabeni, netdev, linux-kernel, Raed Salem
In-Reply-To: <20220809102905.31826-1-ehakim@nvidia.com>

On Tue, 9 Aug 2022 13:29:05 +0300 Emeel Hakim wrote:
> Currently macsec invokes HW offload path before reading extended
> packet number (XPN) related user properties i.e. salt and short
> secure channel identifier (ssci), hence preventing macsec XPN HW
> offload.
> 
> Fix by moving macsec XPN properties reading prior to HW offload path.
> 
> Fixes: 48ef50fa866a ("macsec: Netlink support of XPN cipher suites")
> Reviewed-by: Raed Salem <raeds@nvidia.com>
> Signed-off-by: Emeel Hakim <ehakim@nvidia.com>

Is there a driver in the tree which uses those values today?
I can't grep out any rx_sa->key accesses in the drivers at all :S

If there is none it's not really a fix.

^ permalink raw reply

* Re: [RFC net-next 4/4] ynl: add a sample user for ethtool
From: sdf @ 2022-08-11 16:18 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, davem, edumazet, pabeni, jacob.e.keller, vadfed, johannes,
	jiri, dsahern, stephen, fw, linux-doc
In-Reply-To: <20220811022304.583300-5-kuba@kernel.org>

On 08/10, Jakub Kicinski wrote:
> A sample schema describing ethtool channels and a script showing
> that it works. The script is called like this:

>   ./tools/net/ynl/samples/ethtool.py \
>      --spec Documentation/netlink/bindings/ethtool.yaml \
>      --device eth0

> I have schemas for genetlink, FOU and the proposed DPLL subsystem,
> to validate that the concept has wide applicability, but ethtool
> feels like the best demo of the 4.

Looks super promising! I'm going to comment mostly here because it's easier
to talk about the sample schema definition.

> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>   Documentation/netlink/bindings/ethtool.yaml | 115 ++++++++++++++++++++
>   tools/net/ynl/samples/ethtool.py            |  30 +++++
>   2 files changed, 145 insertions(+)
>   create mode 100644 Documentation/netlink/bindings/ethtool.yaml
>   create mode 100755 tools/net/ynl/samples/ethtool.py

> diff --git a/Documentation/netlink/bindings/ethtool.yaml  
> b/Documentation/netlink/bindings/ethtool.yaml
> new file mode 100644
> index 000000000000..b4540d60b4b3
> --- /dev/null
> +++ b/Documentation/netlink/bindings/ethtool.yaml
> @@ -0,0 +1,115 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +
> +name: ethtool
> +
> +description: |
> +  Ethernet device configuration interface.
> +

[..]

> +attr-cnt-suffix: CNT

Is it a hack to make the generated header fit into existing
implementation? Should we #define ETHTOOL_XXX_CNT ETHTOOL_XXX in
the implementation instead? (or s/ETHTOOL_XXX_CNT/ETHTOOL_XXX/ the
source itself?)

> +attribute-spaces:

Are you open to bike shedding? :-) I like how ethtool_netlink.h calls
these 'message types'.

> +  -
> +    name: header
> +    name-prefix: ETHTOOL_A_HEADER_

Any issue with name-prefix+name-suffix being non-greppable? Have you tried
something like this instead:

- name: ETHTOOL_A_HEADER # this is fake, for ynl reference only
   attributes:
     - name: ETHTOOL_A_HEADER_DEV_INDEX
       val:
       type:
     - name ETHTOOL_A_HEADER_DEV_NAME
       ..

It seems a bit easier to map the spec into what it's going to produce.
For example, it took me a while to translate 'channels_get' below into
ETHTOOL_MSG_CHANNELS_GET.

Or is it too much ETHTOOL_A_HEADER_?

> +    attributes:
> +      -
> +        name: dev_index
> +        val: 1
> +        type: u32
> +      -
> +        name: dev_name
> +        type: nul-string

[..]

> +        len: ALTIFNAMSIZ - 1

Not sure how strict you want to be here. ALTIFNAMSIZ is defined
somewhere else it seems? (IOW, do we want to have implicit dependencies
on external/uapi headers?)

> +      -
> +        name: flags
> +        type: u32
> +  -
> +    name: channels
> +    name-prefix: ETHTOOL_A_CHANNELS_
> +    attributes:
> +      -
> +        name: header
> +        val: 1
> +        type: nest
> +        nested-attributes: header
> +      -
> +        name: rx_max
> +        type: u32
> +      -
> +        name: tx_max
> +        type: u32
> +      -
> +        name: other_max
> +        type: u32
> +      -
> +        name: combined_max
> +        type: u32
> +      -
> +        name: rx_count
> +        type: u32
> +      -
> +        name: tx_count
> +        type: u32
> +      -
> +        name: other_count
> +        type: u32
> +      -
> +        name: combined_count
> +        type: u32
> +
> +headers:
> +  user: linux/if.h
> +  uapi: linux/ethtool_netlink.h
> +
> +operations:
> +  name-prefix: ETHTOOL_MSG_
> +  async-prefix: ETHTOOL_MSG_
> +  list:
> +    -
> +      name: channels_get
> +      val: 17
> +      description: Get current and max supported number of channels.
> +      attribute-space: channels
> +      do:
> +        request:
> +          attributes:
> +            - header
> +        reply: &channel_reply
> +          attributes:
> +            - header
> +            - rx_max
> +            - tx_max
> +            - other_max
> +            - combined_max
> +            - rx_count
> +            - tx_count
> +            - other_count
> +            - combined_count
> +      dump:
> +        reply: *channel_reply
> +
> +    -
> +      name: channels_ntf
> +      description: Notification for device changing its number of  
> channels.
> +      notify: channels_get
> +      mcgrp: monitor
> +
> +    -
> +      name: channels_set
> +      description: Set number of channels.
> +      attribute-space: channels
> +      do:
> +        request:
> +          attributes:

[..]

> +            - header
> +            - rx_count
> +            - tx_count
> +            - other_count
> +            - combined_count

My netlink is super rusty, might be worth mentioning in the spec: these
are possible attributes, but are all of them required?

You also mention the validation part in the cover letter, do you plan
add some of these policy properties to the spec or everything is
there already? (I'm assuming we care about the types which we have above and
optional/required attribute indication?)

> +
> +mcast-groups:
> +  name-prefix: ETHTOOL_MCGRP_
> +  name-suffix: _NAME
> +  list:
> +    -
> +      name: monitor
> diff --git a/tools/net/ynl/samples/ethtool.py  
> b/tools/net/ynl/samples/ethtool.py
> new file mode 100755
> index 000000000000..63c8e29f8e5d
> --- /dev/null
> +++ b/tools/net/ynl/samples/ethtool.py
> @@ -0,0 +1,30 @@
> +#!/usr/bin/env python
> +# SPDX-License-Identifier: BSD-3-Clause
> +
> +import argparse
> +
> +from ynl import YnlFamily
> +
> +
> +def main():
> +    parser = argparse.ArgumentParser(description='YNL ethtool sample')
> +    parser.add_argument('--spec', dest='spec', type=str, required=True)
> +    parser.add_argument('--schema', dest='schema', type=str)
> +    parser.add_argument('--device', dest='dev_name', type=str)
> +    parser.add_argument('--ifindex', dest='ifindex', type=str)
> +    args = parser.parse_args()
> +
> +    ynl = YnlFamily(args.spec)
> +
> +    if args.dev_name:
> +        channels = ynl.channels_get({'header': {'dev_name':  
> args.dev_name}})
> +    elif args.ifindex:
> +        channels = ynl.channels_get({'header': {'dev_index':  
> args.ifindex}})
> +    else:
> +        return
> +    print('Netlink responded with:')
> +    print(channels)
> +
> +
> +if __name__ == "__main__":
> +    main()
> --
> 2.37.1


^ permalink raw reply

* [PATCH net 2/2] ice: Fix call trace with null VSI during VF reset
From: Tony Nguyen @ 2022-08-11 16:17 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Michal Jaron, netdev, anthony.l.nguyen, Jedrzej Jagielski,
	Marek Szlosek
In-Reply-To: <20220811161714.305094-1-anthony.l.nguyen@intel.com>

From: Michal Jaron <michalx.jaron@intel.com>

During stress test with attaching and detaching VF from KVM and
simultaneously changing VFs spoofcheck and trust there was a
call trace in ice_reset_vf that VF's VSI is null.

[145237.352797] WARNING: CPU: 46 PID: 840629 at drivers/net/ethernet/intel/ice/ice_vf_lib.c:508 ice_reset_vf+0x3d6/0x410 [ice]
[145237.352851] Modules linked in: ice(E) vfio_pci vfio_pci_core vfio_virqfd vfio_iommu_type1 vfio iavf dm_mod xt_CHECKSUM xt_MASQUERADE
xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink tun
 bridge stp llc sunrpc intel_rapl_msr intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm iTCO_wdt iTC
O_vendor_support irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel rapl ipmi_si intel_cstate ipmi_devintf joydev intel_uncore m
ei_me ipmi_msghandler i2c_i801 pcspkr mei lpc_ich ioatdma i2c_smbus acpi_pad acpi_power_meter ip_tables xfs libcrc32c i2c_algo_bit drm_sh
mem_helper drm_kms_helper sd_mod t10_pi crc64_rocksoft syscopyarea crc64 sysfillrect sg sysimgblt fb_sys_fops drm i40e ixgbe ahci libahci
 libata crc32c_intel mdio dca wmi fuse [last unloaded: ice]
[145237.352917] CPU: 46 PID: 840629 Comm: kworker/46:2 Tainted: G S      W I E     5.19.0-rc6+ #24
[145237.352921] Hardware name: Intel Corporation S2600WTT/S2600WTT, BIOS SE5C610.86B.01.01.0008.021120151325 02/11/2015
[145237.352923] Workqueue: ice ice_service_task [ice]
[145237.352948] RIP: 0010:ice_reset_vf+0x3d6/0x410 [ice]
[145237.352984] Code: 30 ec f3 cc e9 28 fd ff ff 0f b7 4b 50 48 c7 c2 48 19 9c c0 4c 89 ee 48 c7 c7 30 fe 9e c0 e8 d1 21 9d cc 31 c0 e9 a
9 fe ff ff <0f> 0b b8 ea ff ff ff e9 c1 fc ff ff 0f 0b b8 fb ff ff ff e9 91 fe
[145237.352987] RSP: 0018:ffffb453e257fdb8 EFLAGS: 00010246
[145237.352990] RAX: ffff8bd0040181c0 RBX: ffff8be68db8f800 RCX: 0000000000000000
[145237.352991] RDX: 000000000000ffff RSI: 0000000000000000 RDI: ffff8be68db8f800
[145237.352993] RBP: ffff8bd0040181c0 R08: 0000000000001000 R09: ffff8bcfd520e000
[145237.352995] R10: 0000000000000000 R11: 00008417b5ab0bc0 R12: 0000000000000005
[145237.352996] R13: ffff8bcee061c0d0 R14: ffff8bd004019640 R15: 0000000000000000
[145237.352998] FS:  0000000000000000(0000) GS:ffff8be5dfb00000(0000) knlGS:0000000000000000
[145237.353000] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[145237.353002] CR2: 00007fd81f651d68 CR3: 0000001a0fe10001 CR4: 00000000001726e0
[145237.353003] Call Trace:
[145237.353008]  <TASK>
[145237.353011]  ice_process_vflr_event+0x8d/0xb0 [ice]
[145237.353049]  ice_service_task+0x79f/0xef0 [ice]
[145237.353074]  process_one_work+0x1c8/0x390
[145237.353081]  ? process_one_work+0x390/0x390
[145237.353084]  worker_thread+0x30/0x360
[145237.353087]  ? process_one_work+0x390/0x390
[145237.353090]  kthread+0xe8/0x110
[145237.353094]  ? kthread_complete_and_exit+0x20/0x20
[145237.353097]  ret_from_fork+0x22/0x30
[145237.353103]  </TASK>

Remove WARN_ON() from check if VSI is null in ice_reset_vf.
Add "VF is already removed\n" in dev_dbg().

This WARN_ON() is unnecessary and causes call trace, despite that
call trace, driver still works. There is no need for this warn
because this piece of code is responsible for disabling VF's Tx/Rx
queues when VF is disabled, but when VF is already removed there
is no need to do reset or disable queues.

Fixes: efe41860008e ("ice: Fix memory corruption in VF driver")
Signed-off-by: Michal Jaron <michalx.jaron@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_vf_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
index 8fd7c3e37f5e..76f70fe1d998 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
@@ -571,8 +571,10 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)
 
 	if (ice_is_vf_disabled(vf)) {
 		vsi = ice_get_vf_vsi(vf);
-		if (WARN_ON(!vsi))
+		if (!vsi) {
+			dev_dbg(dev, "VF is already removed\n");
 			return -EINVAL;
+		}
 		ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, vf->vf_id);
 		ice_vsi_stop_all_rx_rings(vsi);
 		dev_dbg(dev, "VF is already disabled, there is no need for resetting it, telling VM, all is fine %d\n",
-- 
2.35.1


^ permalink raw reply related

* [PATCH net 1/2] ice: Fix VSI rebuild WARN_ON check for VF
From: Tony Nguyen @ 2022-08-11 16:17 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Benjamin Mikailenko, netdev, anthony.l.nguyen, Marek Szlosek
In-Reply-To: <20220811161714.305094-1-anthony.l.nguyen@intel.com>

From: Benjamin Mikailenko <benjamin.mikailenko@intel.com>

In commit b03d519d3460 ("ice: store VF pointer instead of VF ID")
WARN_ON checks were added to validate the vsi->vf pointer and
catch programming errors. However, one check to vsi->vf was missed.
This caused a call trace when resetting VFs.

Fix ice_vsi_rebuild by encompassing VF pointer in WARN_ON check.

Fixes: b03d519d3460 ("ice: store VF pointer instead of VF ID")
Signed-off-by: Benjamin Mikailenko <benjamin.mikailenko@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index a830f7f9aed0..0d4dbca88964 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -3181,7 +3181,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 
 	pf = vsi->back;
 	vtype = vsi->type;
-	if (WARN_ON(vtype == ICE_VSI_VF) && !vsi->vf)
+	if (WARN_ON(vtype == ICE_VSI_VF && !vsi->vf))
 		return -EINVAL;
 
 	ice_vsi_init_vlan_ops(vsi);
-- 
2.35.1


^ permalink raw reply related

* [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2022-08-11 (ice)
From: Tony Nguyen @ 2022-08-11 16:17 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet; +Cc: Tony Nguyen, netdev

This series contains updates to ice driver only.

Benjamin corrects a misplaced parenthesis for a WARN_ON check.

Michal removes WARN_ON from a check as its recoverable and not
warranting of a call trace.

The following are changes since commit 84ba28901629cd3aa3b24d359bc4da3ac24c2329:
  Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE

Benjamin Mikailenko (1):
  ice: Fix VSI rebuild WARN_ON check for VF

Michal Jaron (1):
  ice: Fix call trace with null VSI during VF reset

 drivers/net/ethernet/intel/ice/ice_lib.c    | 2 +-
 drivers/net/ethernet/intel/ice/ice_vf_lib.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.35.1


^ permalink raw reply

* Re: [RFC PATCH net-next] docs: net: add an explanation of VF (and other) Representors
From: Jakub Kicinski @ 2022-08-11 16:17 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: Edward Cree, ecree, netdev, davem, pabeni, edumazet, corbet,
	linux-doc, linux-net-drivers, Jacob Keller, Jesse Brandeburg,
	Michael Chan, Andy Gospodarek, Saeed Mahameed, Jiri Pirko,
	Shannon Nelson, Simon Horman
In-Reply-To: <CAKgT0UdLFjxdxHTPb7c+Deih2Bciziz=gZxDYWUFsLNNetOFQg@mail.gmail.com>

On Wed, 10 Aug 2022 15:58:54 -0700 Alexander Duyck wrote:
> > Sure, but as an application of that, people talk about e.g. "host"
> >  and "device" ends of a bus, DMA transfer, etc.  As a result of which
> >  "host" has come to mean "computer; server; the big rack-mounted box
> >  you plug cards into".
> > A connotation which is unfortunate once a single device can live on
> >  two separate PCIe hierarchies, connected to two computers each with
> >  its own hostname, and the one which owns the device is the cluster
> >  of embedded CPUs inside the card, rather than the big metal box.  
> 
> I agree that "host" isn't going to work as a multi-host capable device
> might end up having only one "host" that can actually handle the
> configuration of the switch for the entire device. So then you have
> different types of "host" interfaces.

Thank $deity I haven't had to think about multi-host NPU/DPU/IPUs
for a couple of years now, but I think trying to elect a leader in
charge across the hosts is not a good idea there. Much easier to proxy
all configuration thru FW, as much as I hate that (since FW is usually
closed).

That said choosing the term is about intuition not proofs so "host"
won't fly.

^ permalink raw reply

* Re: [PATCH bpf-next 13/15] mm, memcg: Add new helper get_obj_cgroup_from_cgroup
From: Roman Gushchin @ 2022-08-11 16:16 UTC (permalink / raw)
  To: Yafang Shao
  Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, sdf, haoluo, jolsa, hannes, mhocko, shakeelb, songmuchun,
	akpm, netdev, bpf, linux-mm
In-Reply-To: <20220810151840.16394-14-laoar.shao@gmail.com>

On Wed, Aug 10, 2022 at 03:18:38PM +0000, Yafang Shao wrote:
> Introduce new helper get_obj_cgroup_from_cgroup() to get obj_cgroup from
> a specific cgroup.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
>  include/linux/memcontrol.h |  1 +
>  mm/memcontrol.c            | 41 +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 42 insertions(+)
> 
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 2f0a611..901a921 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -1713,6 +1713,7 @@ static inline void set_shrinker_bit(struct mem_cgroup *memcg,
>  int __memcg_kmem_charge_page(struct page *page, gfp_t gfp, int order);
>  void __memcg_kmem_uncharge_page(struct page *page, int order);
>  
> +struct obj_cgroup *get_obj_cgroup_from_cgroup(struct cgroup *cgrp);
>  struct obj_cgroup *get_obj_cgroup_from_current(void);
>  struct obj_cgroup *get_obj_cgroup_from_page(struct page *page);
>  
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 618c366..762cffa 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2908,6 +2908,47 @@ static struct obj_cgroup *__get_obj_cgroup_from_memcg(struct mem_cgroup *memcg)
>  	return objcg;
>  }
>  
> +static struct obj_cgroup *get_obj_cgroup_from_memcg(struct mem_cgroup *memcg)
> +{
> +	struct obj_cgroup *objcg;
> +
> +	if (memcg_kmem_bypass())
> +		return NULL;
> +
> +	rcu_read_lock();
> +	objcg = __get_obj_cgroup_from_memcg(memcg);
> +	rcu_read_unlock();
> +	return objcg;

This code doesn't make sense to me. What does rcu read lock protect here?

^ permalink raw reply

* [PATCH AUTOSEL 4.14 12/14] wifi: rtl8xxxu: Fix the error handling of the probe function
From: Sasha Levin @ 2022-08-11 16:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Zheyu Ma, Kalle Valo, Sasha Levin, Jes.Sorensen, davem, edumazet,
	kuba, pabeni, linux-wireless, netdev
In-Reply-To: <20220811161050.1543183-1-sashal@kernel.org>

From: Zheyu Ma <zheyuma97@gmail.com>

[ Upstream commit 13876f2a087ad352bf640a7a0a4a4229ea6e9e4f ]

When the driver fails at ieee80211_alloc_hw() at the probe time, the
driver will free the 'hw' which is not allocated, causing a bug.

The following log can reveal it:

[   15.981294] BUG: KASAN: user-memory-access in mutex_is_locked+0xe/0x40
[   15.981558] Read of size 8 at addr 0000000000001ab0 by task modprobe/373
[   15.982583] Call Trace:
[   15.984282]  ieee80211_free_hw+0x22/0x390
[   15.984446]  rtl8xxxu_probe+0x3a1/0xab30 [rtl8xxxu]

Fix the bug by changing the order of the error handling.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220716130444.2950690-1-zheyuma97@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 21 ++++++++++---------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 5cf61710ae2f..60a3e421e7bb 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -6055,7 +6055,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	if (!hw) {
 		ret = -ENOMEM;
 		priv = NULL;
-		goto exit;
+		goto err_put_dev;
 	}
 
 	priv = hw->priv;
@@ -6074,24 +6074,24 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 
 	ret = rtl8xxxu_parse_usb(priv, interface);
 	if (ret)
-		goto exit;
+		goto err_set_intfdata;
 
 	ret = rtl8xxxu_identify_chip(priv);
 	if (ret) {
 		dev_err(&udev->dev, "Fatal - failed to identify chip\n");
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	ret = rtl8xxxu_read_efuse(priv);
 	if (ret) {
 		dev_err(&udev->dev, "Fatal - failed to read EFuse\n");
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	ret = priv->fops->parse_efuse(priv);
 	if (ret) {
 		dev_err(&udev->dev, "Fatal - failed to parse EFuse\n");
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	rtl8xxxu_print_chipinfo(priv);
@@ -6099,12 +6099,12 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	ret = priv->fops->load_firmware(priv);
 	if (ret) {
 		dev_err(&udev->dev, "Fatal - failed to load firmware\n");
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	ret = rtl8xxxu_init_device(hw);
 	if (ret)
-		goto exit;
+		goto err_set_intfdata;
 
 	hw->wiphy->max_scan_ssids = 1;
 	hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
@@ -6154,12 +6154,12 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	if (ret) {
 		dev_err(&udev->dev, "%s: Failed to register: %i\n",
 			__func__, ret);
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	return 0;
 
-exit:
+err_set_intfdata:
 	usb_set_intfdata(interface, NULL);
 
 	if (priv) {
@@ -6167,9 +6167,10 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 		mutex_destroy(&priv->usb_buf_mutex);
 		mutex_destroy(&priv->h2c_mutex);
 	}
-	usb_put_dev(udev);
 
 	ieee80211_free_hw(hw);
+err_put_dev:
+	usb_put_dev(udev);
 
 	return ret;
 }
-- 
2.35.1


^ permalink raw reply related

* [PATCH AUTOSEL 4.9 05/12] mlxsw: cmd: Increase 'config_profile.flood_mode' length
From: Sasha Levin @ 2022-08-11 16:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Amit Cohen, Ido Schimmel, David S . Miller, Sasha Levin, petrm,
	edumazet, kuba, pabeni, netdev
In-Reply-To: <20220811161144.1543598-1-sashal@kernel.org>

From: Amit Cohen <amcohen@nvidia.com>

[ Upstream commit 89df3c6261f271c550f120b5ccf4d9c5132e870c ]

Currently, the length of 'config_profile.flood_mode' is defined as 2
bits, while the correct length is 3 bits.

As preparation for unified bridge model, which will use the whole field
length, fix it and increase the field to the correct size.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mellanox/mlxsw/cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/cmd.h b/drivers/net/ethernet/mellanox/mlxsw/cmd.h
index 28271bedd957..f126050389ee 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/cmd.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/cmd.h
@@ -722,7 +722,7 @@ MLXSW_ITEM32(cmd_mbox, config_profile, max_vid_flood_tables, 0x30, 8, 4);
  * max_fid_offset_flood_tables indicates the number of FID-offset tables.
  * max_fid_flood_tables indicates the number of per-FID tables.
  */
-MLXSW_ITEM32(cmd_mbox, config_profile, flood_mode, 0x30, 0, 2);
+MLXSW_ITEM32(cmd_mbox, config_profile, flood_mode, 0x30, 0, 3);
 
 /* cmd_mbox_config_profile_max_fid_offset_flood_tables
  * Maximum number of FID-offset flooding tables.
-- 
2.35.1


^ permalink raw reply related

* [PATCH AUTOSEL 4.9 10/12] wifi: rtl8xxxu: Fix the error handling of the probe function
From: Sasha Levin @ 2022-08-11 16:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Zheyu Ma, Kalle Valo, Sasha Levin, Jes.Sorensen, davem, edumazet,
	kuba, pabeni, linux-wireless, netdev
In-Reply-To: <20220811161144.1543598-1-sashal@kernel.org>

From: Zheyu Ma <zheyuma97@gmail.com>

[ Upstream commit 13876f2a087ad352bf640a7a0a4a4229ea6e9e4f ]

When the driver fails at ieee80211_alloc_hw() at the probe time, the
driver will free the 'hw' which is not allocated, causing a bug.

The following log can reveal it:

[   15.981294] BUG: KASAN: user-memory-access in mutex_is_locked+0xe/0x40
[   15.981558] Read of size 8 at addr 0000000000001ab0 by task modprobe/373
[   15.982583] Call Trace:
[   15.984282]  ieee80211_free_hw+0x22/0x390
[   15.984446]  rtl8xxxu_probe+0x3a1/0xab30 [rtl8xxxu]

Fix the bug by changing the order of the error handling.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220716130444.2950690-1-zheyuma97@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 21 ++++++++++---------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index e73613b9f2f5..ba9ac025d440 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -6023,7 +6023,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	if (!hw) {
 		ret = -ENOMEM;
 		priv = NULL;
-		goto exit;
+		goto err_put_dev;
 	}
 
 	priv = hw->priv;
@@ -6042,24 +6042,24 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 
 	ret = rtl8xxxu_parse_usb(priv, interface);
 	if (ret)
-		goto exit;
+		goto err_set_intfdata;
 
 	ret = rtl8xxxu_identify_chip(priv);
 	if (ret) {
 		dev_err(&udev->dev, "Fatal - failed to identify chip\n");
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	ret = rtl8xxxu_read_efuse(priv);
 	if (ret) {
 		dev_err(&udev->dev, "Fatal - failed to read EFuse\n");
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	ret = priv->fops->parse_efuse(priv);
 	if (ret) {
 		dev_err(&udev->dev, "Fatal - failed to parse EFuse\n");
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	rtl8xxxu_print_chipinfo(priv);
@@ -6067,12 +6067,12 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	ret = priv->fops->load_firmware(priv);
 	if (ret) {
 		dev_err(&udev->dev, "Fatal - failed to load firmware\n");
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	ret = rtl8xxxu_init_device(hw);
 	if (ret)
-		goto exit;
+		goto err_set_intfdata;
 
 	hw->wiphy->max_scan_ssids = 1;
 	hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
@@ -6120,12 +6120,12 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	if (ret) {
 		dev_err(&udev->dev, "%s: Failed to register: %i\n",
 			__func__, ret);
-		goto exit;
+		goto err_set_intfdata;
 	}
 
 	return 0;
 
-exit:
+err_set_intfdata:
 	usb_set_intfdata(interface, NULL);
 
 	if (priv) {
@@ -6133,9 +6133,10 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 		mutex_destroy(&priv->usb_buf_mutex);
 		mutex_destroy(&priv->h2c_mutex);
 	}
-	usb_put_dev(udev);
 
 	ieee80211_free_hw(hw);
+err_put_dev:
+	usb_put_dev(udev);
 
 	return ret;
 }
-- 
2.35.1


^ permalink raw reply related

* [PATCH AUTOSEL 4.14 10/14] can: sja1000: Add Quirk for RZ/N1 SJA1000 CAN controller
From: Sasha Levin @ 2022-08-11 16:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Biju Das, Marc Kleine-Budde, Sasha Levin, wg, davem, edumazet,
	kuba, pabeni, mailhol.vincent, stefan.maetje, socketcan,
	linux-can, netdev
In-Reply-To: <20220811161050.1543183-1-sashal@kernel.org>

From: Biju Das <biju.das.jz@bp.renesas.com>

[ Upstream commit 2d99bfbf3386962692dcccd73931cb0db07a1a43 ]

As per Chapter 6.5.16 of the RZ/N1 Peripheral Manual, The SJA1000
CAN controller does not support Clock Divider Register compared to
the reference Philips SJA1000 device.

This patch adds a device quirk to handle this difference.

Link: https://lore.kernel.org/all/20220710115248.190280-4-biju.das.jz@bp.renesas.com
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/can/sja1000/sja1000.c | 8 +++++---
 drivers/net/can/sja1000/sja1000.h | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 9f107798f904..ae0ca0ab371f 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -184,8 +184,9 @@ static void chipset_init(struct net_device *dev)
 {
 	struct sja1000_priv *priv = netdev_priv(dev);
 
-	/* set clock divider and output control register */
-	priv->write_reg(priv, SJA1000_CDR, priv->cdr | CDR_PELICAN);
+	if (!(priv->flags & SJA1000_QUIRK_NO_CDR_REG))
+		/* set clock divider and output control register */
+		priv->write_reg(priv, SJA1000_CDR, priv->cdr | CDR_PELICAN);
 
 	/* set acceptance filter (accept all) */
 	priv->write_reg(priv, SJA1000_ACCC0, 0x00);
@@ -210,7 +211,8 @@ static void sja1000_start(struct net_device *dev)
 		set_reset_mode(dev);
 
 	/* Initialize chip if uninitialized at this stage */
-	if (!(priv->read_reg(priv, SJA1000_CDR) & CDR_PELICAN))
+	if (!(priv->flags & SJA1000_QUIRK_NO_CDR_REG ||
+	      priv->read_reg(priv, SJA1000_CDR) & CDR_PELICAN))
 		chipset_init(dev);
 
 	/* Clear error counters and error code capture */
diff --git a/drivers/net/can/sja1000/sja1000.h b/drivers/net/can/sja1000/sja1000.h
index 9d46398f8154..7f736f1df547 100644
--- a/drivers/net/can/sja1000/sja1000.h
+++ b/drivers/net/can/sja1000/sja1000.h
@@ -145,7 +145,8 @@
 /*
  * Flags for sja1000priv.flags
  */
-#define SJA1000_CUSTOM_IRQ_HANDLER 0x1
+#define SJA1000_CUSTOM_IRQ_HANDLER	BIT(0)
+#define SJA1000_QUIRK_NO_CDR_REG	BIT(1)
 
 /*
  * SJA1000 private data structure
-- 
2.35.1


^ permalink raw reply related

* [PATCH AUTOSEL 4.9 08/12] can: sja1000: Add Quirk for RZ/N1 SJA1000 CAN controller
From: Sasha Levin @ 2022-08-11 16:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Biju Das, Marc Kleine-Budde, Sasha Levin, wg, davem, edumazet,
	kuba, pabeni, mailhol.vincent, stefan.maetje, socketcan,
	linux-can, netdev
In-Reply-To: <20220811161144.1543598-1-sashal@kernel.org>

From: Biju Das <biju.das.jz@bp.renesas.com>

[ Upstream commit 2d99bfbf3386962692dcccd73931cb0db07a1a43 ]

As per Chapter 6.5.16 of the RZ/N1 Peripheral Manual, The SJA1000
CAN controller does not support Clock Divider Register compared to
the reference Philips SJA1000 device.

This patch adds a device quirk to handle this difference.

Link: https://lore.kernel.org/all/20220710115248.190280-4-biju.das.jz@bp.renesas.com
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/can/sja1000/sja1000.c | 8 +++++---
 drivers/net/can/sja1000/sja1000.h | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 9f107798f904..ae0ca0ab371f 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -184,8 +184,9 @@ static void chipset_init(struct net_device *dev)
 {
 	struct sja1000_priv *priv = netdev_priv(dev);
 
-	/* set clock divider and output control register */
-	priv->write_reg(priv, SJA1000_CDR, priv->cdr | CDR_PELICAN);
+	if (!(priv->flags & SJA1000_QUIRK_NO_CDR_REG))
+		/* set clock divider and output control register */
+		priv->write_reg(priv, SJA1000_CDR, priv->cdr | CDR_PELICAN);
 
 	/* set acceptance filter (accept all) */
 	priv->write_reg(priv, SJA1000_ACCC0, 0x00);
@@ -210,7 +211,8 @@ static void sja1000_start(struct net_device *dev)
 		set_reset_mode(dev);
 
 	/* Initialize chip if uninitialized at this stage */
-	if (!(priv->read_reg(priv, SJA1000_CDR) & CDR_PELICAN))
+	if (!(priv->flags & SJA1000_QUIRK_NO_CDR_REG ||
+	      priv->read_reg(priv, SJA1000_CDR) & CDR_PELICAN))
 		chipset_init(dev);
 
 	/* Clear error counters and error code capture */
diff --git a/drivers/net/can/sja1000/sja1000.h b/drivers/net/can/sja1000/sja1000.h
index 9d46398f8154..7f736f1df547 100644
--- a/drivers/net/can/sja1000/sja1000.h
+++ b/drivers/net/can/sja1000/sja1000.h
@@ -145,7 +145,8 @@
 /*
  * Flags for sja1000priv.flags
  */
-#define SJA1000_CUSTOM_IRQ_HANDLER 0x1
+#define SJA1000_CUSTOM_IRQ_HANDLER	BIT(0)
+#define SJA1000_QUIRK_NO_CDR_REG	BIT(1)
 
 /*
  * SJA1000 private data structure
-- 
2.35.1


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox