Re: [PATCH net-next 3/7] afs: switch to in_dev_for_each_ifa_rcu

2019-05-29 Thread David Howells
Florian Westphal wrote: > The in_dev_for_each_ifa_rcu helper gets used so sparse won't > complain when we add the proper __rcu annotation to the ifa_list > member in struct in_device later. > > While doing this I realized the helper only has one call site, > so move it to where its needed. > >

Re: [PATCH net-next v2 1/7] afs: do not send list of client addresses

2019-05-31 Thread David Howells
Florian Westphal wrote: > David Howell says: "Howells" Apart from that: Tested-by: David Howells

Problem using skb_cow_data()

2019-07-24 Thread David Howells
Hi, I have a problem using skb_cow_data() in rxkad_verify_packet{,_1,_2}() and was wondering if anyone can suggest a better way. The problem is that the rxrpc packet receive routine, rxrpc_input_data(), receives an skb from the udp socket, makes it its own and then, if it's a data packet, stores

Re: [PATCH net] rxrpc: Call state should be read with READ_ONCE() under some circumstances

2021-01-13 Thread David Howells
Jakub Kicinski wrote: > On Tue, 12 Jan 2021 15:59:15 +0000 David Howells wrote: > > From: Baptiste Lepers > > > > The call state may be changed at any time by the data-ready routine in > > response to received packets, so if the call state is to be read and acted

Re: [PATCH net-next] net: delete __dev_getfirstbyhwtype

2020-11-30 Thread David Howells
Vladimir Oltean wrote: > The last user of the RTNL brother of dev_getfirstbyhwtype (the latter > being synchronized under RCU) has been deleted in commit b4db2b35fc44 > ("afs: Use core kernel UUID generation"). > > Cc: Arnd Bergmann > Cc: David Howells > Cc

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-12-01 Thread David Howells
Btw, would it be feasible to make it so that an extra parameter can be added to the cipher buffer-supplying functions, e.g.: skcipher_request_set_crypt(req, input, ciphertext_sg, esize, iv); such that we can pass in an offset into the output sg as well? David

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-12-01 Thread David Howells
Herbert Xu wrote: > Couldn't you just change the output sg to include the offset? That depends on whether the caller has passed it elsewhere for some other parallel purpose, but I think I'm going to have to go down that road and restore it afterwards. David

Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-04 Thread David Howells
Hi Chuck, Bruce, Why is gss_krb5_crypto.c using an auxiliary cipher? For reference, the gss_krb5_aes_encrypt() code looks like the attached. >From what I can tell, in AES mode, the difference between the main cipher and the auxiliary cipher is that the latter is "cbc(aes)" whereas the former is

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-04 Thread David Howells
Bruce Fields wrote: > > Reading up on CTS, I'm guessing the reason it's like this is that CTS is the > > same as the non-CTS, except for the last two blocks, but the non-CTS one is > > more efficient. > > CTS is cipher-text stealing, isn't it? I think it was Kevin Coffman > that did that, and I

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-04 Thread David Howells
Bruce Fields wrote: > OK, I guess I don't understand the question. I haven't thought about > this code in at least a decade. What's an auxilary cipher? Is this a > question about why we're implementing something, or how we're > implementing it? That's what the Linux sunrpc implementation call

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-04 Thread David Howells
Ard Biesheuvel wrote: > The tricky thing with CTS is that you have to ensure that the final > full and partial blocks are presented to the crypto driver as one > chunk, or it won't be able to perform the ciphertext stealing. This > might be the reason for the current approach. If the sunrpc code

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-07 Thread David Howells
Herbert Xu wrote: > > Herbert recently made some changes for MSG_MORE support in the AF_ALG > > code, which permits a skcipher encryption to be split into several > > invocations of the skcipher layer without the need for this complexity > > on the side of the caller. Maybe there is a way to reus

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-07 Thread David Howells
Ard Biesheuvel wrote: > > Yeah - the problem with that is that for sunrpc, we might be dealing with > > 1MB > > plus bits of non-contiguous pages, requiring >8K of scatterlist elements > > (admittedly, we can chain them, but we may have to do one or more large > > allocations). > > > > > However

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-07 Thread David Howells
Ard Biesheuvel wrote: > > I wonder if it would help if the input buffer and output buffer didn't > > have to correspond exactly in usage - ie. the output buffer could be used > > at a slower rate than the input to allow for buffering inside the crypto > > algorithm. > > > > I don't follow - how

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-08 Thread David Howells
Ard Biesheuvel wrote: Ard Biesheuvel wrote: > > > > I wonder if it would help if the input buffer and output buffer didn't > > > > have to correspond exactly in usage - ie. the output buffer could be > > > > used at a slower rate than the input to allow for buffering inside the > > > > crypto a

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-08 Thread David Howells
I wonder - would it make sense to reserve two arrays of scatterlist structs and a mutex per CPU sufficient to map up to 1MiB of pages with each array while the krb5 service is in use? That way sunrpc could, say, grab the mutex, map the input and output buffers, do the entire crypto op in one go an

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-08 Thread David Howells
David Howells wrote: > I wonder - would it make sense to reserve two arrays of scatterlist structs > and a mutex per CPU sufficient to map up to 1MiB of pages with each array > while the krb5 service is in use? Actually, simply reserving a set per CPU is probably unnecessary. We c

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-08 Thread David Howells
Ard Biesheuvel wrote: > Apparently, it is permitted for gss_krb5_cts_crypt() to do a > kmalloc(GFP_NOFS) in the context from where gss_krb5_aes_encrypt() is > being invoked, and so I don't see why it wouldn't be possible to > simply kmalloc() a scatterlist[] of the appropriate size, populate it >

