git: 599c3d7d7ae5 - main - bpf: assert that calculated header length fits in sockaddr
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 18 Sep 2026 22:43:00 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=599c3d7d7ae54727bca8e6a40aee813522d8e6ff
commit 599c3d7d7ae54727bca8e6a40aee813522d8e6ff
Author: Luis Castellanos <ing.castellanosdz@gmail.com>
AuthorDate: 2026-09-18 22:41:37 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-09-18 22:42:41 +0000
bpf: assert that calculated header length fits in sockaddr
Differential Revision: https://reviews.freebsd.org/D59140
---
sys/net/bpf_ifnet.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sys/net/bpf_ifnet.c b/sys/net/bpf_ifnet.c
index b1e9b63324f3..f4d294f1e8d9 100644
--- a/sys/net/bpf_ifnet.c
+++ b/sys/net/bpf_ifnet.c
@@ -145,6 +145,7 @@ bpf_ifnet_write(void *arg, struct mbuf *m, struct mbuf *mc, int flags)
};
if (hlen != 0) {
+ MPASS(hlen <= sizeof(dst.sa_data));
bcopy(mtod(m, const void *), &dst.sa_data, hlen);
ro.ro_prepend = (char *)&dst.sa_data;
ro.ro_plen = hlen;