From: amir73il@gmail.com (Amir Goldstein)
To: linux-security-module@vger.kernel.org
Subject: [PATCH] cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias()
Date: Tue, 3 Jul 2018 11:09:22 +0300 [thread overview]
Message-ID: <CAOQ4uxh0dBGTz9tLwCroFRDCK8ej1DExo7kLwPC3CWX6068sYA@mail.gmail.com> (raw)
In-Reply-To: <20180629025326.GA17892@mail.hallyn.com>
On Fri, Jun 29, 2018 at 5:53 AM, Serge E. Hallyn <serge@hallyn.com> wrote:
> On Fri, Jun 29, 2018 at 09:57:11AM +0800, Eddie.Horng wrote:
>> On Thu, 2018-06-28 at 13:28 -0500, Serge E. Hallyn wrote:
>> > Ah - I just tried his reproducer, and in fact got:
>> >
>> > 0 ? serge at sl ~/test $ getcap execveat
>> > execveat = cap_sys_admin+ep
>> > 0 ? serge at sl ~/test $ ./execveat
>> > execveat: Bad file descriptor
>> >
>> > on ext4, with 4.15.0-22-generic #24~16.04.1-Ubuntu
>> >
>> > Without the filecap, it works.
>> >
>> > -serge
>>
>> The simple reproducer expected /bin/echo exists in the same
>> dir of execveat executable and does not check the return fd
>> of open("echo", ...). I'm not sure if you run into this case,
>> but I tried to run execveat without echo exists, got same result:
>> "execveat: Bad file descriptor".
>
> Hah! Yes, i was in too much of a hurry; I ran it once with
> ./echo existing and no caps, that worked; then i set the caps
> on execveat instead of ./echo, and echo had gotten deleted by the
> previous test causing the failure like you said.
>
> So, the same thing does happen with setuid anyway, so while that
> seems worth addressing one day,
>
Serge,
I misunderstood the bottom line.
Can the problem be reproduced on local fs with/without caps?
and if so, what is missing from reproducer script for that.
Thanks,
Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2018-07-03 8:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1530082758.30361.7.camel@mtkswgap22>
2018-06-27 8:18 ` [PATCH] cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias() Amir Goldstein
2018-06-28 15:01 ` Serge E. Hallyn
2018-06-28 16:54 ` Amir Goldstein
2018-06-28 17:26 ` Serge E. Hallyn
2018-06-28 17:57 ` Amir Goldstein
2018-06-28 18:28 ` Serge E. Hallyn
[not found] ` <1530237431.30361.29.camel@mtkswgap22>
2018-06-29 2:53 ` Serge E. Hallyn
2018-07-03 8:09 ` Amir Goldstein [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=CAOQ4uxh0dBGTz9tLwCroFRDCK8ej1DExo7kLwPC3CWX6068sYA@mail.gmail.com \
--to=amir73il@gmail.com \
--cc=linux-security-module@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 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).