Re: [PATCH net-next] net: rxrpc: convert comma to semicolon

2020-12-09 Thread David Howells
Zheng Yongjun wrote: > Replace a comma between expression statements by a semicolon. > > Signed-off-by: Zheng Yongjun Reviewed-by: David Howells

[PATCH net-next 01/17] keys: Provide the original description to the key preparser

2020-11-23 Thread David Howells
it's better to do that when the key is loaded rather than deep in trying to process a response packet. Signed-off-by: David Howells cc: Jarkko Sakkinen cc: keyri...@vger.kernel.org --- include/linux/key-type.h |1 + security/keys/key.c |2 ++ 2 files changed, 3 insertions(+)

[PATCH net 00/17] rxrpc: Prelude to gssapi support

2020-11-23 Thread David Howells
ls/linux-fs.git rxrpc-next-20201123 and can also be found on the following branch: http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-next David --- David Howells (17): keys: Provide the original description to the key preparser rxrpc: Remove the rxk5

[PATCH net-next 02/17] rxrpc: Remove the rxk5 security class as it's now defunct

2020-11-23 Thread David Howells
Remove the rxrpc rxk5 security class as it's now defunct and nothing uses it anymore. Signed-off-by: David Howells --- include/keys/rxrpc-type.h | 55 - net/rxrpc/key.c | 468 - 2 files changed, 523 deletions(-) diff --git a/in

[PATCH net-next 04/17] rxrpc: Support keys with multiple authentication tokens

2020-11-23 Thread David Howells
higher layer) and go through the tokens to find one that's supported. Signed-off-by: David Howells --- net/rxrpc/ar-internal.h |4 +++- net/rxrpc/conn_event.c |3 ++- net/rxrpc/insecure.c|3 ++- net/rxrpc/rxkad.c |5 ++--- net/rxrpc/security.c|

[PATCH net-next 05/17] rxrpc: Don't retain the server key in the connection

2020-11-23 Thread David Howells
ding types. Keys of this type have an extra bit in the description: ":::" Signed-off-by: David Howells --- net/rxrpc/ar-internal.h | 11 +++--- net/rxrpc/call_accept.c | 14 net/rxrpc/conn_event.c |1 - net/rxrpc/conn_object.c |1 - net/rxrpc/co

[PATCH net-next 03/17] rxrpc: List the held token types in the key description in /proc/keys

2020-11-23 Thread David Howells
When viewing an rxrpc-type key through /proc/keys, display a list of held token types. Signed-off-by: David Howells --- net/rxrpc/key.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index fb4d2a2fca02

[PATCH net-next 08/17] rxrpc: Don't leak the service-side session key to userspace

2020-11-23 Thread David Howells
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

[PATCH net-next 10/17] rxrpc: Make the parsing of xdr payloads more coherent

2020-11-23 Thread David Howells
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 --- net/rxrpc/key.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff

[PATCH net-next 06/17] rxrpc: Split the server key type (rxrpc_s) into its own file

2020-11-23 Thread David Howells
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 --- net/rxrpc/Makefile |1 net/rxrpc/ar-internal.h |9 ++- net/

[PATCH net-next 11/17] rxrpc: Ignore unknown tokens in key payload unless no known tokens

