From: Sasha Levin <sashal@kernel.org>
To: Dmitry Kasatkin <dmitry.kasatkin@huawei.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
yuehaibing <yuehaibing@huawei.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"keescook@chromium.org" <keescook@chromium.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"gregkh@google.com" <gregkh@google.com>
Subject: Re: [PATCH -next] exec: Fix mem leak in kernel_read_file
Date: Mon, 11 Mar 2019 19:16:27 -0400 [thread overview]
Message-ID: <20190311231627.GI158926@sasha-vm> (raw)
In-Reply-To: <ad928cfca24743d5bb9f01e9a3ae74bd@huawei.com>
On Mon, Mar 11, 2019 at 04:59:14PM +0000, Dmitry Kasatkin wrote:
>
>From: Al Viro <viro@ftp.linux.org.uk> on behalf of Al Viro <viro@zeniv.linux.org.uk>
>Sent: Tuesday, February 19, 2019 4:25 AM
>To: yuehaibing
>Cc: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org; Dmitry Kasatkin; keescook@chromium.org
>Subject: Re: [PATCH -next] exec: Fix mem leak in kernel_read_file
>
>On Tue, Feb 19, 2019 at 10:10:38AM +0800, YueHaibing wrote:
>> syzkaller report this:
>> BUG: memory leak
>> unreferenced object 0xffffc9000488d000 (size 9195520):
>> comm "syz-executor.0", pid 2752, jiffies 4294787496 (age 18.757s)
>> hex dump (first 32 bytes):
>> ff ff ff ff ff ff ff ff a8 00 00 00 01 00 00 00 ................
>> 02 00 00 00 00 00 00 00 80 a1 7a c1 ff ff ff ff ..........z.....
>> backtrace:
>> [<000000000863775c>] __vmalloc_node mm/vmalloc.c:1795 [inline]
>> [<000000000863775c>] __vmalloc_node_flags mm/vmalloc.c:1809 [inline]
>> [<000000000863775c>] vmalloc+0x8c/0xb0 mm/vmalloc.c:1831
>> [<000000003f668111>] kernel_read_file+0x58f/0x7d0 fs/exec.c:924
>> [<000000002385813f>] kernel_read_file_from_fd+0x49/0x80 fs/exec.c:993
>> [<0000000011953ff1>] __do_sys_finit_module+0x13b/0x2a0 kernel/module.c:3895
>> [<000000006f58491f>] do_syscall_64+0x147/0x600 arch/x86/entry/common.c:290
>> [<00000000ee78baf4>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
>> [<00000000241f889b>] 0xffffffffffffffff
>>
>> It should goto 'out_free' lable to free allocated buf while kernel_read
>> fails.
>
>Applied.
>
>
>This must be applied to stables as well...
It's already in all relevant stable trees...
--
Thanks,
Sasha
next prev parent reply other threads:[~2019-03-11 23:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 2:10 [PATCH -next] exec: Fix mem leak in kernel_read_file YueHaibing
2019-02-19 2:25 ` Al Viro
2019-03-11 16:59 ` Dmitry Kasatkin
2019-03-11 23:16 ` Sasha Levin [this message]
2019-03-13 14:12 ` Dmitry Kasatkin
2019-03-13 14:38 ` gregkh
2019-03-13 15:00 ` Dmitry Kasatkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190311231627.GI158926@sasha-vm \
--to=sashal@kernel.org \
--cc=dmitry.kasatkin@huawei.com \
--cc=gregkh@google.com \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.