From: Andrew Morgan <morgan@kernel.org>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: Chris Wright <chrisw@sous-sol.org>,
Andrew Morgan <agm@google.com>,
casey@schaufler-ca.com, Andrew Morton <akpm@google.com>,
Stephen Smalley <sds@tycho.nsa.gov>,
KaiGai Kohei <kaigai@kaigai.gr.jp>,
James Morris <jmorris@namei.org>,
linux-security-module@vger.kernel.org,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] file capabilities: get_file_caps cleanups
Date: Thu, 28 Jun 2007 09:27:38 -0700 [thread overview]
Message-ID: <4683E17A.3060706@kernel.org> (raw)
In-Reply-To: <20070628134702.GB29641@sergelap.austin.ibm.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Serge E. Hallyn wrote:
>>>> kfree(dcaps);
> Move this two lines down (rc defaults to 0 in goto above):
> from here-->
>>>> +clear_caps:
>>>> + if (rc) {
> to here-->
>
>> Hmm? But if we succeeded we still want to free dcaps if we
>> kmalloc()'d it.
I wasn't clear enough... Let me try again with different words.
If you look at your patch, you will see that the only use of the label
'clear_caps:' is as a jump target from a location in which rc=0. As
such, you will *not* clear the bprm->cap_* sets... This is the reverse
of what you intended to do.
You need to put the jump target 'inside' the 'if (rc) { <-here ... }'.
Cheers
Andrew
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGg+F6+bHCR3gb8jsRAm2AAJ9v0fz/S/+HvGWOhU6UBPbB4iY+MACggZqA
+yCrxg2UVKdDKOh6kPfh0QI=
=Qksf
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2007-06-28 16:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-28 0:20 [PATCH 1/1] file capabilities: get_file_caps cleanups Serge E. Hallyn
2007-06-28 6:10 ` Andrew Morgan
2007-06-28 13:47 ` Serge E. Hallyn
2007-06-28 16:27 ` Andrew Morgan [this message]
2007-06-28 16:49 ` Serge E. Hallyn
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=4683E17A.3060706@kernel.org \
--to=morgan@kernel.org \
--cc=agm@google.com \
--cc=akpm@google.com \
--cc=casey@schaufler-ca.com \
--cc=chrisw@sous-sol.org \
--cc=jmorris@namei.org \
--cc=kaigai@kaigai.gr.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sds@tycho.nsa.gov \
--cc=serue@us.ibm.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.