2020-11-23 Thread David Howells
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 --- net/rxrpc/key.c | 31 +-- 1 file changed, 21 inser

[PATCH net-next 07/17] rxrpc: Hand server key parsing off to the security class

2020-11-23 Thread David Howells
-off-by: David Howells --- net/rxrpc/ar-internal.h | 11 + net/rxrpc/rxkad.c | 47 +++ net/rxrpc/security.c|2 +- net/rxrpc/server_key.c | 56 +++ 4 files changed, 86 insertions(+), 30

[PATCH net-next 09/17] rxrpc: Allow security classes to give more info on server keys

2020-11-23 Thread David Howells
Allow a security class to give more information on an rxrpc_s-type key when it is viewed in /proc/keys. This will allow the upcoming RxGK security class to show the enctype name here. Signed-off-by: David Howells --- net/rxrpc/ar-internal.h |3 +++ net/rxrpc/server_key.c |4 2

[PATCH net-next 12/17] rxrpc: Fix example key name in a comment

2020-11-23 Thread David Howells
Fix an example of an rxrpc key name in a comment. Signed-off-by: David Howells --- net/rxrpc/key.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index 7e6d19263ce3..9631aa8543b5 100644 --- a/net/rxrpc/key.c +++ b/net/rxrpc/key.c

[PATCH net-next 13/17] rxrpc: Merge prime_packet_security into init_connection_security

2020-11-23 Thread David Howells
Merge the ->prime_packet_security() into the ->init_connection_security() hook as they're always called together. Signed-off-by: David Howells --- net/rxrpc/ar-internal.h |2 -- net/rxrpc/conn_client.c |6 -- net/rxrpc/conn_event.c |4 net/rxrpc/insecure.

[PATCH net-next 14/17] rxrpc: Don't reserve security header in Tx DATA skbuff

2020-11-23 Thread David Howells
encrypt-and-checksum function that is used in a number of circumstances. Signed-off-by: David Howells --- net/rxrpc/ar-internal.h |5 + net/rxrpc/insecure.c|6 ++ net/rxrpc/rxkad.c | 24 +--- net/rxrpc/sendmsg.c |6 ++ 4 files changed, 14

[PATCH net-next 15/17] rxrpc: Organise connection security to use a union

2020-11-23 Thread David Howells
Organise the security information in the rxrpc_connection struct to use a union to allow for different data for different security classes. Signed-off-by: David Howells --- net/rxrpc/ar-internal.h | 11 --- net/rxrpc/rxkad.c | 40 2

[PATCH net-next 17/17] rxrpc: Ask the security class how much space to allow in a packet

2020-11-23 Thread David Howells
Ask the security class how much header and trailer space to allow for when allocating a packet, given how much data is remaining. This will allow the rxgk security class to stick both a trailer in as well as a header as appropriate in the future. Signed-off-by: David Howells --- net/rxrpc/ar

[PATCH net-next 16/17] rxrpc: rxkad: Don't use pskb_pull() to advance through the response packet

2020-11-23 Thread David Howells
to just add the displacement to the next offset. Signed-off-by: David Howells --- net/rxrpc/rxkad.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index f3182edfcbae..e5b4bbdd0f34 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@

Re: [PATCH net-next 15/17] rxrpc: Organise connection security to use a union

2020-11-23 Thread David Howells
Joe Perches wrote: > It seems no other follow-on patch in the series uses this nameless union. There will be a follow on series. Either this: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-rxgk or this: https://git.kernel.org/pub/scm/lin

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-11-26 Thread David Howells
Herbert Xu wrote: > > Here's my first cut at a generic Kerberos crypto library in the kernel so > > that I can share code between rxrpc and sunrpc (and cifs?). > > I can't find the bit where you are actually sharing this code with > sunrpc, am I missing something? I haven't done that yet. Sorr

[RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-11-12 Thread David Howells
rpc patches that are a prerequisite for this, but the crypto patches don't need it. --- The patches can be found here also: http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=crypto-krb5 David --- David Howells (18): crypto/krb5: Implement Kerberos crypto

[PATCH 02/18] crypto/krb5: Add some constants out of sunrpc headers

2020-11-12 Thread David Howells
Add some constants from the sunrpc headers. Signed-off-by: David Howells --- include/crypto/krb5.h | 39 +++ 1 file changed, 39 insertions(+) diff --git a/include/crypto/krb5.h b/include/crypto/krb5.h index 2bd6cfe50b85..a7e4ab4e1348 100644 --- a/include

[PATCH 01/18] crypto/krb5: Implement Kerberos crypto core

2020-11-12 Thread David Howells
Provide core structures, an encoding-type registry and basic module and config bits for a generic Kerberos crypto library. Signed-off-by: David Howells --- crypto/Kconfig |1 + crypto/Makefile|1 + crypto/krb5/Kconfig| 11 ++ crypto/krb5/Makefile |9

[PATCH 06/18] crypto/krb5: Implement the Kerberos5 rfc3961 get_mic and verify_mic

2020-11-12 Thread David Howells
Add functions that sign and verify a piece of an skbuff according to rfc3961 sec 5.4, using Kc to generate a checksum and insert it into the MIC field in the skbuff in the sign phase then checksum the data and compare it to the MIC in the verify phase. Signed-off-by: David Howells --- crypto

[PATCH 05/18] crypto/krb5: Implement the Kerberos5 rfc3961 encrypt and decrypt functions

2020-11-12 Thread David Howells
Add functions that encrypt and decrypt a piece of an skbuff according to rfc3961 sec 5.3, using Ki to checksum the data to be secured and Ke to encrypt it during the encryption phase, then decrypting with Ke and verifying the checksum with Ki in the decryption phase. Signed-off-by: David Howells

[PATCH 04/18] crypto/krb5: Implement the Kerberos5 rfc3961 key derivation

2020-11-12 Thread David Howells
Implement the simplified crypto profile for Kerberos 5 rfc3961 with the pseudo-random function, PRF(), from section 5.3 and the key derivation function, DK() from section 5.1. Signed-off-by: David Howells --- crypto/krb5/Makefile |3 crypto/krb5/internal.h |6

[PATCH 08/18] crypto/krb5: Implement crypto self-testing

2020-11-12 Thread David Howells
Implement self-testing infrastructure to test the pseudo-random function, key derivation, encryption and checksumming. Signed-off-by: David Howells --- crypto/krb5/Kconfig |4 crypto/krb5/Makefile|4 crypto/krb5/internal.h | 48 crypto/krb5/main.c

[PATCH 10/18] crypto/krb5: Implement the AES encrypt/decrypt from rfc8009

2020-11-12 Thread David Howells
Implement encryption and decryption functions for AES + HMAC-SHA2 as described in rfc8009 sec 5. Signed-off-by: David Howells --- crypto/krb5/rfc8009_aes2.c | 205 1 file changed, 203 insertions(+), 2 deletions(-) diff --git a/crypto/krb5

[PATCH 09/18] crypto/krb5: Implement the AES enctypes from rfc8009

2020-11-12 Thread David Howells
Implement the aes128-cts-hmac-sha256-128 and aes256-cts-hmac-sha384-192 enctypes from rfc8009, overriding the rfc3961 kerberos 5 simplified crypto scheme. Signed-off-by: David Howells --- crypto/krb5/Kconfig|2 crypto/krb5/Makefile |3 - crypto/krb5/internal.h |6

[PATCH 11/18] crypto/krb5: Add the AES self-testing data from rfc8009

2020-11-12 Thread David Howells
Add the self-testing data from rfc8009 to test AES + HMAC-SHA2. Signed-off-by: David Howells --- crypto/krb5/selftest_data.c | 116 +++ 1 file changed, 116 insertions(+) diff --git a/crypto/krb5/selftest_data.c b/crypto/krb5/selftest_data.c index

[PATCH 14/18] rxrpc: Add YFS RxGK (GSSAPI) security class

2020-11-12 Thread David Howells
KEN_CELL_MAX = 64; struct ktc_setTokenData { afs_int32 flags; string cell; token_opaque tokens; }; The parser for the basic token struct is already present, as is the rxkad token type. This adds a parser for the rxgk token type. Signed-off-by: David Howells ---

[PATCH 13/18] rxrpc: Add the security index for yfs-rxgk

2020-11-12 Thread David Howells
Add the security index for the YFS variant of rxgk. Signed-off-by: David Howells --- fs/afs/misc.c | 13 + include/uapi/linux/rxrpc.h | 17 + 2 files changed, 30 insertions(+) diff --git a/fs/afs/misc.c b/fs/afs/misc.c index 1d1a8debe472

[PATCH 12/18] crypto/krb5: Implement the Camellia enctypes from rfc6803

2020-11-12 Thread David Howells
=6803 Signed-off-by: David Howells --- crypto/krb5/Kconfig|3 crypto/krb5/Makefile |3 crypto/krb5/internal.h |6 + crypto/krb5/main.c |2 crypto/krb5/rfc6803_camellia.c | 249 crypto/krb5

[PATCH 15/18] rxrpc: rxgk: Provide infrastructure and key derivation

2020-11-12 Thread David Howells
in: tools.ietf.org/html/draft-wilkinson-afs3-rxgk-11 Signed-off-by: David Howells --- net/rxrpc/Kconfig | 10 ++ net/rxrpc/Makefile |3 + net/rxrpc/ar-internal.h |3 + net/rxrpc/rxgk_common.h | 44 net/rxrpc/rxgk_kdf.c| 271

[PATCH 16/18] rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI)

