Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netatalk Mmh, pull up the packet to ether_aarp, otherwis...



details:   https://anonhg.NetBSD.org/src/rev/a84de4de1b9c
branches:  trunk
changeset: 828349:a84de4de1b9c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Dec 09 10:14:04 2017 +0000

description:
Mmh, pull up the packet to ether_aarp, otherwise we're reading past the
end of the mbuf.

diffstat:

 sys/netatalk/aarp.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 3ac443ee1271 -r a84de4de1b9c sys/netatalk/aarp.c
--- a/sys/netatalk/aarp.c       Sat Dec 09 08:03:06 2017 +0000
+++ b/sys/netatalk/aarp.c       Sat Dec 09 10:14:04 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aarp.c,v 1.39 2016/08/01 03:15:30 ozaki-r Exp $        */
+/*     $NetBSD: aarp.c,v 1.40 2017/12/09 10:14:04 maxv Exp $   */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.39 2016/08/01 03:15:30 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.40 2017/12/09 10:14:04 maxv Exp $");
 
 #include "opt_mbuftrace.h"
 
@@ -351,6 +351,11 @@
        struct psref    psref;
        struct ifaddr *ifa;
 
+       /* We should also check ar_hln and ar_pln. */
+       if ((m = m_pullup(m, sizeof(struct ether_aarp))) == NULL) {
+               return;
+       }
+
        ea = mtod(m, struct ether_aarp *);
 
        /* Check to see if from my hardware address */



Home | Main Index | Thread Index | Old Index