<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/openat2/helpers.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>2020-02-13T20:15:45Z</updated>
<entry>
<title>selftests: openat2: fix build error on newer glibc</title>
<updated>2020-02-13T20:15:45Z</updated>
<author>
<name>Aleksa Sarai</name>
<email>cyphar@cyphar.com</email>
</author>
<published>2020-02-13T07:26:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9a0584f05687947d5a0b87f046bcd2592a55e67c'/>
<id>urn:sha1:9a0584f05687947d5a0b87f046bcd2592a55e67c</id>
<content type='text'>
It appears that newer glibcs check that openat(O_CREAT) was provided a
fourth argument (rather than passing garbage), resulting in the
following build error:

&gt; In file included from /usr/include/fcntl.h:301,
&gt;                  from helpers.c:9:
&gt; In function 'openat',
&gt;     inlined from 'touchat' at helpers.c:49:11:
&gt; /usr/include/x86_64-linux-gnu/bits/fcntl2.h:126:4: error: call to
&gt; '__openat_missing_mode' declared with attribute error: openat with O_CREAT
&gt; or O_TMPFILE in third argument needs 4 arguments
&gt;   126 |    __openat_missing_mode ();
&gt;       |    ^~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Shuah Khan &lt;shuah@kernel.org&gt;
Signed-off-by: Aleksa Sarai &lt;cyphar@cyphar.com&gt;
Tested-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&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>
