1. 28 Nov, 2023 9 commits
  2. 27 Nov, 2023 1 commit
  3. 26 Nov, 2023 1 commit
    • Jesper Dangaard Brouer's avatar
      mm/page_pool: catch page_pool memory leaks · dba1b8a7
      Jesper Dangaard Brouer authored
      Pages belonging to a page_pool (PP) instance must be freed through the
      PP APIs in-order to correctly release any DMA mappings and release
      refcnt on the DMA device when freeing PP instance. When PP release a
      page (page_pool_release_page) the page->pp_magic value is cleared.
      
      This patch detect a leaked PP page in free_page_is_bad() via
      unexpected state of page->pp_magic value being PP_SIGNATURE.
      
      We choose to report and treat it as a bad page. It would be possible
      to release the page via returning it to the PP instance as the
      page->pp pointer is likely still valid.
      
      Notice this code is only activated when either compiled with
      CONFIG_DEBUG_VM or boot cmdline debug_pagealloc=on, and
      CONFIG_PAGE_POOL.
      
      Reduced example output of leak with PP_SIGNATURE = dead000000000040:
      
       BUG: Bad page state in process swapper/4  pfn:141fa6
       page:000000006dbf8062 refcount:0 mapcount:0 mapping:0000000000000000 index:0x141fa6000 pfn:0x141fa6
       flags: 0x2fffff80000000(node=0|zone=2|lastcpupid=0x1fffff)
       page_type: 0xffffffff()
       raw: 002fffff80000000 dead000000000040 ffff88814888a000 0000000000000000
       raw: 0000000141fa6000 0000000000000001 00000000ffffffff 0000000000000000
       page dumped because: page_pool leak
       [...]
       Call Trace:
        <IRQ>
        dump_stack_lvl+0x32/0x50
        bad_page+0x70/0xf0
        free_unref_page_prepare+0x263/0x430
        free_unref_page+0x34/0x130
        mlx5e_free_rx_mpwqe+0x190/0x1c0 [mlx5_core]
        mlx5e_post_rx_mpwqes+0x1ac/0x280 [mlx5_core]
        mlx5e_napi_poll+0x12b/0x710 [mlx5_core]
        ? skb_free_head+0x4f/0x90
        __napi_poll+0x2b/0x1c0
        net_rx_action+0x27b/0x360
      
      The advantage is the Call Trace directly points to the function
      leaking the PP page, which in this case is an on purpose bug
      introduced into the mlx5 driver to test this code change.
      
      Currently PP will periodically in page_pool_release_retry()
      printk warning "stalled pool shutdown" which cannot be directly
      corrolated to leaking and might as well be a false positive
      due to SKBs being stuck on a socket for an extended period.
      After this patch we should be able to remove this printk.
      Signed-off-by: default avatarJesper Dangaard Brouer <hawk@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dba1b8a7
  4. 25 Nov, 2023 4 commits
  5. 24 Nov, 2023 21 commits
  6. 23 Nov, 2023 4 commits
    • Jakub Kicinski's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 45c226dd
      Jakub Kicinski authored
      Cross-merge networking fixes after downstream PR.
      
      Conflicts:
      
      drivers/net/ethernet/intel/ice/ice_main.c
        c9663f79 ("ice: adjust switchdev rebuild path")
        77580179 ("ice: restore timestamp configuration after device reset")
      https://lore.kernel.org/all/20231121211259.3348630-1-anthony.l.nguyen@intel.com/
      
      Adjacent changes:
      
      kernel/bpf/verifier.c
        bb124da6 ("bpf: keep track of max number of bpf_loop callback iterations")
        5f99f312 ("bpf: add register bounds sanity checks and sanitization")
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      45c226dd
    • Linus Torvalds's avatar
      Merge tag 'net-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · d3fa86b1
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bpf.
      
        Current release - regressions:
      
         - Revert "net: r8169: Disable multicast filter for RTL8168H and
           RTL8107E"
      
         - kselftest: rtnetlink: fix ip route command typo
      
        Current release - new code bugs:
      
         - s390/ism: make sure ism driver implies smc protocol in kconfig
      
         - two build fixes for tools/net
      
        Previous releases - regressions:
      
         - rxrpc: couple of ACK/PING/RTT handling fixes
      
        Previous releases - always broken:
      
         - bpf: verify bpf_loop() callbacks as if they are called unknown
           number of times
      
         - improve stability of auto-bonding with Hyper-V
      
         - account BPF-neigh-redirected traffic in interface statistics
      
        Misc:
      
         - net: fill in some more MODULE_DESCRIPTION()s"
      
      * tag 'net-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (58 commits)
        tools: ynl: fix duplicate op name in devlink
        tools: ynl: fix header path for nfsd
        net: ipa: fix one GSI register field width
        tls: fix NULL deref on tls_sw_splice_eof() with empty record
        net: axienet: Fix check for partial TX checksum
        vsock/test: fix SEQPACKET message bounds test
        i40e: Fix adding unsupported cloud filters
        ice: restore timestamp configuration after device reset
        ice: unify logic for programming PFINT_TSYN_MSK
        ice: remove ptp_tx ring parameter flag
        amd-xgbe: propagate the correct speed and duplex status
        amd-xgbe: handle the corner-case during tx completion
        amd-xgbe: handle corner-case during sfp hotplug
        net: veth: fix ethtool stats reporting
        octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx queue than its PF
        net: usb: qmi_wwan: claim interface 4 for ZTE MF290
        Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E"
        net/smc: avoid data corruption caused by decline
        nfc: virtual_ncidev: Add variable to check if ndev is running
        dpll: Fix potential msg memleak when genlmsg_put_reply failed
        ...
      d3fa86b1
    • Jakub Kicinski's avatar
      tools: ynl: fix duplicate op name in devlink · 39f04b14
      Jakub Kicinski authored
      We don't support CRUD-inspired message types in YNL too well.
      One aspect that currently trips us up is the fact that single
      message ID can be used in multiple commands (as the response).
      This leads to duplicate entries in the id-to-string tables:
      
      devlink-user.c:19:34: warning: initialized field overwritten [-Woverride-init]
         19 |         [DEVLINK_CMD_PORT_NEW] = "port-new",
            |                                  ^~~~~~~~~~
      devlink-user.c:19:34: note: (near initialization for ‘devlink_op_strmap[7]’)
      
      Fixes tag points at where the code was generated, the "real" problem
      is that the code generator does not support CRUD.
      
      Fixes: f2f9dd16 ("netlink: specs: devlink: add the remaining command to generate complete split_ops")
      Link: https://lore.kernel.org/r/20231123030558.1611831-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      39f04b14
    • Jakub Kicinski's avatar
      tools: ynl: fix header path for nfsd · 2be35a61
      Jakub Kicinski authored
      The makefile dependency is trying to include the wrong header:
      
      <command-line>: fatal error: ../../../../include/uapi//linux/nfsd.h: No such file or directory
      
      The guard also looks wrong.
      
      Fixes: f14122b2 ("tools: ynl: Add source files for nfsd netlink protocol")
      Reviewed-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Link: https://lore.kernel.org/r/20231123030624.1611925-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2be35a61