mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 05:58:57 +00:00
socket: Don't assume m0 != NULL in sbappendcontrol_locked()
Some callers (e.g., ktls_decrypt()) violate this assumption and thus
could trigger a NULL pointer dereference in KMSAN kernels.
Reported by: glebius
Fixes: ec45f952a2
("sockbuf: Add KMSAN checks to sbappend*()")
MFC after: 1 week
This commit is contained in:
parent
d3d0b73557
commit
30f8cb812e
@ -1326,7 +1326,8 @@ sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0,
|
||||
{
|
||||
struct mbuf *m, *mlast;
|
||||
|
||||
kmsan_check_mbuf(m0, "sbappend");
|
||||
if (m0 != NULL)
|
||||
kmsan_check_mbuf(m0, "sbappend");
|
||||
kmsan_check_mbuf(control, "sbappend");
|
||||
|
||||
sbm_clrprotoflags(m0, flags);
|
||||
|
Loading…
Reference in New Issue
Block a user