From: Richard Palethorpe <rpalethorpe@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/3] Add test for CVE 2018-13405
Date: Tue, 17 Aug 2021 12:53:34 +0100 [thread overview]
Message-ID: <87pmucl22p.fsf@suse.de> (raw)
In-Reply-To: <f1b416ce-cacf-55be-a7cd-bcff821d0ec7@suse.cz>
Hello Martin,
Martin Doucha <mdoucha@suse.cz> writes:
> On 17. 08. 21 12:23, Richard Palethorpe wrote:
>> Hello Martin,
>>
>> Martin Doucha <mdoucha@suse.cz> writes:
>>> +static void setup(void)
>>> +{
>>> + struct stat buf;
>>> + struct passwd *ltpuser = SAFE_GETPWNAM("nobody");
>>> + struct group *ltpgroup = SAFE_GETGRNAM("bin");
>>
>> These might not exist on some systems. I think you can just pick
>> arbitrary UID/GID numbers instead. No need to check the user/group
>> databases.
>
> I'm planning to rewrite this test after the first two patches get
> merged. See previous discussion under the creat08 patch.
Ah, yes, sorry.
>
>
>>> +static void cleanup(void)
>>> +{
>>> + SAFE_SETREUID(-1, orig_uid);
>>
>> Why are you doing this? I am assuming the temp dir will be deleted by
>> the parent process.
>
> That assumption is incorrect.
>
> https://github.com/linux-test-project/ltp/commit/3833d44a2ba3773359d3b35a2108af691d75b4f9
This looks different as we call semctl in the cleanup callback. It
appears the testdir/tempdir cleanup is done from the parent
process. i.e. from do_exit() which is only called if pid == lib_pid.
--
Thank you,
Richard.
next prev parent reply other threads:[~2021-08-17 11:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 15:45 [LTP] [PATCH 1/3] syscalls/creat08: Convert to new API Martin Doucha
2021-08-06 15:45 ` [LTP] [PATCH 2/3] syscalls/open10: " Martin Doucha
2021-08-06 15:45 ` [LTP] [PATCH 3/3] Add test for CVE 2018-13405 Martin Doucha
2021-08-17 10:23 ` Richard Palethorpe
2021-08-17 10:33 ` Martin Doucha
2021-08-17 11:53 ` Richard Palethorpe [this message]
2021-08-13 13:49 ` [LTP] [PATCH 1/3] syscalls/creat08: Convert to new API Cyril Hrubis
2021-08-13 14:15 ` Martin Doucha
2021-08-13 14:27 ` Cyril Hrubis
2021-08-13 14:30 ` Martin Doucha
2021-08-13 15:18 ` Cyril Hrubis
2021-08-13 15:33 ` Martin Doucha
2021-08-13 17:19 ` Cyril Hrubis
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=87pmucl22p.fsf@suse.de \
--to=rpalethorpe@suse.de \
--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