lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171221131333.GO6122@localhost.localdomain>
Date:   Thu, 21 Dec 2017 11:13:33 -0200
From:   Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To:     syzbot 
        <bot+5a73b85ba48546cea8ed105946d67a37b4495724@...kaller.appspotmail.com>
Cc:     davem@...emloft.net, linux-kernel@...r.kernel.org,
        linux-sctp@...r.kernel.org, netdev@...r.kernel.org,
        nhorman@...driver.com, syzkaller-bugs@...glegroups.com,
        vyasevich@...il.com
Subject: Re: BUG: unable to handle kernel NULL pointer dereference in
 sctp_stream_free

On Wed, Dec 20, 2017 at 12:51:01PM -0800, syzbot wrote:

from the log:
[   89.451366] FAULT_INJECTION: forcing a failure.^M
[   89.451366] name failslab, interval 1, probability 0, space 0,
times 0^M
[   89.451374] CPU: 0 PID: 17287 Comm: syz-executor2 Not tainted
+4.15.0-rc3-next-20171214+ #67^M
[   89.451377] Hardware name: Google Google Compute Engine/Google
Compute Engine, BIOS
+Google 01/01/2011^M
[   89.451380] Call Trace:^M
[   89.451395]  dump_stack+0xe9/0x14b^M
[   89.451408]  should_fail+0x1e5/0x220^M
[   89.451419]  should_failslab+0x73/0x90^M
[   89.451428]  __kmalloc+0x63/0x730^M
[   89.451439]  ? rcu_read_lock_sched_held+0x74/0x80^M
[   89.451446]  ? __kmalloc+0x4ac/0x730^M
[   89.451452]  ? sctp_stream_alloc_in+0x2f/0x100^M
[   89.451464]  sctp_stream_alloc_in+0x2f/0x100^M
[   89.451473]  sctp_stream_init+0xfa/0x140^M
[   89.451485]  sctp_process_init+0x676/0xc50^M

this is what caused the panic later, because in the error path we free
out but don't zero outcnt. This patch should fix it. Can you please
try it? Thanks

----8<---

diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index 06b644dd858c..50ab09029f00 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -184,6 +184,7 @@ int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,
 	sched->free(stream);
 	kfree(stream->out);
 	stream->out = NULL;
+	stream->outcnt = 0;
 out:
 	return ret;
 }

Download attachment "raw.log" of type "application/octet-stream" (1048576 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