From: Al Viro <viro@zeniv.linux.org.uk>
To: Gen Zhang <blackgod016574@gmail.com>
Cc: paul@paul-moore.com, sds@tycho.nsa.gov, eparis@parisplace.org,
omosnace@redhat.com, selinux@vger.kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH v3] selinux: lsm: fix a missing-check bug in selinux_sb_eat_lsm_opts()
Date: Sat, 1 Jun 2019 03:25:27 +0100 [thread overview]
Message-ID: <20190601022527.GR17978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20190601021526.GA8264@zhanggen-UX430UQ>
On Sat, Jun 01, 2019 at 10:15:26AM +0800, Gen Zhang wrote:
> In selinux_sb_eat_lsm_opts(), 'arg' is allocated by kmemdup_nul(). It
> returns NULL when fails. So 'arg' should be checked. And 'mnt_opts'
> should be freed when error.
What's the latter one for? On failure we'll get to put_fs_context()
pretty soon, so
security_free_mnt_opts(&fc->security);
will be called just fine. Leaving it allocated on failure is fine...
next prev parent reply other threads:[~2019-06-01 2:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-01 2:15 [PATCH v3] selinux: lsm: fix a missing-check bug in selinux_sb_eat_lsm_opts() Gen Zhang
2019-06-01 2:25 ` Al Viro [this message]
2019-06-01 2:34 ` Al Viro
2019-06-01 2:47 ` Gen Zhang
2019-06-01 2:44 ` Gen Zhang
2019-06-03 20:59 ` Paul Moore
2019-06-03 7:23 ` Ondrej Mosnacek
2019-06-03 21:15 ` Paul Moore
2019-06-03 7:27 ` Ondrej Mosnacek
2019-06-03 20:57 ` Paul Moore
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=20190601022527.GR17978@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=blackgod016574@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=eparis@parisplace.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@vger.kernel.org \
/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.