syzbot


memory leak in policydb_read

Status: fixed on 2019/08/14 02:14
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+fee3a14d4cdf92646287@syzkaller.appspotmail.com
Fix commit: 45385237f65a selinux: fix memory leak in policydb_init()
First crash: 1733d, last: 1733d
Cause bisection: introduced by (bisect log) :
commit d9570ee3bd1d4f20ce63485f5ef05663866fe6c0
Author: Dmitry Vyukov <dvyukov@google.com>
Date: Sat Jan 13 00:53:10 2018 +0000

  kmemleak: allow to coexist with fault injection

Crash: memory leak in policydb_read (log)
Repro: C syz .config
  
Discussions (7)
Title Replies (including bot) Last reply
[PATCH 3.16 00/83] 3.16.78-rc1 review 88 (88) 2019/11/21 21:42
[PATCH 4.14 00/53] 4.14.137-stable review 62 (62) 2019/08/26 21:23
[PATCH 4.19 00/74] 4.19.65-stable review 88 (88) 2019/08/13 00:04
[PATCH 5.2 000/131] 5.2.7-stable review 145 (145) 2019/08/07 05:44
[PATCH 4.9 00/42] 4.9.188-stable review 48 (48) 2019/08/06 18:29
[PATCH 4.4 00/22] 4.4.188-stable review 28 (28) 2019/08/06 18:28
memory leak in policydb_read 1 (2) 2019/07/23 09:41
Last patch testing requests (1)
Created Duration User Patch Repo Result
2019/07/25 07:31 15m omosnace@redhat.com https://gitlab.com/omos/linux-public.git selinux-fix-memleak-roles report log

Sample crash report:
BUG: memory leak
unreferenced object 0xffff888123547c80 (size 64):
  comm "syz-executor647", pid 6976, jiffies 4294940919 (age 7.920s)
  hex dump (first 32 bytes):
    01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000019b1b22a>] kmemleak_alloc_recursive /./include/linux/kmemleak.h:43 [inline]
    [<0000000019b1b22a>] slab_post_alloc_hook /mm/slab.h:522 [inline]
    [<0000000019b1b22a>] slab_alloc /mm/slab.c:3319 [inline]
    [<0000000019b1b22a>] kmem_cache_alloc_trace+0x145/0x280 /mm/slab.c:3548
    [<00000000d64c33c7>] kmalloc /./include/linux/slab.h:552 [inline]
    [<00000000d64c33c7>] kzalloc /./include/linux/slab.h:748 [inline]
    [<00000000d64c33c7>] roles_init /security/selinux/ss/policydb.c:188 [inline]
    [<00000000d64c33c7>] policydb_init /security/selinux/ss/policydb.c:294 [inline]
    [<00000000d64c33c7>] policydb_read+0x141/0x1b80 /security/selinux/ss/policydb.c:2259
    [<000000004dd18ef6>] security_load_policy+0x182/0x740 /security/selinux/ss/services.c:2141
    [<000000004f5bb277>] sel_write_load+0x101/0x1f0 /security/selinux/selinuxfs.c:564
    [<00000000ee05c840>] __vfs_write+0x43/0xa0 /fs/read_write.c:494
    [<000000008ca23315>] vfs_write /fs/read_write.c:558 [inline]
    [<000000008ca23315>] vfs_write+0xee/0x210 /fs/read_write.c:542
    [<00000000d97bcbc9>] ksys_write+0x7c/0x130 /fs/read_write.c:611
    [<000000007a3f006b>] __do_sys_write /fs/read_write.c:623 [inline]
    [<000000007a3f006b>] __se_sys_write /fs/read_write.c:620 [inline]
    [<000000007a3f006b>] __x64_sys_write+0x1e/0x30 /fs/read_write.c:620
    [<000000001c16ef20>] do_syscall_64+0x76/0x1a0 /arch/x86/entry/common.c:296
    [<000000007784189d>] entry_SYSCALL_64_after_hwframe+0x44/0xa9


Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/07/21 11:58 upstream c6dd78fcb8ee 1656845f .config console log report syz C ci-upstream-gce-leak
* Struck through repros no longer work on HEAD.