| Summary: | BPF gives EIO with sendmsg() where write > pagesize | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Andrew Basterfield <abasterfield> |
| Component: | kern | Assignee: | Warner Losh <imp> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | delphij, evfbsd, florian, grahamperrin |
| Priority: | --- | ||
| Version: | 10.2-STABLE | ||
| Hardware: | amd64 | ||
| OS: | Any | ||
|
Description
Andrew Basterfield
2015-12-09 18:28:02 UTC
I have been encountering the same issue and came up with a patch that fixes the issue, if anyone wants to review it : https://github.com/fflorens/freebsd/commit/92e0329076d3f3bc7d3537aa11786dfd7d26abfb Also opened a PR : https://github.com/freebsd/freebsd/pull/131 Excellent thanks I will be able to have a look at that for my use-case at least Works great many thanks You're welcome, but from what i have been told (see the discussion in the PR : https://github.com/freebsd/freebsd/pull/131 and the chain of email there : https://lists.freebsd.org/pipermail/freebsd-net/2017-November/049231.html) the patch i proposed might not be a good idea under memory pressure. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f13da24715a75ce0fdac31062866877d980aa908 commit f13da24715a75ce0fdac31062866877d980aa908 Author: Florian Florensa <florian@florensa.me> AuthorDate: 2018-02-16 09:53:22 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-06-23 16:39:18 +0000 net/bpf: Fix writing of buffer bigger than PAGESIZE When allocating the mbuf we used m_get2 which fails if len is superior to MJUMPAGESIZE, if its the case, use m_getjcl instead. Reviewed by: kp@ PR: 205164 Pull Request: https://github.com/freebsd/freebsd-src/pull/131 sys/net/bpf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) Hi, Warner, should this be MFC'ed? Just merged this, so closing. It will land once testing is done. If it fails for some reason, I'm never going to merge. A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7965d4d9e326373b4669e451d3bd2a7d840c4b5b commit 7965d4d9e326373b4669e451d3bd2a7d840c4b5b Author: Florian Florensa <florian@florensa.me> AuthorDate: 2023-09-17 14:16:07 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2023-09-17 14:17:51 +0000 net/bpf: Fix writing of buffer bigger than PAGESIZE When allocating the mbuf we used m_get2 which fails if len is superior to MJUMPAGESIZE, if its the case, use m_getjcl instead. Reviewed by: kp@ PR: 205164 Pull Request: https://github.com/freebsd/freebsd-src/pull/131 (cherry picked from commit f13da24715a75ce0fdac31062866877d980aa908) sys/net/bpf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) |