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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CJrradVmkT-HM6goIYbivHNdWglG0h11_0Ky2ObV_ZCOunJaksIj9alG1UTHCkSDX_Jhm6uB5P5vS8C75QfrjWrqeHisUIDn2023xfv7jp0=@protonmail.com>
Date: Sat, 22 Jun 2024 12:20:05 +0000
From: Zac Ecob <zacecob@...tonmail.com>
To: "bpf@...r.kernel.org" <bpf@...r.kernel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Returning negative values repeatedly from a SOCK_FILTER ebpf prog stalls kernel thread

Problem is title. 

To trigger, I attached an EBPF prof that just returned -1, and send ~1000 packets through it.

After doing some investigation, the `sk_wmem_alloc` member of `struct sk` seems to only be increasing, presumably missing some refcnt_dec somewhere. 

At a certain point, in `sock_alloc_send_pskb`, we fail the check: 

`
if (sk_wmem_alloc_get(sk) < READ_ONCE(sk->sk_sndbuf))
` 

Upon which we enter `sock_wait_for_wmem` and schedule a massive timeout (at least that's what happened in my tests).

Not sure where the missing refcnt subs are, must admit unfamiliarity with the network code.

Please let me know if I need to add anything. 

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