From: Richard Palethorpe <rpalethorpe@suse.de>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] sched: add sched sysctl sanity test
Date: Tue, 03 Oct 2023 09:18:01 +0100 [thread overview]
Message-ID: <874jj82fuz.fsf@suse.de> (raw)
In-Reply-To: <ZRqk47qqtquBw3XQ@yuki>
Hello,
Cyril Hrubis <chrubis@suse.cz> writes:
> Hi!
>> > +static void rt_runtime_us_einval(void)
>> > +{
>> > + TST_EXP_FAIL(write(runtime_fd, "-2", 2), EINVAL,
>> > + "echo -2 > "RT_RUNTIME_US);
>> > +}
>>
>> I would happily add my tags to the test except that as a general
>> principal, I don't want to deal with tests that fail if an unexpected
>> error number is returned.
>>
>> Unless something can be done (e.g. with meta-data), so that TST_EXP_FAIL
>> and similar can be reduced to a TCONF when the wrong errno is returned.
>>
>> For instance, this would allow running the tests with a seccomp BPF
>> profile, LSM, CGroup or /proc bind mount that blocks the write.
>>
>> Or you could just seperate the tests I guess. Then the reset can be
>> checked while skipping the errno checks.
>
> Hmm, so I guess that with LSM we are able to open these files R/W but we
> can stil get EPERM from the write() right?
Sorry, I thought there was an LSM hook in read, but AFAICT there is
not. It's possible that another hook get's called
(e.g. security_inode_getattr), but it's not immediately clear to me.
This still leaves seccomp bpf, FUSE, kernel module, etc. whatever is
mounted at /proc doesn't have to be the original file system. Container
runtimes do something with /proc to filter it. This situation seems to
get more complicated each year.
> I'm reluctant to add wildcard
> TCONF on any errno, but I guess that we can add a TST_EXP_FAIL macro
> version that would have one errno for PASS and one errno for TCONF.
I'm leaning increasingly towards partitioning the test, so that bits can
be filtered out somehow. Then people can focus on the bits they really
care about.
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-10-03 9:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 14:44 [LTP] [PATCH] sched: add sched sysctl sanity test Cyril Hrubis
2023-09-01 15:53 ` Cyril Hrubis
2023-09-01 16:15 ` Petr Vorel
2023-09-01 17:48 ` Petr Vorel
2023-10-02 8:26 ` Richard Palethorpe
2023-10-02 11:09 ` Cyril Hrubis
2023-10-03 8:18 ` Richard Palethorpe [this message]
2023-10-03 8:54 ` Cyril Hrubis
2023-10-04 9:22 ` Richard Palethorpe
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=874jj82fuz.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=chrubis@suse.cz \
--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