commit | 1f94d5205d2ad9350878e947097be6ae88f45aa4 | [log] [tgz] |
---|---|---|
author | Eric Dumazet <[email protected]> | Tue Feb 20 08:48:23 2024 +0000 |
committer | COS Cherry Picker <[email protected]> | Wed Mar 13 08:37:43 2024 -0700 |
tree | 525361bb8ac0b2219f8d8203f984a3a319286573 | |
parent | c64a29883b7e3c4ab1c007541b41f9d4a95d7459 [diff] |
net: abort SO_DEVMEM_DONTNEED sooner In case user provided wrong input, SO_DEVMEM_DONTNEED could spin many times (2^32 or more) and lock cpu for many seconds. Abort the loop immediately in case of an error. Note the ABI does not report back number of pages that have been released anyway, so tcpdirect never expected a failure there. Test the unlikely() case first, to reduce indentation level of the fast path. cos-patch: bug Fixes: ac4a2b0ef821 ("PRODKERNEL: net-tcpdirect-fastrak: add SO_DEVMEM_DONTNEED setsockopt to release pages") Tested: Ran syzbot repro Reported-and-tested-by: [email protected] Effort: net-tcpdirect-fastrak Upstream-Plan: 232518966 Google-Bug-Id: 325732619 Signed-off-by: Eric Dumazet <[email protected]> Change-Id: I4c64ec56bd0ea65d030a9e817e64517dc01333a6 Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/65370 Reviewed-by: Mina Almasry <[email protected]> Tested-by: Minh-Anh Nguyen <[email protected]> Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/65431 Reviewed-by: Oleksandr Tymoshenko <[email protected]> Tested-by: Cusky Presubmit Bot <[email protected]> Main-Branch-Verified: Cusky Presubmit Bot <[email protected]>