From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH RESEND] syscalls/prctl06.c: New test for prctl() with PR_{SET, GET}_NO_NEW_PRIVS
Date: Fri, 12 Jul 2019 12:34:06 +0800 [thread overview]
Message-ID: <5D280DBE.4010202@cn.fujitsu.com> (raw)
In-Reply-To: <20190711113405.GA27889@rei.lan>
> Hi!
>>> We are executing setuid binary that was created by root here so
>>> shouldn't we just check that getuid() and getgid() returns 0?
>>>
>> I try it. whether we set or not set new privs, the getuid() or getgid() return nobody in
>> prctl06_execve. Or, I misunderstand your advise?
> Looking closely into the manuals the setuid and setgid bits are supposed
> to set the effective ids, so I guess that the geteuid() and getegid()
> will return 0 when the process was executed without the prctl().
>
Hi Cyril
Yes. I will remove capeff and setuid,setgid check in my v3 patch. For the prctl value
and check that it cannot be unset, I think it is a error test as manpage said
"prctl() fails with EINVAL when options is PR_SET_NO_NEW_PRIVS& arg2 is not equal to 1 or arg3, arg4, or arg5 is nonzero."
I will add it into prctl02.c. Also, there are many error conditions for prctl. So I think when my prctl07.c are merged into
ltp, I will increase prctl02.c together.
Thanks
Yang Xu
next prev parent reply other threads:[~2019-07-12 4:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-09 12:21 [LTP] [PATCH] syscalls/prctl06.c: New test for prctl() with PR_{SET, GET}_NO_NEW_PRIVS Yang Xu
2019-05-22 10:18 ` xuyang
2019-05-23 11:52 ` Cyril Hrubis
2019-06-14 10:32 ` Yang Xu
2019-07-09 10:53 ` Cyril Hrubis
2019-07-05 22:48 ` [LTP] [PATCH RESEND] " Yang Xu
2019-07-10 10:52 ` Cyril Hrubis
2019-07-11 7:57 ` Yang Xu
2019-07-11 11:34 ` Cyril Hrubis
2019-07-12 4:34 ` Yang Xu [this message]
2019-07-12 4:53 ` [LTP] [PATCH v3] syscalls/prctl06: " Yang Xu
2019-07-15 15:49 ` Cyril Hrubis
2019-07-16 5:32 ` Yang Xu
2019-07-10 9:42 ` [LTP] [PATCH] syscalls/prctl06.c: " Yang Xu
2019-06-19 10:58 ` [LTP] [PATCH v2] " Yang Xu
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=5D280DBE.4010202@cn.fujitsu.com \
--to=xuyang2018.jy@cn.fujitsu.com \
--cc=ltp@lists.linux.it \
/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