linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
@ 2017-07-18 14:55 Alexander Potapenko
  2017-07-18 15:02 ` Alexander Potapenko
  2017-08-08 18:47 ` Marcelo Ricardo Leitner
  0 siblings, 2 replies; 7+ messages in thread
From: Alexander Potapenko @ 2017-07-18 14:55 UTC (permalink / raw)
  To: dvyukov, kcc, edumazet, davem, vyasevich; +Cc: linux-kernel, linux-sctp

KMSAN reported use of uninitialized sctp_addr->v4.sin_addr.s_addr and
sctp_addr->v6.sin6_scope_id in sctp_v6_cmp_addr() (see below).
Make sure all fields of an IPv6 address are initialized, which
guarantees that the IPv4 fields are also initialized.

==================================================================
 BUG: KMSAN: use of uninitialized memory in sctp_v6_cmp_addr+0x8d4/0x9f0
 net/sctp/ipv6.c:517
 CPU: 2 PID: 31056 Comm: syz-executor1 Not tainted 4.11.0-rc5+ #2944
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
 01/01/2011
 Call Trace:
  dump_stack+0x172/0x1c0 lib/dump_stack.c:42
  is_logbuf_locked mm/kmsan/kmsan.c:59 [inline]
  kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:938
  native_save_fl arch/x86/include/asm/irqflags.h:18 [inline]
  arch_local_save_flags arch/x86/include/asm/irqflags.h:72 [inline]
  arch_local_irq_save arch/x86/include/asm/irqflags.h:113 [inline]
  __msan_warning_32+0x61/0xb0 mm/kmsan/kmsan_instr.c:467
  sctp_v6_cmp_addr+0x8d4/0x9f0 net/sctp/ipv6.c:517
  sctp_v6_get_dst+0x8c7/0x1630 net/sctp/ipv6.c:290
  sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
  sctp_assoc_add_peer+0x66d/0x16f0 net/sctp/associola.c:651
  sctp_sendmsg+0x35a5/0x4f90 net/sctp/socket.c:1871
  inet_sendmsg+0x498/0x670 net/ipv4/af_inet.c:762
  sock_sendmsg_nosec net/socket.c:633 [inline]
  sock_sendmsg net/socket.c:643 [inline]
  SYSC_sendto+0x608/0x710 net/socket.c:1696
  SyS_sendto+0x8a/0xb0 net/socket.c:1664
  entry_SYSCALL_64_fastpath+0x13/0x94
 RIP: 0033:0x44b479
 RSP: 002b:00007f6213f21c08 EFLAGS: 00000286 ORIG_RAX: 000000000000002c
 RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 000000000044b479
 RDX: 0000000000000041 RSI: 0000000020edd000 RDI: 0000000000000006
 RBP: 00000000007080a8 R08: 0000000020b85fe4 R09: 000000000000001c
 R10: 0000000000040005 R11: 0000000000000286 R12: 00000000ffffffff
 R13: 0000000000003760 R14: 00000000006e5820 R15: 0000000000ff8000
 origin description: ----dst_saddr@sctp_v6_get_dst
 local variable created at:
  sk_fullsock include/net/sock.h:2321 [inline]
  inet6_sk include/linux/ipv6.h:309 [inline]
  sctp_v6_get_dst+0x91/0x1630 net/sctp/ipv6.c:241
  sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
