Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 Decorate in6_clearscope() with __noubsan



details:   https://anonhg.NetBSD.org/src/rev/0bd89a52fd98
branches:  trunk
changeset: 965521:0bd89a52fd98
user:      kamil <kamil%NetBSD.org@localhost>
date:      Fri Sep 20 14:53:24 2019 +0000

description:
Decorate in6_clearscope() with __noubsan

sys/netinet6/scope6.c:480:6,
member access within misaligned address 0xffff9457bc441286 for type
'struct in6_addr' which requires 4 byte alignment

This issue is caused by accessing non-__packed struct in __packed.
This is a[always?] false-positive reported by the sanitizer and there is no
clear non-invasive approach to handle this, without changing ABI of long
term existing code.

Reported-by: syzbot+b53a9bcf030288081e65%syzkaller.appspotmail.com@localhost

diffstat:

 sys/netinet6/scope6.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 8436b78e66fd -r 0bd89a52fd98 sys/netinet6/scope6.c
--- a/sys/netinet6/scope6.c     Fri Sep 20 14:20:45 2019 +0000
+++ b/sys/netinet6/scope6.c     Fri Sep 20 14:53:24 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scope6.c,v 1.20 2018/05/01 07:21:39 maxv Exp $ */
+/*     $NetBSD: scope6.c,v 1.21 2019/09/20 14:53:24 kamil Exp $        */
 /*     $KAME$  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.20 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.21 2019/09/20 14:53:24 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -472,6 +472,7 @@
  * Just clear the embedded scope identifier.  Return 0 if the original address
  * is intact; return non 0 if the address is modified.
  */
+__noubsan
 int
 in6_clearscope(struct in6_addr *in6)
 {



Home | Main Index | Thread Index | Old Index