Module Name: src Committed By: maxv Date: Fri Nov 29 17:40:16 UTC 2019
Modified Files: src/sys/netatalk: ddp_usrreq.c Log Message: Add sanity check, only sat_len bytes got copied in, the rest is uninitialized. Found by KMSAN. To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sys/netatalk/ddp_usrreq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netatalk/ddp_usrreq.c diff -u src/sys/netatalk/ddp_usrreq.c:1.73 src/sys/netatalk/ddp_usrreq.c:1.74 --- src/sys/netatalk/ddp_usrreq.c:1.73 Sun Feb 24 07:20:33 2019 +++ src/sys/netatalk/ddp_usrreq.c Fri Nov 29 17:40:16 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ddp_usrreq.c,v 1.73 2019/02/24 07:20:33 maxv Exp $ */ +/* $NetBSD: ddp_usrreq.c,v 1.74 2019/11/29 17:40:16 maxv Exp $ */ /* * Copyright (c) 1990,1991 Regents of The University of Michigan. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.73 2019/02/24 07:20:33 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.74 2019/11/29 17:40:16 maxv Exp $"); #include "opt_mbuftrace.h" #include "opt_atalk.h" @@ -97,6 +97,8 @@ at_pcbsetaddr(struct ddpcb *ddp, struct if (sat->sat_family != AF_APPLETALK) return (EAFNOSUPPORT); + if (sat->sat_len != sizeof(*sat)) + return EINVAL; if (sat->sat_addr.s_node != ATADDR_ANYNODE || sat->sat_addr.s_net != ATADDR_ANYNET) {