==================================================================
 BUG: KMSAN: use of uninitialized memory in sctp_v6_cmp_addr+0x8d4/0x9f0
 net/sctp/ipv6.c:517
 CPU: 2 PID: 31056 Comm: syz-executor1 Not tainted 4.11.0-rc5+ #2944
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
 01/01/2011
 Call Trace:
  dump_stack+0x172/0x1c0 lib/dump_stack.c:42
  is_logbuf_locked mm/kmsan/kmsan.c:59 [inline]
  kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:938
  native_save_fl arch/x86/include/asm/irqflags.h:18 [inline]
  arch_local_save_flags arch/x86/include/asm/irqflags.h:72 [inline]
  arch_local_irq_save arch/x86/include/asm/irqflags.h:113 [inline]
  __msan_warning_32+0x61/0xb0 mm/kmsan/kmsan_instr.c:467
  sctp_v6_cmp_addr+0x8d4/0x9f0 net/sctp/ipv6.c:517
  sctp_v6_get_dst+0x8c7/0x1630 net/sctp/ipv6.c:290
  sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
  sctp_assoc_add_peer+0x66d/0x16f0 net/sctp/associola.c:651
  sctp_sendmsg+0x35a5/0x4f90 net/sctp/socket.c:1871
  inet_sendmsg+0x498/0x670 net/ipv4/af_inet.c:762
  sock_sendmsg_nosec net/socket.c:633 [inline]
  sock_sendmsg net/socket.c:643 [inline]
  SYSC_sendto+0x608/0x710 net/socket.c:1696
  SyS_sendto+0x8a/0xb0 net/socket.c:1664
  entry_SYSCALL_64_fastpath+0x13/0x94
 RIP: 0033:0x44b479
 RSP: 002b:00007f6213f21c08 EFLAGS: 00000286 ORIG_RAX: 000000000000002c
 RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 000000000044b479
 RDX: 0000000000000041 RSI: 0000000020edd000 RDI: 0000000000000006
 RBP: 00000000007080a8 R08: 0000000020b85fe4 R09: 000000000000001c
 R10: 0000000000040005 R11: 0000000000000286 R12: 00000000ffffffff
 R13: 0000000000003760 R14: 00000000006e5820 R15: 0000000000ff8000
 origin description: ----dst_saddr@sctp_v6_get_dst
 local variable created at:
  sk_fullsock include/net/sock.h:2321 [inline]
  inet6_sk include/linux/ipv6.h:309 [inline]
  sctp_v6_get_dst+0x91/0x1630 net/sctp/ipv6.c:241
  sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
==================================================================

Signed-off-by: Alexander Potapenko <glider@google.com>
---
 net/sctp/ipv6.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 2a186b201ad2..a15d691829c6 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -513,6 +513,8 @@ static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
 	addr->sa.sa_family = AF_INET6;
 	addr->v6.sin6_port = port;
 	addr->v6.sin6_addr = *saddr;
