From: Colin Ian King <colin.king@canonical.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Casey Schaufler <casey@schaufler-ca.com>,
James Morris <jmorris@namei.org>,
"Serge E . Hallyn" <serge@hallyn.com>,
linux-security-module@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] smack: fix two memory leaks in smack_add_opt
Date: Sat, 22 Dec 2018 23:03:00 +0000 [thread overview]
Message-ID: <1d16d3a1-6466-fb16-460f-61cc59659ded@canonical.com> (raw)
In-Reply-To: <20181222193432.GC2217@ZenIV.linux.org.uk>
On 22/12/2018 19:34, Al Viro wrote:
> On Sat, Dec 22, 2018 at 12:27:50PM +0000, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently if s is null or when returning via the error exit label
>> out_opt_err leaks of the allocated opts can occur. Fix the leak
>> on the null s case by checking s is null before the allocation. Fix
>> the leak on the exit path by checking if opts was allocated by
>> kfree'ing opts.
>>
>> Detected by CoverityScan, CID#1475953 ("Resource leak")
>>
>> Fixes: b2130173efae ("smack: take the guts of smack_parse_opts_str() into a new helper")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> There's a better fix in local tree, will go into -next tonight.
>
OK, sounds good to me. Thanks
Colin
prev parent reply other threads:[~2018-12-22 23:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-22 12:27 [PATCH][next] smack: fix two memory leaks in smack_add_opt Colin King
2018-12-22 19:34 ` Al Viro
2018-12-22 23:03 ` Colin Ian King [this message]
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=1d16d3a1-6466-fb16-460f-61cc59659ded@canonical.com \
--to=colin.king@canonical.com \
--cc=casey@schaufler-ca.com \
--cc=jmorris@namei.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=serge@hallyn.com \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).