2020-11-12 Thread David Howells
Implement the basic parts of the yfs-rxgk security class (security index 6) to support GSSAPI-negotiated security. Signed-off-by: David Howells --- include/trace/events/rxrpc.h |4 net/rxrpc/Makefile |2 net/rxrpc/ar-internal.h | 12 net/rxrpc/rxgk.c

[PATCH 17/18] rxrpc: rxgk: Implement connection rekeying

2020-11-12 Thread David Howells
inserted into the security-specific field in the RX header, and we try and expand it to 32-bits to make it last longer. Signed-off-by: David Howells --- net/rxrpc/ar-internal.h |6 ++ net/rxrpc/conn_object.c |2 + net/rxrpc/rxgk.c| 156

[PATCH 07/18] crypto/krb5: Implement the AES enctypes from rfc3962

2020-11-12 Thread David Howells
Implement the aes128-cts-hmac-sha1-96 and aes256-cts-hmac-sha1-96 enctypes from rfc3962, using the rfc3961 kerberos 5 simplified crypto scheme. Signed-off-by: David Howells --- crypto/krb5/Makefile |3 + crypto/krb5/internal.h|6 ++ crypto/krb5/main.c|2 + crypto

[PATCH 03/18] crypto/krb5: Provide infrastructure and key derivation

2020-11-12 Thread David Howells
Provide key derivation interface functions and a helper to implement the PRF+ function from rfc4402. Signed-off-by: David Howells --- crypto/krb5/Makefile |1 crypto/krb5/kdf.c | 223 + include/crypto/krb5.h | 29 ++ 3 files

[PATCH 18/18] rxgk: Support OpenAFS's rxgk implementation

2020-11-12 Thread David Howells
--- net/rxrpc/ar-internal.h |1 net/rxrpc/key.c | 136 +++ net/rxrpc/rxgk.c| 25 + net/rxrpc/rxgk_app.c| 135 +++ net/rxrpc/rxgk_common.h |2 + net/rxrpc/security.c

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-11-12 Thread David Howells
Would it be possible/practical to make the skcipher encrypt functions take an offset into the scatterlist rather than always starting at the beginning? David

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-11-12 Thread David Howells
Chuck Lever wrote: > > There are three main interfaces to it: > > > > (*) I/O crypto: encrypt, decrypt, get_mic and verify_mic. > > > > These all do in-place crypto, using an sglist to define the buffer > > with the data in it. Is it necessary to make it able to take separate > > i

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-11-12 Thread David Howells
Chuck Lever wrote: > Really? My understanding of the Linux kernel SUNRPC implementation is > that it uses asynchronous, even for small data items. Maybe I'm using > the terminology incorrectly. Seems to be synchronous, at least in its use of skcipher: grep -e skcipher * gss_krb5_crypto.c:#inclu

Re: [PATCH] rxrpc: fix handling of an unsupported token type in rxrpc_read()

