syzbot


KASAN: stack-out-of-bounds Read in __aa_lookupn_ns

Status: fixed on 2018/11/12 21:25
Subsystems: apparmor
[Documentation on labels]
Reported-by: syzbot+61e4b490d9d2da591b50@syzkaller.appspotmail.com
Fix commit: 250f2da49cb8 apparmor: Fix uninitialized value in aa_split_fqname
First crash: 2251d, last: 2218d
Duplicate bugs (3)
duplicates (3):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
KASAN: slab-out-of-bounds Read in __aa_lookupn_ns apparmor 2 2212d 2245d 0/28 closed as dup on 2018/10/01 06:54
KASAN: global-out-of-bounds Read in __aa_lookupn_ns apparmor 26 2223d 2250d 0/28 closed as dup on 2018/09/28 15:01
general protection fault in __aa_lookupn_ns apparmor C 117 2212d 2250d 0/28 closed as dup on 2018/09/28 15:02
Discussions (7)
Title Replies (including bot) Last reply
[PATCH 4.14 00/62] 4.14.84-stable review 80 (80) 2018/11/29 08:08
[PATCH 4.19 000/118] 4.19.5-stable review 129 (129) 2018/11/27 14:38
[PATCH AUTOSEL 4.18 01/39] bfs: add sanity check at bfs_fill_super() 41 (41) 2018/11/22 19:35
[PATCH AUTOSEL 4.14 01/26] bfs: add sanity check at bfs_fill_super() 26 (26) 2018/11/13 05:51
[PATCH AUTOSEL 4.19 01/44] bfs: add sanity check at bfs_fill_super() 44 (44) 2018/11/13 05:49
[PATCH] apparmor: Fix uninitialized value in aa_split_fqname 2 (2) 2018/10/01 20:25
KASAN: stack-out-of-bounds Read in __aa_lookupn_ns 0 (1) 2018/09/26 07:52

Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in memcmp+0xe3/0x160 lib/string.c:861
Read of size 1 at addr ffff8801b9dd7400 by task syz-executor995/5869

CPU: 1 PID: 5869 Comm: syz-executor995 Not tainted 4.19.0-rc7+ #282
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113
 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
 memcmp+0xe3/0x160 lib/string.c:861
 strnstr+0x4b/0x70 lib/string.c:934
 __aa_lookupn_ns+0xc1/0x570 security/apparmor/policy_ns.c:209
 aa_lookupn_ns+0x88/0x1e0 security/apparmor/policy_ns.c:240
 aa_fqlookupn_profile+0x1b9/0x1010 security/apparmor/policy.c:468
 fqlookupn_profile+0x80/0xc0 security/apparmor/label.c:1844
 aa_label_strn_parse+0xa3a/0x1230 security/apparmor/label.c:1908
 aa_label_parse+0x42/0x50 security/apparmor/label.c:1943
 aa_change_profile+0x513/0x3260 security/apparmor/domain.c:1362
 apparmor_setprocattr+0xaa4/0x1150 security/apparmor/lsm.c:658
 security_setprocattr+0x66/0xc0 security/security.c:1298
 proc_pid_attr_write+0x301/0x540 fs/proc/base.c:2569
 __vfs_write+0x119/0x9f0 fs/read_write.c:485
 vfs_write+0x1fc/0x560 fs/read_write.c:549
 ksys_write+0x101/0x260 fs/read_write.c:598
 __do_sys_write fs/read_write.c:610 [inline]
 __se_sys_write fs/read_write.c:607 [inline]
 __x64_sys_write+0x73/0xb0 fs/read_write.c:607
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440d49
Code: e8 cc ab 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 bb 0a fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffed47550f8 EFLAGS: 00000213 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000440d49
RDX: 0000000000000009 RSI: 0000000020000280 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000002034880 R11: 0000000000000213 R12: 000000000000c507
R13: 0000000000401d20 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea0006e775c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 ffffffff06e70101 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801b9dd7300: f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801b9dd7380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1
>ffff8801b9dd7400: f1 f1 f1 f8 f2 f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2
                   ^
 ffff8801b9dd7480: f2 f2 f2 f8 f2 f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2
 ffff8801b9dd7500: f2 f2 f2 00 00 00 00 00 00 00 00 f3 f3 f3 f3 00
==================================================================

