Skip to content

Commit

Permalink
Decorate in6_clearscope() with __noubsan
Browse files Browse the repository at this point in the history
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
  • Loading branch information
krytarowski committed Sep 20, 2019
1 parent 0cbecf0 commit a5df208
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sys/netinet6/scope6.c
@@ -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$ */

/*
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -472,6 +472,7 @@ in6_getscopename(const struct in6_addr *addr)
* 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)
{
Expand Down

0 comments on commit a5df208

Please sign in to comment.