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-next>] [day] [month] [year] [list]
Date:   Tue, 18 Apr 2017 16:54:50 +0200
From:   Andrey Konovalov <andreyknvl@...gle.com>
To:     "David S. Miller" <davem@...emloft.net>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        James Morris <jmorris@...ei.org>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        Patrick McHardy <kaber@...sh.net>,
        netdev <netdev@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Eric Dumazet <edumazet@...gle.com>
Cc:     Dmitry Vyukov <dvyukov@...gle.com>,
        Kostya Serebryany <kcc@...gle.com>,
        syzkaller <syzkaller@...glegroups.com>
Subject: net/ipv6: slab-out-of-bounds read in seg6_validate_srh

Hi,

I've got the following error report while fuzzing the kernel with syzkaller.

On commit 4f7d029b9bf009fbee76bb10c0c4351a1870d2f3 (4.11-rc7).

A reproducer and .config are attached.

==================================================================
BUG: KASAN: slab-out-of-bounds in seg6_validate_srh+0x203/0x220
net/ipv6/seg6.c:57 at addr ffff88006a759608
Read of size 1 by task syz-executor4/2627
CPU: 2 PID: 2627 Comm: syz-executor4 Not tainted 4.11.0-rc7+ #247
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x292/0x398 lib/dump_stack.c:52
sctp: [Deprecated]: syz-executor5 (pid 2636) Use of int in maxseg socket option.
Use struct sctp_assoc_value instead
 kasan_object_err+0x1c/0x70 mm/kasan/report.c:164
 print_address_description mm/kasan/report.c:202 [inline]
 kasan_report_error mm/kasan/report.c:291 [inline]
 kasan_report+0x252/0x510 mm/kasan/report.c:347
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:365
 seg6_validate_srh+0x203/0x220 net/ipv6/seg6.c:57
 do_ipv6_setsockopt.isra.7+0x2008/0x3bc0 net/ipv6/ipv6_sockglue.c:439
 ipv6_setsockopt+0x9b/0x140 net/ipv6/ipv6_sockglue.c:919
 udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1349
 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2750
 SYSC_setsockopt net/socket.c:1798 [inline]
 SyS_setsockopt+0x270/0x3a0 net/socket.c:1777
 entry_SYSCALL_64_fastpath+0x1f/0xc2
RIP: 0033:0x4458d9
RSP: 002b:00007f6b9696ab58 EFLAGS: 00000292 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000018 RCX: 00000000004458d9
RDX: 0000000000000039 RSI: 0000000000000029 RDI: 0000000000000018
RBP: 00000000006e34e0 R08: 00000000000000a8 R09: 0000000000000000
R10: 000000002000efe7 R11: 0000000000000292 R12: 0000000000708000
R13: 0000000000000006 R14: 0000000000000001 R15: 000000000000001a
Object at ffff88006a759520, in cache kmalloc-256 size: 256
Allocated:
PID = 2627
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x43/0xd0 mm/kasan/kasan.c:513
 set_track mm/kasan/kasan.c:525 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:616
 __kmalloc+0xa0/0x2d0 mm/slub.c:3745
 kmalloc include/linux/slab.h:495 [inline]
 sock_kmalloc+0x11e/0x1b0 net/core/sock.c:1804
 ipv6_renew_options+0x2b5/0xb50 net/ipv6/exthdrs.c:1053
 do_ipv6_setsockopt.isra.7+0x1f5c/0x3bc0 net/ipv6/ipv6_sockglue.c:413
 ipv6_setsockopt+0x9b/0x140 net/ipv6/ipv6_sockglue.c:919
 udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1349
 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2750
 SYSC_setsockopt net/socket.c:1798 [inline]
 SyS_setsockopt+0x270/0x3a0 net/socket.c:1777
 entry_SYSCALL_64_fastpath+0x1f/0xc2
Freed:
PID = 2241
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x43/0xd0 mm/kasan/kasan.c:513
 set_track mm/kasan/kasan.c:525 [inline]
 kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:589
 slab_free_hook mm/slub.c:1357 [inline]
 slab_free_freelist_hook mm/slub.c:1379 [inline]
 slab_free mm/slub.c:2961 [inline]
 kfree+0xe8/0x2b0 mm/slub.c:3882
 seq_release fs/seq_file.c:379 [inline]
 single_release+0x80/0xb0 fs/seq_file.c:615
 __fput+0x332/0x7f0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:245
 task_work_run+0x19b/0x270 kernel/task_work.c:116
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1c2/0x200 arch/x86/entry/common.c:161
 prepare_exit_to_usermode arch/x86/entry/common.c:191 [inline]
 syscall_return_slowpath+0x3d3/0x420 arch/x86/entry/common.c:260
 entry_SYSCALL_64_fastpath+0xc0/0xc2
Memory state around the buggy address:
 ffff88006a759500: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88006a759580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88006a759600: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                      ^
 ffff88006a759680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88006a759700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc 00
==================================================================

Download attachment ".config" of type "application/octet-stream" (127218 bytes)

View attachment "seg6_validate_srh-oob-read-poc.c" of type "text/x-csrc" (7059 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