lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <89b344be15b6dc0bf488c4ce8cfad046@us.ibm.com>
Date: Wed, 03 Apr 2024 16:52:33 -0700
From: dwilder <dwilder@...ibm.com>
To: edumazet@...gle.com, pabeni@...hat.com, netdev@...r.kernel.org
Subject: Warning from napi_get_frags_check()

Hi-
When testing CONFIG_MAX_SKB_FRAGS=45 on ppc64le (pages size 64K), I
saw this warning.

[    0.072724] WARNING: CPU: 0 PID: 1 at net/core/skbuff.c:289 
napi_get_frags_check+0x50/0x90

However, when running the same test on x86_64 (page size 4k) I saw no 
warnings!

Printks from the x86_64 box show that warning should have been 
displayed.
[    2.852540] __napi_alloc_skb len=336 SKB_WITH_OVERHEAD(1024)=256 
SKB_WITH_OVERHEAD(PAGE_SIZE)=3328
[    2.852543] napi_get_frags_check skb=ffff936486b23b00 
NAPI_HAS_SMALL_PAGE_FRAG=1 skb->head_frag=1

The broken warning is due to this change from commit dbae2b062824 ("net: 
skb: introduce and use a single page frag cache").
-       WARN_ON_ONCE(skb && skb->head_frag);
+       WARN_ON_ONCE(!NAPI_HAS_SMALL_PAGE_FRAG && skb && 
skb->head_frag);

Since NAPI_HAS_SMALL_PAGE_FRAG is always 1 when page_size=4k the warning 
will never be displayed on x86_64. Also the "single page frag cache" 
will never be used in my test case.

1) Would changing __napi_alloc_skb() and __netdev_alloc_skb() to 
something like below accomplish the original goal?

    if ( (MAX_SKB_FRAGS == default-value) && (len <= 
SKB_WITH_OVERHEAD(1024)) || len > SKB_WITH_OVERHEAD(PAGE_SIZE)......
    else
    if ( (MAX_SKB_FRAGS > default-value )   && (len <= 
SKB_WITH_OVERHEAD(2048)) || len > SKB_WITH_OVERHEAD(PAGE_SIZE)......

2) The "page frag cache" would need a corresponding change to switch to 
a 2k cache with larger MAX_SKB_FRAGS values.
3) napi_get_frags_check() needs fixing.

Regards
David Wilder









Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