Crashes (52):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/10/13 21:28 upstream 7ec21823634d caf12900 .config console log report syz C ci-upstream-kasan-gce-root
2018/10/05 07:33 upstream befad944e231 8b311eaf .config console log report syz C ci-upstream-kasan-gce-root
2018/09/30 18:24 upstream 291d0e5d81e1 41e4b329 .config console log report syz C ci-upstream-kasan-gce
2018/09/30 18:21 upstream 291d0e5d81e1 41e4b329 .config console log report syz C ci-upstream-kasan-gce-root
2018/09/28 02:51 upstream c127e59bee3e 0c2fa87b .config console log report syz C ci-upstream-kasan-gce
2018/09/28 02:49 upstream c127e59bee3e 0c2fa87b .config console log report syz C ci-upstream-kasan-gce-root
2018/09/26 10:46 upstream a38523185b40 455b6354 .config console log report syz C ci-upstream-kasan-gce-root
2018/09/26 07:27 upstream 846e8dd47c26 b7e11289 .config console log report syz C ci-upstream-kasan-gce
2018/09/25 06:33 upstream 02214bfc89c7 0e7547d7 .config console log report syz C ci-upstream-kasan-gce
2018/09/25 06:26 upstream 02214bfc89c7 0e7547d7 .config console log report syz C ci-upstream-kasan-gce-root
2018/09/25 06:03 upstream 02214bfc89c7 0e7547d7 .config console log report syz C ci-upstream-kasan-gce
2018/09/25 05:59 upstream 02214bfc89c7 0e7547d7 .config console log report syz C ci-upstream-kasan-gce-root
2018/09/24 22:18 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce-root
2018/09/24 21:47 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce
2018/09/24 20:14 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce-root
2018/09/24 20:01 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce
2018/09/24 19:58 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce-root
2018/09/24 18:40 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce
2018/10/12 18:18 upstream 6b3944e42e2e caf12900 .config console log report syz C ci-upstream-kasan-gce-386
2018/09/30 18:06 upstream 291d0e5d81e1 41e4b329 .config console log report syz C ci-upstream-kasan-gce-386
2018/09/28 02:51 upstream c127e59bee3e 0c2fa87b .config console log report syz C ci-upstream-kasan-gce-386
2018/09/26 07:29 upstream 846e8dd47c26 b7e11289 .config console log report syz C ci-upstream-kasan-gce-386
2018/09/25 06:29 upstream 02214bfc89c7 0e7547d7 .config console log report syz C ci-upstream-kasan-gce-386
2018/09/25 06:01 upstream 02214bfc89c7 0e7547d7 .config console log report syz C ci-upstream-kasan-gce-386
2018/09/24 20:18 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce-386
2018/09/24 19:42 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce-386
2018/09/24 19:25 upstream 02214bfc89c7 2f485cdf .config console log report syz C ci-upstream-kasan-gce-386
2018/09/26 07:12 linux-next 8b7a6ebdd4a5 b7e11289 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/09/25 08:13 linux-next 8b7a6ebdd4a5 0e7547d7 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/09/24 17:57 linux-next dad486875956 2f485cdf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/27 19:00 upstream 345671ea0f92 8efba39a .config console log report ci-upstream-kasan-gce
2018/10/25 20:23 upstream bd6bf7c10484 a8292de9 .config console log report ci-upstream-kasan-gce
2018/10/11 18:39 upstream 9dcd936c5312 ba6ddb43 .config console log report ci-upstream-kasan-gce
2018/10/11 16:28 upstream 9dcd936c5312 5f818b4b .config console log report ci-upstream-kasan-gce-root
2018/10/07 15:58 upstream fb1c592cf4c9 8b311eaf .config console log report ci-upstream-kasan-gce-root
2018/10/05 17:41 upstream befad944e231 8b311eaf .config console log report ci-upstream-kasan-gce-root
2018/10/05 13:32 upstream befad944e231 8b311eaf .config console log report ci-upstream-kasan-gce
2018/09/30 19:43 upstream 17b57b1883c1 41e4b329 .config console log report ci-upstream-kasan-gce
2018/09/30 18:40 upstream 291d0e5d81e1 41e4b329 .config console log report ci-upstream-kasan-gce
2018/09/30 16:36 upstream 291d0e5d81e1 41e4b329 .config console log report ci-upstream-kasan-gce
2018/09/30 16:30 upstream 291d0e5d81e1 41e4b329 .config console log report ci-upstream-kasan-gce
2018/09/28 11:30 upstream ad0371482b1e 8bb1f0fc .config console log report ci-upstream-kasan-gce
2018/09/28 09:11 upstream c127e59bee3e 0c2fa87b .config console log report ci-upstream-kasan-gce
2018/09/28 06:23 upstream c127e59bee3e 0c2fa87b .config console log report ci-upstream-kasan-gce
2018/09/28 00:38 upstream c127e59bee3e 0c2fa87b .config console log report ci-upstream-kasan-gce
2018/09/30 20:16 upstream 17b57b1883c1 41e4b329 .config console log report ci-upstream-kasan-gce-386
2018/09/30 10:49 upstream 291d0e5d81e1 41e4b329 .config console log report ci-upstream-kasan-gce-386
2018/10/01 18:10 linux-next 4794a36bf08d 48a50c6b .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/30 16:39 linux-next 4794a36bf08d 41e4b329 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/30 10:48 linux-next 4794a36bf08d 41e4b329 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/28 06:35 linux-next 4794a36bf08d 0c2fa87b .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/28 03:50 linux-next 9e27e2c2d003 0c2fa87b .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.