<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sunrpc/auth_gss, branch linux-6.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-04-17T13:42:54Z</updated>
<entry>
<title>SUNRPC: Fix failures of checksum Kunit tests</title>
<updated>2023-04-17T13:42:54Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-04-16T17:05:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d51425190805d47aecc1910b272e65476dd3b937'/>
<id>urn:sha1:d51425190805d47aecc1910b272e65476dd3b937</id>
<content type='text'>
Scott reports that when the new GSS krb5 Kunit tests are built as
a separate module and loaded, the RFC 6803 and RFC 8009 checksum
tests all fail, even though they pass when run under kunit.py.

It appears that passing a buffer backed by static const memory to
gss_krb5_checksum() is a problem. A printk in checksum_case() shows
the correct plaintext, but by the time the buffer has been converted
to a scatterlist and arrives at checksummer(), it contains all
zeroes.

Replacing this buffer with one that is dynamically allocated fixes
the issue.

Reported-by: Scott Mayhew &lt;smayhew@redhat.com&gt;
Fixes: 02142b2ca8fc ("SUNRPC: Add checksum KUnit tests for the RFC 6803 encryption types")
Tested-by: Scott Mayhew &lt;smayhew@redhat.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>sunrpc: Fix RFC6803 encryption test</title>
<updated>2023-04-13T13:59:46Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2023-04-13T13:51:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8bc34660628769f71e8b230144a2a4d86ab0f91'/>
<id>urn:sha1:c8bc34660628769f71e8b230144a2a4d86ab0f91</id>
<content type='text'>
The usage_data[] array in rfc6803_encrypt_case() is uninitialised, so clear
it as it may cause the tests to fail otherwise.

Fixes: b958cff6b27b ("SUNRPC: Add encryption KUnit tests for the RFC 6803 encryption types")
Link: https://lore.kernel.org/r/380323.1681314997@warthog.procyon.org.uk/
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
cc: Chuck Lever &lt;chuck.lever@oracle.com&gt;
cc: Scott Mayhew &lt;smayhew@redhat.com&gt;
cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
cc: linux-nfs@vger.kernel.org
cc: linux-crypto@vger.kernel.org
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Fix a crash in gss_krb5_checksum()</title>
<updated>2023-03-22T20:58:26Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-03-22T19:01:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5f24a8725fe7bc2c6adf7ce00dd3e818387d8995'/>
<id>urn:sha1:5f24a8725fe7bc2c6adf7ce00dd3e818387d8995</id>
<content type='text'>
Anna says:
&gt; KASAN reports [...] a slab-out-of-bounds in gss_krb5_checksum(),
&gt; and it can cause my client to panic when running cthon basic
&gt; tests with krb5p.

&gt; Running faddr2line gives me:
&gt;
&gt; gss_krb5_checksum+0x4b6/0x630:
&gt; ahash_request_free at
&gt; /home/anna/Programs/linux-nfs.git/./include/crypto/hash.h:619
&gt; (inlined by) gss_krb5_checksum at
&gt; /home/anna/Programs/linux-nfs.git/net/sunrpc/auth_gss/gss_krb5_crypto.c:358

My diagnosis is that the memcpy() at the end of gss_krb5_checksum()
reads past the end of the buffer containing the checksum data
because the callers have ignored gss_krb5_checksum()'s API contract:

 * Caller provides the truncation length of the output token (h) in
 * cksumout.len.

Instead they provide the fixed length of the hmac buffer. This
length happens to be larger than the value returned by
crypto_ahash_digestsize().

Change these errant callers to work like krb5_etm_{en,de}crypt().
As a defensive measure, bound the length of the byte copy at the
end of gss_krb5_checksum().

Kunit sez:
Testing complete. Ran 68 tests: passed: 68
Elapsed time: 81.680s total, 5.875s configuring, 75.610s building, 0.103s running