2021-01-04 Thread David Howells
t...@redhat.com wrote: > - switch (token->security_index) { > - case RXRPC_SECURITY_RXKAD: > ... > - switch (token->security_index) { > - case RXRPC_SECURITY_RXKAD: These switches need to be kept. There's another security type on the way. See: htt

Re: [PATCH] rxrpc: fix handling of an unsupported token type in rxrpc_read()

2021-01-06 Thread David Howells
How about this? David --- commit 5d370a9db65a6fae82f09a009430ae40c564b0ef Author: David Howells Date: Wed Jan 6 16:21:40 2021 + rxrpc: Fix handling of an unsupported token type in rxrpc_read() Clang static analysis reports the following: net/rxrpc/key.c:657:11

Re: [PATCH] rxrpc: fix handling of an unsupported token type in rxrpc_read()

2021-01-06 Thread David Howells
David Howells wrote: > How about this? > ... > Fix the second loop so that it doesn't encode the size and type of an > unsupported token, but rather just ignore it as does the first loop. Actually, a better way is probably just to error out in this case. This should

Re: [PATCH] rxrpc: fix handling of an unsupported token type in rxrpc_read()

2021-01-06 Thread David Howells
Tom Rix wrote: > These two loops iterate over the same data, i believe returning here is all > that is needed. But if the first loop is made to support a new type, but the second loop is missed, it will then likely oops. Besides, the compiler should optimise both paths together. David

Re: [PATCH] rxrpc: fix handling of an unsupported token type in rxrpc_read()

2021-01-06 Thread David Howells
Tom Rix wrote: > On 1/6/21 11:44 AM, David Howells wrote: > > Tom Rix wrote: > > > >> These two loops iterate over the same data, i believe returning here is all > >> that is needed. > > But if the first loop is made to support a new type, but the second

Re: [PATCH] rxrpc: Call state should be read with READ_ONCE() under some circumstances

2021-01-07 Thread David Howells
Baptiste Lepers wrote: > The call state may be changed at any time by the data-ready routine in > response to received packets, so if the call state is to be read and acted > upon several times in a function, READ_ONCE() must be used unless the call > state lock is held. I'm going to add: A

[PATCH net] rxrpc: Fix handling of an unsupported token type in rxrpc_read()

2021-01-12 Thread David Howells
("rxrpc: Downgrade the BUG() for unsupported token type in rxrpc_read()") Reported-by: Tom Rix Signed-off-by: David Howells Reviewed-by: Tom Rix --- net/rxrpc/key.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index 96

[PATCH net] rxrpc: Call state should be read with READ_ONCE() under some circumstances

2021-01-12 Thread David Howells
() to read the state a few lines above the unmarked read in rxrpc_input_data(), so use that value rather than re-reading it. Signed-off-by: Baptiste Lepers Signed-off-by: David Howells --- net/rxrpc/input.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rxrpc/input.c

Re: INFO: rcu detected stall in ip_list_rcv

2020-11-06 Thread David Howells
#syz fix: afs: Fix cell removal

Re: INFO: rcu detected stall in security_file_open (3)

2020-11-06 Thread David Howells
#syz fix: afs: Fix cell removal

Re: [RESEND net-next] rxrpc: Fix dependency on IPv6 in udp tunnel config

2021-02-12 Thread David Howells
ported-by: kernel test robot > Signed-off-by: Vadim Fedorenko Looks reasonable. Acked-by: David Howells

Re: [PATCH] net/rxrpc: Fix a use after free in rxrpc_input_packet

2021-04-01 Thread David Howells
Lv Yunlong wrote: > In the case RXRPC_PACKET_TYPE_DATA of rxrpc_input_packet, if > skb_unshare(skb,..) failed, it will free the skb and return NULL. > But if skb_unshare() return NULL, the freed skb will be used by > rxrpc_eaten_skb(skb,..). That's not precisely the case: void rxrpc_eat

Re: [PATCHv4 net-next 2/2] rxrpc: call udp_tunnel_encap_enable in rxrpc_open_socket

2021-01-26 Thread David Howells
net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "ar-internal.h" With that, it seems to work still: Acked-and-tested-by: David Howells David

[PATCH net] rxrpc: Fix memory leak in rxrpc_lookup_local

2021-01-28 Thread David Howells
gt;] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 [<637076d4>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 9ebeddef58c4 ("rxrpc: rxrpc_peer needs to hold a ref on the rxrpc_local record") Signed-off-by: Takeshi Misawa Reported-and-tested-by: syzbot+305326672

[PATCH net] rxrpc: Fix deadlock around release of dst cached on udp tunnel

2021-01-29 Thread David Howells
work out the fix. Reported-by: syzbot+df400f2f24a1677cd...@syzkaller.appspotmail.com Reported-by: Vadim Fedorenko Fixes: 5271953cad31 ("rxrpc: Use the UDP encap_rcv hook") Signed-off-by: David Howells --- fs/afs/main.c|6 +++--- net/rxrpc/af_rxrpc.c |6 +++--- 2 fil

Re: [PATCH net] rxrpc: Fix deadlock around release of dst cached on udp tunnel

2021-01-29 Thread David Howells
Vadim Fedorenko wrote: > You missed the call to dst_release(sk->sk_rx_dst) in > rxrpc_sock_destructor. Without it we are still leaking the dst. Hmmm... I no longer get the messages appearing with this patch. I'll have another look. David

[PATCH net] rxrpc: Fix deadlock around release of dst cached on udp tunnel

2021-01-29 Thread David Howells
work out the fix. Reported-by: syzbot+df400f2f24a1677cd...@syzkaller.appspotmail.com Reported-by: Vadim Fedorenko Fixes: 5271953cad31 ("rxrpc: Use the UDP encap_rcv hook") Signed-off-by: David Howells Acked-by: Vadim Fedorenko --- fs/afs/main.c|6 +++--- net/rxrpc/

Re: KASAN: use-after-free Read in rxrpc_send_data_packet

2021-02-01 Thread David Howells
Hillf Danton wrote: > --- a/net/rxrpc/call_object.c > +++ b/net/rxrpc/call_object.c > @@ -549,6 +549,7 @@ void rxrpc_release_call(struct rxrpc_soc > if (call->security) > call->security->free_call_crypto(call); > > + cancel_work_sync(&call->processor); > rxrpc_clea

Re: KASAN: use-after-free Read in rxrpc_send_data_packet

2021-02-01 Thread David Howells
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 7ef09ba11b33e371c9a8510c1f56e40aa0862c65

Re: [PATCHv4 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP GRO

2021-02-03 Thread David Howells
Xin Long wrote: > I saw the state of this patchset is still new, should I repost it? It needs a fix in patch 2 (see my response to that patch). Thanks, David

[PATCH net] rxrpc: Fix clearance of Tx/Rx ring when releasing a call

2021-02-03 Thread David Howells
syzbot+3d1c772efafd3c38d...@syzkaller.appspotmail.com Signed-off-by: David Howells cc: Hillf Danton --- net/rxrpc/call_object.c |2 -- 1 file changed, 2 deletions(-) diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c index c845594b663f..4eb91d958a48 100644 --- a/net/rxrpc/call

Re: [PATCHv4 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP GRO

2021-02-03 Thread David Howells
Xin Long wrote: > BTW, I'm also thinking to use udp_sock_create(), the only problem I can > see is it may not do bind() in rxrpc_open_socket(), is that true? or we > can actually bind to some address when a local address is not supplied? If a local address isn't explicitly bound to the AF_RXRPC

Re: [PATCHv5 net-next 2/2] rxrpc: call udp_tunnel_encap_enable in rxrpc_open_socket

2021-02-03 Thread David Howells
nable() > where it increases both UDP and UDPv6 encap_needed_key and sets > up->encap_enabled. > > v4->v5: > - add the missing '#include ', as David Howells > noticed. > > Acked-and-tested-by: David Howells > Signed-off-by: Xin Long Looks good. David

Re: [PATCHv4 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP GRO

2021-02-03 Thread David Howells
Xin Long wrote: > BTW: do you have any testing for this? If you're using a distro like a recent-ish Fedora or, I think, Debian, you should be able to install a kafs-client package. If that works, start the afs.mount service with systemctl and then look in /afs. You should see directories corre

Re: [PATCHv4 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP GRO

2021-02-04 Thread David Howells
Xin Long wrote: > > If you could arrange for a random port to be assigned in such a case (and > > indicated back to the caller), that would be awesome. Possibly I just don't > > need to actually use bind in this case. > > > The patch is attached (based on this patch): Initial testing seems to s

Re: [PATCHv4 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP GRO

2021-02-05 Thread David Howells
Xin Long wrote: > Subject: [PATCH net-next] rxrpc: use udp tunnel APIs instead of open code in > rxrpc_open_socket > > Signed-off-by: Xin Long You can add "Acked-by: David Howells " if you want. David

[RFC PATCH net] rxrpc: Fix missing dependency on NET_UDP_TUNNEL

2021-02-09 Thread David Howells
eported-by: kernel test robot Suggested-by: Vadim Fedorenko Signed-off-by: David Howells cc: Xin Long cc: a...@dev.mellanox.co.il cc: Jakub Kicinski --- net/rxrpc/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/net/rxrpc/Kconfig b/net/rxrpc/Kconfig index d706bb408365..0885b22e5c0e 10

[PATCH net-next] rxrpc: Fix missing dependency on NET_UDP_TUNNEL

2021-02-09 Thread David Howells
eported-by: kernel test robot Signed-off-by: Vadim Fedorenko Signed-off-by: David Howells Reviewed-by: Xin Long cc: a...@dev.mellanox.co.il cc: Jakub Kicinski --- net/rxrpc/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/net/rxrpc/Kconfig b/net/rxrpc/Kconfig index d706bb408365..08

Re: [PATCH 04/40] proc: introduce proc_create_seq{,_data}

2018-04-30 Thread David Howells
Christoph Hellwig wrote: > + > +struct proc_dir_entry *proc_create_seq_data(const char *name, umode_t mode, > + struct proc_dir_entry *parent, const struct seq_operations *ops, > + void *data) > +{ > ... > +EXPORT_SYMBOL(proc_create_seq_data); Please add documentation com

Re: [PATCH 20/39] afs: simplify procfs code

2018-04-30 Thread David Howells
Christoph Hellwig wrote: > I don't think you should need any of these. seq_file_net or > seq_file_single_net will return you the net_ns based on a struct > seq_file. And even from your write routines you can reach the > seq_file in file->private pretty easily. You've taken away things like sin

Re: simplify procfs code for seq_file instances V2

2018-04-30 Thread David Howells
Note that your kernel hits the: inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. swapper/0/0 [HC1[1]:SC0[0]:HE0:SE1] takes: (ptrval) (fs_reclaim){?.+.}, at: fs_reclaim_acquire+0x12/0x35 {HARDIRQ-ON-W} state was registered at: fs_reclaim_acquire

[PATCH net 5/5] rxrpc: Trace UDP transmission failure

2018-05-10 Thread David Howells
Add a tracepoint to log transmission failure from the UDP transport socket being used by AF_RXRPC. Signed-off-by: David Howells --- include/trace/events/rxrpc.h | 55 ++ net/rxrpc/conn_event.c | 11 ++-- net/rxrpc/local_event.c |3

[PATCH net 4/5] rxrpc: Add a tracepoint to log ICMP/ICMP6 and error messages

2018-05-10 Thread David Howells
Add a tracepoint to log received ICMP/ICMP6 events and other error messages. Signed-off-by: David Howells --- include/trace/events/rxrpc.h | 30 +++ net/rxrpc/peer_event.c | 46 +- 2 files changed, 53 insertions(+), 23

[PATCH net 2/5] rxrpc: Fix error reception on AF_INET6 sockets

2018-05-10 Thread David Howells
ad if the socket is of the AF_INET6 family. Without this, kAFS server and address rotation doesn't work correctly because the algorithm doesn't detect received network errors. Fixes: 75b54cb57ca3 ("rxrpc: Add IPv6 support") Signed-off-by: David Howells --- net/rx

[PATCH net 3/5] rxrpc: Fix the min security level for kernel calls

2018-05-10 Thread David Howells
Fix the kernel call initiation to set the minimum security level for kernel initiated calls (such as from kAFS) from the sockopt value. Fixes: 19ffa01c9c45 ("rxrpc: Use structs to hold connection params and protocol info") Signed-off-by: David Howells --- net/rxrpc/af_rxrpc.c |

[PATCH net 1/5] rxrpc: Fix missing start of call timeout

2018-05-10 Thread David Howells
initely. Fixes: a158bdd3247b ("rxrpc: Fix call timeouts") Reported-by: Marc Dionne Signed-off-by: David Howells --- net/rxrpc/ar-internal.h |1 + net/rxrpc/input.c |2 +- net/rxrpc/output.c | 11 +++ net/rxrpc/sendmsg.c | 10 ++ 4 files changed, 23

[PATCH net 0/5] rxrpc: Fixes

2018-05-10 Thread David Howells
/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes David --- David Howells (5): rxrpc: Fix missing start of call timeout rxrpc: Fix error reception on AF_INET6 sockets rxrpc: Fix the min security level for kernel calls rxrpc: Add a tracepoint to log ICMP/ICMP

Re: [PATCH 20/39] afs: simplify procfs code

2018-04-19 Thread David Howells
Christoph Hellwig wrote: > Use remove_proc_subtree to remove the whole subtree on cleanup, and > unwind the registration loop into individual calls. Switch to use > proc_create_seq where applicable. Note that this is likely going to clash with my patch to net-namespace all of the afs proc files

Re: [PATCH 20/39] afs: simplify procfs code

2018-04-20 Thread David Howells
David Howells wrote: > > Use remove_proc_subtree to remove the whole subtree on cleanup, and > > unwind the registration loop into individual calls. Switch to use > > proc_create_seq where applicable. > > Note that this is likely going to clash with my patch to net-na

  1   2   3   4   5   6   7   8   9   10   >