<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/net/rxrpc/key.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/net/rxrpc/key.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/net/rxrpc/key.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-01-13T18:38:00Z</updated>
<entry>
<title>rxrpc: Fix handling of an unsupported token type in rxrpc_read()</title>
<updated>2021-01-13T18:38:00Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2021-01-12T15:23:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d52e419ac8b50c8bef41b398ed13528e75d7ad48'/>
<id>urn:sha1:d52e419ac8b50c8bef41b398ed13528e75d7ad48</id>
<content type='text'>
Clang static analysis reports the following:

net/rxrpc/key.c:657:11: warning: Assigned value is garbage or undefined
                toksize = toksizes[tok++];
                        ^ ~~~~~~~~~~~~~~~

rxrpc_read() contains two consecutive loops.  The first loop calculates the
token sizes and stores the results in toksizes[] and the second one uses
the array.  When there is an error in identifying the token in the first
loop, the token is skipped, no change is made to the toksizes[] array.
When the same error happens in the second loop, the token is not skipped.
This will cause the toksizes[] array to be out of step and will overrun
past the calculated sizes.

Fix this by making both loops log a message and return an error in this
case.  This should only happen if a new token type is incompletely
implemented, so it should normally be impossible to trigger this.

Fixes: 9a059cd5ca7d ("rxrpc: Downgrade the BUG() for unsupported token type in rxrpc_read()")
Reported-by: Tom Rix &lt;trix@redhat.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Tom Rix &lt;trix@redhat.com&gt;
Link: https://lore.kernel.org/r/161046503122.2445787.16714129930607546635.stgit@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>rxrpc: Fix example key name in a comment</title>
<updated>2020-11-23T18:09:30Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-10-15T14:47:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=177b8989661bf7f90851c7ab3dc174b1aa117989'/>
<id>urn:sha1:177b8989661bf7f90851c7ab3dc174b1aa117989</id>
<content type='text'>
Fix an example of an rxrpc key name in a comment.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: Ignore unknown tokens in key payload unless no known tokens</title>
<updated>2020-11-23T18:09:30Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-10-15T14:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9a0e6464f45b056163e6f04b14df44b15f02ed3a'/>
<id>urn:sha1:9a0e6464f45b056163e6f04b14df44b15f02ed3a</id>
<content type='text'>
When parsing a payload for an rxrpc-type key, ignore any tokens that are
not of a known type and don't give an error for them - unless there are no
tokens of a known type.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: Make the parsing of xdr payloads more coherent</title>
<updated>2020-11-23T18:09:30Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-09-27T10:17:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4c20c33340269e2924d2040a5f1ca2571fd8b258'/>
<id>urn:sha1:4c20c33340269e2924d2040a5f1ca2571fd8b258</id>
<content type='text'>
Make the parsing of xdr-encoded payloads, as passed to add_key, more
coherent.  Shuttling back and forth between various variables was a bit
hard to follow.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: Don't leak the service-side session key to userspace</title>
<updated>2020-11-23T18:09:29Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-09-27T10:07:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d2ae4e918218f543214fbd906db68a6c580efbbb'/>
<id>urn:sha1:d2ae4e918218f543214fbd906db68a6c580efbbb</id>
<content type='text'>
Don't let someone reading a service-side rxrpc-type key get access to the
session key that was exchanged with the client.  The server application
will, at some point, need to be able to read the information in the ticket,
but this probably shouldn't include the key material.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: Split the server key type (rxrpc_s) into its own file</title>
<updated>2020-11-23T18:09:29Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-09-16T07:25:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ca7fb10059a5755908d46db81d1f3738cd26aa9f'/>
<id>urn:sha1:ca7fb10059a5755908d46db81d1f3738cd26aa9f</id>
<content type='text'>
Split the server private key type (rxrpc_s) out into its own file rather
than mingling it with the authentication/client key type (rxrpc) since they
don't really bear any relation.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: List the held token types in the key description in /proc/keys</title>
<updated>2020-11-23T18:09:29Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-09-08T21:30:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0727d3ec38074d0cef3fbef1d64f2d0a92ace046'/>
<id>urn:sha1:0727d3ec38074d0cef3fbef1d64f2d0a92ace046</id>
<content type='text'>
When viewing an rxrpc-type key through /proc/keys, display a list of held
token types.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: Remove the rxk5 security class as it's now defunct</title>
<updated>2020-11-23T18:09:29Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-09-03T07:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8a5dc321158fb3032cf990deb7473e22826e7346'/>
<id>urn:sha1:8a5dc321158fb3032cf990deb7473e22826e7346</id>
<content type='text'>
Remove the rxrpc rxk5 security class as it's now defunct and nothing uses
it anymore.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: Fix server keyring leak</title>
<updated>2020-10-05T16:09:22Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-10-02T13:04:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=38b1dc47a35ba14c3f4472138ea56d014c2d609b'/>
<id>urn:sha1:38b1dc47a35ba14c3f4472138ea56d014c2d609b</id>
<content type='text'>
If someone calls setsockopt() twice to set a server key keyring, the first
keyring is leaked.

Fix it to return an error instead if the server key keyring is already set.

Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: The server keyring isn't network-namespaced</title>
<updated>2020-10-05T15:36:06Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2020-09-30T18:52:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=fea99111244bae44e7d82a973744d27ea1567814'/>
<id>urn:sha1:fea99111244bae44e7d82a973744d27ea1567814</id>
<content type='text'>
The keyring containing the server's tokens isn't network-namespaced, so it
shouldn't be looked up with a network namespace.  It is expected to be
owned specifically by the server, so namespacing is unnecessary.

Fixes: a58946c158a0 ("keys: Pass the network namespace into request_key mechanism")
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
</feed>
