<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/openat2/openat2_test.c, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-01-27T23:31:07Z</updated>
<entry>
<title>selftests: openat2: Skip testcases that fail with EOPNOTSUPP</title>
<updated>2022-01-27T23:31:07Z</updated>
<author>
<name>Cristian Marussi</name>
<email>cristian.marussi@arm.com</email>
</author>
<published>2022-01-26T10:27:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ac9e0a250bb155078601a5b999aab05f2a04d1ab'/>
<id>urn:sha1:ac9e0a250bb155078601a5b999aab05f2a04d1ab</id>
<content type='text'>
Skip testcases that fail since the requested valid flags combination is not
supported by the underlying filesystem.

Cc: Aleksa Sarai &lt;cyphar@cyphar.com&gt;
Signed-off-by: Cristian Marussi &lt;cristian.marussi@arm.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: openat2: Fix testing failure for O_LARGEFILE flag</title>
<updated>2021-08-25T19:46:13Z</updated>
<author>
<name>Baolin Wang</name>
<email>baolin.wang@linux.alibaba.com</email>
</author>
<published>2021-08-25T01:49:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d538ddb97e066571e4fc58b832f40739621b42bb'/>
<id>urn:sha1:d538ddb97e066571e4fc58b832f40739621b42bb</id>
<content type='text'>
The openat2 test suite fails on ARM64 because the definition of
O_LARGEFILE is different on ARM64. Fix the problem by defining
the correct O_LARGEFILE definition on ARM64.

"openat2 unexpectedly returned # 3['.../tools/testing/selftests/openat2']
with 208000 (!= 208000)
not ok 102 openat2 with incompatible flags (O_PATH | O_LARGEFILE) fails
with -22 (Invalid argument)"

Fixed change log to improve formatting and clarity:
Shuah Khan &lt;skhan@linuxfoundation.org&gt;

Signed-off-by: Baolin Wang &lt;baolin.wang@linux.alibaba.com&gt;
Reviewed-by: Aleksa Sarai &lt;cyphar@cyphar.com&gt;
Acked-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>test: add openat2() test for invalid upper 32 bit flag value</title>
<updated>2021-05-28T15:44:37Z</updated>
<author>
<name>Christian Brauner</name>
<email>christian.brauner@ubuntu.com</email>
</author>
<published>2021-05-28T09:24:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=15845cbcd12a571869c6703892427f9e5839d5fb'/>
<id>urn:sha1:15845cbcd12a571869c6703892427f9e5839d5fb</id>
<content type='text'>
Test that openat2() rejects unknown flags in the upper 32 bit range.

Link: https://lore.kernel.org/r/20210528092417.3942079-4-brauner@kernel.org
Cc: Richard Guy Briggs &lt;rgb@redhat.com&gt;
Cc: Aleksa Sarai &lt;cyphar@cyphar.com&gt;
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
Signed-off-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
</content>
</entry>
<entry>
<title>selftests: openat2: add RESOLVE_ conflict test</title>
<updated>2020-12-03T09:16:28Z</updated>
<author>
<name>Aleksa Sarai</name>
<email>cyphar@cyphar.com</email>
</author>
<published>2020-10-27T23:50:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4e62d55d77bbdb33d821f5e16306caab38d42267'/>
<id>urn:sha1:4e62d55d77bbdb33d821f5e16306caab38d42267</id>
<content type='text'>
Now that we reject conflicting RESOLVE_ flags, add a selftest to avoid
regressions.

Signed-off-by: Aleksa Sarai &lt;cyphar@cyphar.com&gt;
Link: https://lore.kernel.org/r/20201027235044.5240-3-cyphar@cyphar.com
Signed-off-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
</content>
</entry>
<entry>
<title>selftests: add openat2(2) selftests</title>
<updated>2020-01-18T14:19:18Z</updated>
<author>
<name>Aleksa Sarai</name>
<email>cyphar@cyphar.com</email>
</author>
<published>2020-01-18T12:08:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b28a10aedcd4d175470171a32f4f20b0a60a612b'/>
<id>urn:sha1:b28a10aedcd4d175470171a32f4f20b0a60a612b</id>
<content type='text'>
Test all of the various openat2(2) flags. A small stress-test of a
symlink-rename attack is included to show that the protections against
".."-based attacks are sufficient.

The main things these self-tests are enforcing are:

  * The struct+usize ABI for openat2(2) and copy_struct_from_user() to
    ensure that upgrades will be handled gracefully (in addition,
    ensuring that misaligned structures are also handled correctly).

  * The -EINVAL checks for openat2(2) are all correctly handled to avoid
    userspace passing unknown or conflicting flag sets (most
    importantly, ensuring that invalid flag combinations are checked).

  * All of the RESOLVE_* semantics (including errno values) are
    correctly handled with various combinations of paths and flags.

  * RESOLVE_IN_ROOT correctly protects against the symlink rename(2)
    attack that has been responsible for several CVEs (and likely will
    be responsible for several more).

Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Signed-off-by: Aleksa Sarai &lt;cyphar@cyphar.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
