Module Name:    src
Committed By:   kamil
Date:           Tue May 28 03:56:46 UTC 2019

Modified Files:
        src/sys/netinet6: in6.h

Log Message:
Decorate struct in6_addr with the __packed attribute

This avoids undefined behavior when accessing misaligned pointers.

Detected by kUBSan.

Patch by Akul Pillai.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/netinet6/in6.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/in6.h
diff -u src/sys/netinet6/in6.h:1.94 src/sys/netinet6/in6.h:1.95
--- src/sys/netinet6/in6.h:1.94	Mon Dec 10 16:28:52 2018
+++ src/sys/netinet6/in6.h	Tue May 28 03:56:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.h,v 1.94 2018/12/10 16:28:52 christos Exp $	*/
+/*	$NetBSD: in6.h,v 1.95 2019/05/28 03:56:46 kamil Exp $	*/
 /*	$KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $	*/
 
 /*
@@ -126,7 +126,7 @@ struct in6_addr {
 		__uint16_t  __u6_addr16[8];
 		uint32_t  __u6_addr32[4];
 	} __u6_addr;			/* 128-bit IP6 address */
-};
+} __packed;
 
 #define s6_addr   __u6_addr.__u6_addr8
 #ifdef _KERNEL	/* XXX nonstandard */

Reply via email to