Reported-by: Anna Schumaker &lt;schumaker.anna@gmail.com&gt;
Fixes: 8270dbfcebea ("SUNRPC: Obscure Kerberos integrity keys")
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Properly terminate test case arrays</title>
<updated>2023-02-27T21:27:51Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-02-27T16:52:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fb5b855d9f34927579baa0a20b4d0d8ea3740abd'/>
<id>urn:sha1:fb5b855d9f34927579baa0a20b4d0d8ea3740abd</id>
<content type='text'>
Unable to handle kernel paging request at virtual address 73657420 when execute
[73657420] *pgd=00000000
Internal error: Oops: 80000005 [#1] ARM
CPU: 0 PID: 1 Comm: swapper Tainted: G                 N 6.2.0-rc7-00133-g373f26a81164-dirty #9
Hardware name: Generic DT based system
PC is at 0x73657420
LR is at kunit_run_tests+0x3e0/0x5f4

On x86 with GCC 12, the missing array terminators did not seem to
matter. Other platforms appear to be more picky.

Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Tested-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Let Kunit tests run with some enctypes compiled out</title>
<updated>2023-02-27T21:26:48Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-02-27T15:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe90151c3cc6dbc0836723995f65d371ef4ad514'/>
<id>urn:sha1:fe90151c3cc6dbc0836723995f65d371ef4ad514</id>
<content type='text'>
Allow the new GSS Kerberos encryption type test suites to run
outside of the kunit infrastructure. Replace the assertion that
fires when lookup_enctype() so that the case is skipped instead of
failing outright.

Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Tested-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Fix occasional warning when destroying gss_krb5_enctypes</title>
<updated>2023-02-20T14:20:57Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-02-05T16:58:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2172e84ea00b0164666cf8de971c8b8b02a5938b'/>
<id>urn:sha1:2172e84ea00b0164666cf8de971c8b8b02a5938b</id>
<content type='text'>
I'm guessing that the warning fired because there's some code path
that is called on module unload where the gss_krb5_enctypes file
was never set up.

name 'gss_krb5_enctypes'
WARNING: CPU: 0 PID: 6187 at fs/proc/generic.c:712 remove_proc_entry+0x38d/0x460 fs/proc/generic.c:712

destroy_krb5_enctypes_proc_entry net/sunrpc/auth_gss/svcauth_gss.c:1543 [inline]
gss_svc_shutdown_net+0x7d/0x2b0 net/sunrpc/auth_gss/svcauth_gss.c:2120
ops_exit_list+0xb0/0x170 net/core/net_namespace.c:169
setup_net+0x9bd/0xe60 net/core/net_namespace.c:356
copy_net_ns+0x320/0x6b0 net/core/net_namespace.c:483
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
copy_namespaces+0x410/0x500 kernel/nsproxy.c:179
copy_process+0x311d/0x76b0 kernel/fork.c:2272
kernel_clone+0xeb/0x9a0 kernel/fork.c:2684
__do_sys_clone+0xba/0x100 kernel/fork.c:2825
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Reported-by: syzbot+04a8437497bcfb4afa95@syzkaller.appspotmail.com
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Add encryption self-tests</title>
<updated>2023-02-20T14:20:51Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-01-15T17:24:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c4a9f0552cf682489d370adccf2f3ee11a8ff272'/>
<id>urn:sha1:c4a9f0552cf682489d370adccf2f3ee11a8ff272</id>
<content type='text'>
With the KUnit infrastructure recently added, we are free to define
other unit tests particular to our implementation. As an example,
I've added a self-test that encrypts then decrypts a string, and
checks the result.

Tested-by: Scott Mayhew &lt;smayhew@redhat.com&gt;
Reviewed-by: Simo Sorce &lt;simo@redhat.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Add RFC 8009 encryption KUnit tests</title>
<updated>2023-02-20T14:20:51Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-01-15T17:24:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d2d15c0f1e05ef2478d4891b79570a87c5dd1a6'/>
<id>urn:sha1:4d2d15c0f1e05ef2478d4891b79570a87c5dd1a6</id>
<content type='text'>
RFC 8009 provides sample encryption results. Add KUnit tests to
ensure our implementation derives the expected results for the
provided sample input.

I hate how large this test is, but using non-standard key usage
values means rfc8009_encrypt_case() can't simply reuse -&gt;import_ctx
to allocate and key its ciphers; and the test provides its own
confounders, which means krb5_etm_encrypt() can't be used directly.

Tested-by: Scott Mayhew &lt;smayhew@redhat.com&gt;
Reviewed-by: Simo Sorce &lt;simo@redhat.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Add RFC 8009 checksum KUnit tests</title>
<updated>2023-02-20T14:20:51Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-01-15T17:24:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=003caf4f8c6af53ac48759669f0bd0dd7f69e6f5'/>
<id>urn:sha1:003caf4f8c6af53ac48759669f0bd0dd7f69e6f5</id>
<content type='text'>
RFC 8009 provides sample checksum results. Add KUnit tests to ensure
our implementation derives the expected results for the provided
sample input.

Tested-by: Scott Mayhew &lt;smayhew@redhat.com&gt;
Reviewed-by: Simo Sorce &lt;simo@redhat.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Add KDF-HMAC-SHA2 Kunit tests</title>
<updated>2023-02-20T14:20:51Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2023-01-15T17:24:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fcbad14b585d706337f16300747069b34c77e630'/>
<id>urn:sha1:fcbad14b585d706337f16300747069b34c77e630</id>
<content type='text'>
RFC 8009 provides sample key derivation results, so Kunit tests are
added to ensure our implementation derives the expected keys for the
provided sample input.

Tested-by: Scott Mayhew &lt;smayhew@redhat.com&gt;
Reviewed-by: Simo Sorce &lt;simo@redhat.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
</feed>