+	addr->v6.sin6_flowinfo = 0;
+	addr->v6.sin6_scope_id = 0;
 }
 
 /* Compare addresses exactly.
-- 
2.13.2.932.g7449e964c-goog

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
  2017-07-18 14:55 [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr() Alexander Potapenko
@ 2017-07-18 15:02 ` Alexander Potapenko
  2017-07-19  0:58   ` Xin Long
  2017-08-08 18:47 ` Marcelo Ricardo Leitner
  1 sibling, 1 reply; 7+ messages in thread
From: Alexander Potapenko @ 2017-07-18 15:02 UTC (permalink / raw)
  To: Dmitriy Vyukov, Kostya Serebryany, Eric Dumazet, David Miller,
	Vladislav Yasevich
  Cc: LKML, linux-sctp

On Tue, Jul 18, 2017 at 4:55 PM, Alexander Potapenko <glider@google.com> wrote:
> KMSAN reported use of uninitialized sctp_addr->v4.sin_addr.s_addr and
> sctp_addr->v6.sin6_scope_id in sctp_v6_cmp_addr() (see below).
> Make sure all fields of an IPv6 address are initialized, which
> guarantees that the IPv4 fields are also initialized.
I'm assuming here that the IPv4 address is known to overlap with the
IPv6 one and doesn't need separate initialization.

> ==================================================================
>  BUG: KMSAN: use of uninitialized memory in sctp_v6_cmp_addr+0x8d4/0x9f0
>  net/sctp/ipv6.c:517
>  CPU: 2 PID: 31056 Comm: syz-executor1 Not tainted 4.11.0-rc5+ #2944
>  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
>  01/01/2011
>  Call Trace:
>   dump_stack+0x172/0x1c0 lib/dump_stack.c:42
>   is_logbuf_locked mm/kmsan/kmsan.c:59 [inline]
>   kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:938
>   native_save_fl arch/x86/include/asm/irqflags.h:18 [inline]
>   arch_local_save_flags arch/x86/include/asm/irqflags.h:72 [inline]
>   arch_local_irq_save arch/x86/include/asm/irqflags.h:113 [inline]
>   __msan_warning_32+0x61/0xb0 mm/kmsan/kmsan_instr.c:467
>   sctp_v6_cmp_addr+0x8d4/0x9f0 net/sctp/ipv6.c:517
>   sctp_v6_get_dst+0x8c7/0x1630 net/sctp/ipv6.c:290
>   sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
>   sctp_assoc_add_peer+0x66d/0x16f0 net/sctp/associola.c:651
>   sctp_sendmsg+0x35a5/0x4f90 net/sctp/socket.c:1871
>   inet_sendmsg+0x498/0x670 net/ipv4/af_inet.c:762
>   sock_sendmsg_nosec net/socket.c:633 [inline]
>   sock_sendmsg net/socket.c:643 [inline]
>   SYSC_sendto+0x608/0x710 net/socket.c:1696
>   SyS_sendto+0x8a/0xb0 net/socket.c:1664
>   entry_SYSCALL_64_fastpath+0x13/0x94
>  RIP: 0033:0x44b479
>  RSP: 002b:00007f6213f21c08 EFLAGS: 00000286 ORIG_RAX: 000000000000002c
>  RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 000000000044b479
>  RDX: 0000000000000041 RSI: 0000000020edd000 RDI: 0000000000000006
>  RBP: 00000000007080a8 R08: 0000000020b85fe4 R09: 000000000000001c
>  R10: 0000000000040005 R11: 0000000000000286 R12: 00000000ffffffff
>  R13: 0000000000003760 R14: 00000000006e5820 R15: 0000000000ff8000
>  origin description: ----dst_saddr@sctp_v6_get_dst
>  local variable created at:
>   sk_fullsock include/net/sock.h:2321 [inline]
>   inet6_sk include/linux/ipv6.h:309 [inline]
>   sctp_v6_get_dst+0x91/0x1630 net/sctp/ipv6.c:241
>   sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
> ==================================================================
>  BUG: KMSAN: use of uninitialized memory in sctp_v6_cmp_addr+0x8d4/0x9f0
>  net/sctp/ipv6.c:517
>  CPU: 2 PID: 31056 Comm: syz-executor1 Not tainted 4.11.0-rc5+ #2944
>  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
>  01/01/2011
>  Call Trace:
>   dump_stack+0x172/0x1c0 lib/dump_stack.c:42
>   is_logbuf_locked mm/kmsan/kmsan.c:59 [inline]
>   kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:938
>   native_save_fl arch/x86/include/asm/irqflags.h:18 [inline]
>   arch_local_save_flags arch/x86/include/asm/irqflags.h:72 [inline]
>   arch_local_irq_save arch/x86/include/asm/irqflags.h:113 [inline]
>   __msan_warning_32+0x61/0xb0 mm/kmsan/kmsan_instr.c:467
>   sctp_v6_cmp_addr+0x8d4/0x9f0 net/sctp/ipv6.c:517
>   sctp_v6_get_dst+0x8c7/0x1630 net/sctp/ipv6.c:290
>   sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
>   sctp_assoc_add_peer+0x66d/0x16f0 net/sctp/associola.c:651
>   sctp_sendmsg+0x35a5/0x4f90 net/sctp/socket.c:1871
>   inet_sendmsg+0x498/0x670 net/ipv4/af_inet.c:762
>   sock_sendmsg_nosec net/socket.c:633 [inline]
>   sock_sendmsg net/socket.c:643 [inline]
>   SYSC_sendto+0x608/0x710 net/socket.c:1696
>   SyS_sendto+0x8a/0xb0 net/socket.c:1664
>   entry_SYSCALL_64_fastpath+0x13/0x94
>  RIP: 0033:0x44b479
>  RSP: 002b:00007f6213f21c08 EFLAGS: 00000286 ORIG_RAX: 000000000000002c
>  RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 000000000044b479
>  RDX: 0000000000000041 RSI: 0000000020edd000 RDI: 0000000000000006
>  RBP: 00000000007080a8 R08: 0000000020b85fe4 R09: 000000000000001c
>  R10: 0000000000040005 R11: 0000000000000286 R12: 00000000ffffffff
>  R13: 0000000000003760 R14: 00000000006e5820 R15: 0000000000ff8000
>  origin description: ----dst_saddr@sctp_v6_get_dst
>  local variable created at:
>   sk_fullsock include/net/sock.h:2321 [inline]
>   inet6_sk include/linux/ipv6.h:309 [inline]
>   sctp_v6_get_dst+0x91/0x1630 net/sctp/ipv6.c:241
>   sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
> ==================================================================
>
> Signed-off-by: Alexander Potapenko <glider@google.com>
> ---
>  net/sctp/ipv6.c | 2 ++
I've also checked the that the corresponding IPv4 code doesn't need to
be fixed (nor does KMSAN report errors in it)
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index 2a186b201ad2..a15d691829c6 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -513,6 +513,8 @@ static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
>         addr->sa.sa_family = AF_INET6;
>         addr->v6.sin6_port = port;
>         addr->v6.sin6_addr = *saddr;
> +       addr->v6.sin6_flowinfo = 0;
> +       addr->v6.sin6_scope_id = 0;
>  }
>
>  /* Compare addresses exactly.
> --
> 2.13.2.932.g7449e964c-goog
>



-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
  2017-07-18 15:02 ` Alexander Potapenko
@ 2017-07-19  0:58   ` Xin Long
  2017-07-24 16:27     ` Alexander Potapenko
  0 siblings, 1 reply; 7+ messages in thread
From: Xin Long @ 2017-07-19  0:58 UTC (permalink / raw)
  To: Alexander Potapenko
  Cc: Dmitriy Vyukov, Kostya Serebryany, Eric Dumazet, David Miller,
	Vladislav Yasevich, LKML, linux-sctp

On Wed, Jul 19, 2017 at 3:02 AM, Alexander Potapenko <glider@google.com> wrote:
> On Tue, Jul 18, 2017 at 4:55 PM, Alexander Potapenko <glider@google.com> wrote:
>> KMSAN reported use of uninitialized sctp_addr->v4.sin_addr.s_addr and
>> sctp_addr->v6.sin6_scope_id in sctp_v6_cmp_addr() (see below).
>> Make sure all fields of an IPv6 address are initialized, which
>> guarantees that the IPv4 fields are also initialized.
> I'm assuming here that the IPv4 address is known to overlap with the
> IPv6 one and doesn't need separate initialization.
>
Ok, addr->v6.sin6_scope_id = 0 will fix the call trace you posted here.

addr->v6.sin6_flowinfo = 0 is to fix uninitialized
sctp_addr->v4.sin_addr.s_addr,
I couldn't see how this happens, can you also post the call trace for
v4.sin_addr.s_addr ?

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
  2017-07-19  0:58   ` Xin Long
@ 2017-07-24 16:27     ` Alexander Potapenko
  2017-07-25  2:34       ` Xin Long
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Potapenko @ 2017-07-24 16:27 UTC (permalink / raw)
  To: Xin Long
  Cc: Dmitriy Vyukov, Kostya Serebryany, Eric Dumazet, David Miller,
	Vladislav Yasevich, LKML, linux-sctp

On Wed, Jul 19, 2017 at 2:58 AM, Xin Long <lucien.xin@gmail.com> wrote:
> On Wed, Jul 19, 2017 at 3:02 AM, Alexander Potapenko <glider@google.com> wrote:
>> On Tue, Jul 18, 2017 at 4:55 PM, Alexander Potapenko <glider@google.com> wrote:
>>> KMSAN reported use of uninitialized sctp_addr->v4.sin_addr.s_addr and
>>> sctp_addr->v6.sin6_scope_id in sctp_v6_cmp_addr() (see below).
>>> Make sure all fields of an IPv6 address are initialized, which
>>> guarantees that the IPv4 fields are also initialized.
>> I'm assuming here that the IPv4 address is known to overlap with the
>> IPv6 one and doesn't need separate initialization.
>>
>
> Ok, addr->v6.sin6_scope_id = 0 will fix the call trace you posted here.
Sorry for the delay, I somehow missed your question.
> addr->v6.sin6_flowinfo = 0 is to fix uninitialized
> sctp_addr->v4.sin_addr.s_addr,
> I couldn't see how this happens, can you also post the call trace for
> v4.sin_addr.s_addr ?
Here it is:

==================================================================
BUG: KMSAN: use of uninitialized memory in
sctp_v6_cmp_addr+0x8d4/0x9f0 net/sctp/ipv6.c:535
CPU: 2 PID: 17306 Comm: syz-executor1 Not tainted 4.11.0-rc5+ #2944
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
 dump_stack+0x172/0x1c0 lib/dump_stack.c:42
 is_logbuf_locked mm/kmsan/kmsan.c:59 [inline]
 kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:938
 native_save_fl arch/x86/include/asm/irqflags.h:18 [inline]
 arch_local_save_flags arch/x86/include/asm/irqflags.h:72 [inline]
 arch_local_irq_save arch/x86/include/asm/irqflags.h:113 [inline]
 __msan_warning_32+0x61/0xb0 mm/kmsan/kmsan_instr.c:467
 sctp_v6_cmp_addr+0x8d4/0x9f0 net/sctp/ipv6.c:535
 sctp_v6_get_dst+0x8c7/0x1630 net/sctp/ipv6.c:297
 sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
 sctp_assoc_add_peer+0x66d/0x16f0 net/sctp/associola.c:651
 sctp_sendmsg+0x35a5/0x4f90 net/sctp/socket.c:1871
 inet_sendmsg+0x498/0x670 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:633 [inline]
 sock_sendmsg net/socket.c:643 [inline]
 SYSC_sendto+0x608/0x710 net/socket.c:1696
 SyS_sendto+0x8a/0xb0 net/socket.c:1664
 entry_SYSCALL_64_fastpath+0x13/0x94
RIP: 0033:0x44b479
RSP: 002b:00007f28a5bb2c08 EFLAGS: 00000286 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 000000000044b479
RDX: 0000000000000001 RSI: 0000000020036000 RDI: 0000000000000005
RBP: 0000000000708000 R08: 00000000206e4000 R09: 000000000000001c
R10: 0000000000000000 R11: 0000000000000286 R12: 00000000ffffffff
R13: 0000000000003760 R14: 00000000006e5820 R15: 0000000000ff9000
origin description: ----dst_saddr@sctp_v6_get_dst
local variable created at:
 sctp_v6_get_dst+0x91/0x1630 net/sctp/ipv6.c:236
 sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
==================================================================


> Thanks



-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
  2017-07-24 16:27     ` Alexander Potapenko
@ 2017-07-25  2:34       ` Xin Long
  0 siblings, 0 replies; 7+ messages in thread
From: Xin Long @ 2017-07-25  2:34 UTC (permalink / raw)
  To: Alexander Potapenko
  Cc: Dmitriy Vyukov, Kostya Serebryany, Eric Dumazet, David Miller,
	Vladislav Yasevich, LKML, linux-sctp

On Tue, Jul 25, 2017 at 4:27 AM, Alexander Potapenko <glider@google.com> wrote:
> On Wed, Jul 19, 2017 at 2:58 AM, Xin Long <lucien.xin@gmail.com> wrote:
>> On Wed, Jul 19, 2017 at 3:02 AM, Alexander Potapenko <glider@google.com> wrote:
>>> On Tue, Jul 18, 2017 at 4:55 PM, Alexander Potapenko <glider@google.com> wrote:
>>>> KMSAN reported use of uninitialized sctp_addr->v4.sin_addr.s_addr and
>>>> sctp_addr->v6.sin6_scope_id in sctp_v6_cmp_addr() (see below).
>>>> Make sure all fields of an IPv6 address are initialized, which
>>>> guarantees that the IPv4 fields are also initialized.
>>> I'm assuming here that the IPv4 address is known to overlap with the
>>> IPv6 one and doesn't need separate initialization.
>>>
>>
>> Ok, addr->v6.sin6_scope_id = 0 will fix the call trace you posted here.
> Sorry for the delay, I somehow missed your question.
>> addr->v6.sin6_flowinfo = 0 is to fix uninitialized
>> sctp_addr->v4.sin_addr.s_addr,
>> I couldn't see how this happens, can you also post the call trace for
>> v4.sin_addr.s_addr ?
> Here it is:
This one is still sctp_addr->v6.sin6_scope_id stuff.
'addr->v6.sin6_flowinfo = 0' is not actually necessay here, since
the two addr's family both are AF_INET6 and sctp_v6_cmp_addr()
doesn't use it in this path.

But  it's fine, It may be good to initialize all members here.

Reviewed-by: Xin Long <lucien.xin@gmail.com>

>
> ==================================================================
> BUG: KMSAN: use of uninitialized memory in
> sctp_v6_cmp_addr+0x8d4/0x9f0 net/sctp/ipv6.c:535
> CPU: 2 PID: 17306 Comm: syz-executor1 Not tainted 4.11.0-rc5+ #2944
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> Call Trace:
>  dump_stack+0x172/0x1c0 lib/dump_stack.c:42
>  is_logbuf_locked mm/kmsan/kmsan.c:59 [inline]
>  kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:938
>  native_save_fl arch/x86/include/asm/irqflags.h:18 [inline]
>  arch_local_save_flags arch/x86/include/asm/irqflags.h:72 [inline]
>  arch_local_irq_save arch/x86/include/asm/irqflags.h:113 [inline]
>  __msan_warning_32+0x61/0xb0 mm/kmsan/kmsan_instr.c:467
>  sctp_v6_cmp_addr+0x8d4/0x9f0 net/sctp/ipv6.c:535
>  sctp_v6_get_dst+0x8c7/0x1630 net/sctp/ipv6.c:297
>  sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
>  sctp_assoc_add_peer+0x66d/0x16f0 net/sctp/associola.c:651
>  sctp_sendmsg+0x35a5/0x4f90 net/sctp/socket.c:1871
>  inet_sendmsg+0x498/0x670 net/ipv4/af_inet.c:762
>  sock_sendmsg_nosec net/socket.c:633 [inline]
>  sock_sendmsg net/socket.c:643 [inline]
>  SYSC_sendto+0x608/0x710 net/socket.c:1696
>  SyS_sendto+0x8a/0xb0 net/socket.c:1664
>  entry_SYSCALL_64_fastpath+0x13/0x94
> RIP: 0033:0x44b479
> RSP: 002b:00007f28a5bb2c08 EFLAGS: 00000286 ORIG_RAX: 000000000000002c
> RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 000000000044b479
> RDX: 0000000000000001 RSI: 0000000020036000 RDI: 0000000000000005
> RBP: 0000000000708000 R08: 00000000206e4000 R09: 000000000000001c
> R10: 0000000000000000 R11: 0000000000000286 R12: 00000000ffffffff
> R13: 0000000000003760 R14: 00000000006e5820 R15: 0000000000ff9000
> origin description: ----dst_saddr@sctp_v6_get_dst
> local variable created at:
>  sctp_v6_get_dst+0x91/0x1630 net/sctp/ipv6.c:236
>  sctp_transport_route+0x101/0x570 net/sctp/transport.c:292
> ==================================================================
>
>
>> Thanks
>
>
>
> --
> Alexander Potapenko
> Software Engineer
>
> Google Germany GmbH
> Erika-Mann-Straße, 33
> 80636 München
>
> Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
  2017-07-18 14:55 [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr() Alexander Potapenko
  2017-07-18 15:02 ` Alexander Potapenko
@ 2017-08-08 18:47 ` Marcelo Ricardo Leitner
  2017-08-14 18:43   ` Alexander Potapenko
  1 sibling, 1 reply; 7+ messages in thread
From: Marcelo Ricardo Leitner @ 2017-08-08 18:47 UTC (permalink / raw)
  To: Alexander Potapenko
  Cc: dvyukov, kcc, edumazet, davem, vyasevich, linux-kernel, linux-sctp

On Tue, Jul 18, 2017 at 04:55:57PM +0200, Alexander Potapenko wrote:
> KMSAN reported use of uninitialized sctp_addr->v4.sin_addr.s_addr and
> sctp_addr->v6.sin6_scope_id in sctp_v6_cmp_addr() (see below).
> Make sure all fields of an IPv6 address are initialized, which
> guarantees that the IPv4 fields are also initialized.

Hi Alexander,

You missed to email netdev@ and thus Dave is unable to see this patch in
patchwork. Please resend it, including netdev@.

Thanks,
Marcelo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
  2017-08-08 18:47 ` Marcelo Ricardo Leitner
@ 2017-08-14 18:43   ` Alexander Potapenko
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Potapenko @ 2017-08-14 18:43 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner
  Cc: Dmitriy Vyukov, Kostya Serebryany, Eric Dumazet, David Miller,
	Vladislav Yasevich, LKML, linux-sctp

On Tue, Aug 8, 2017 at 8:47 PM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
> On Tue, Jul 18, 2017 at 04:55:57PM +0200, Alexander Potapenko wrote:
>> KMSAN reported use of uninitialized sctp_addr->v4.sin_addr.s_addr and
>> sctp_addr->v6.sin6_scope_id in sctp_v6_cmp_addr() (see below).
>> Make sure all fields of an IPv6 address are initialized, which
>> guarantees that the IPv4 fields are also initialized.
>
> Hi Alexander,
>
> You missed to email netdev@ and thus Dave is unable to see this patch in
> patchwork. Please resend it, including netdev@.
>
> Thanks,
> Marcelo
Sorry, I've missed your reply.
Resent including netdev@.


-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-14 18:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-18 14:55 [PATCH] sctp: fully initialize the IPv6 address in sctp_v6_to_addr() Alexander Potapenko
2017-07-18 15:02 ` Alexander Potapenko
2017-07-19  0:58   ` Xin Long
2017-07-24 16:27     ` Alexander Potapenko
2017-07-25  2:34       ` Xin Long
2017-08-08 18:47 ` Marcelo Ricardo Leitner
2017-08-14 18:43   ` Alexander Potapenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).