diff options
author | Bharath Vedartham <linux.bhar@gmail.com> | 2019-05-23 01:15:19 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-07 18:57:29 +0200 |
commit | 5b0446c8e0a85b97148c070f73e273bc3903af5c (patch) | |
tree | acc483521a7fc6d9114e515ef5efbd84a94c4dd4 /arch/sh/kernel/kgdb.c | |
parent | d85bc11a6894170292773b9d2f9ec56511d35dc4 (diff) | |
download | linux-stable-5b0446c8e0a85b97148c070f73e273bc3903af5c.tar.gz linux-stable-5b0446c8e0a85b97148c070f73e273bc3903af5c.tar.bz2 linux-stable-5b0446c8e0a85b97148c070f73e273bc3903af5c.zip |
9p/cache.c: Fix memory leak in v9fs_cache_session_get_cookie
commit 962a991c5de18452d6c429d99f3039387cf5cbb0 upstream.
v9fs_cache_session_get_cookie assigns a random cachetag to v9ses->cachetag,
if the cachetag is not assigned previously.
v9fs_random_cachetag allocates memory to v9ses->cachetag with kmalloc and uses
scnprintf to fill it up with a cachetag.
But if scnprintf fails, v9ses->cachetag is not freed in the current
code causing a memory leak.
Fix this by freeing v9ses->cachetag it v9fs_random_cachetag fails.
This was reported by syzbot, the link to the report is below:
https://syzkaller.appspot.com/bug?id=f012bdf297a7a4c860c38a88b44fbee43fd9bbf3
Link: http://lkml.kernel.org/r/20190522194519.GA5313@bharath12345-Inspiron-5559
Reported-by: syzbot+3a030a73b6c1e9833815@syzkaller.appspotmail.com
Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/sh/kernel/kgdb.c')
0 files changed, 0 insertions, 0 deletions