diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2016-06-26 14:55:24 -0700 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2016-07-06 10:43:05 +0100 |
commit | a263629da519b2064588377416e067727e2cbdf9 (patch) | |
tree | 13438d940f9a8c3aa4824955d2242813f95b4900 /net/rxrpc/insecure.c | |
parent | 689f4c646d6a8f0730eec11e06e5909de0b5d5d2 (diff) | |
download | lwn-a263629da519b2064588377416e067727e2cbdf9.tar.gz lwn-a263629da519b2064588377416e067727e2cbdf9.zip |
rxrpc: Avoid using stack memory in SG lists in rxkad
rxkad uses stack memory in SG lists which would not work if stacks were
allocated from vmalloc memory. In fact, in most cases this isn't even
necessary as the stack memory ends up getting copied over to kmalloc
memory.
This patch eliminates all the unnecessary stack memory uses by supplying
the final destination directly to the crypto API. In two instances where a
temporary buffer is actually needed we also switch use a scratch area in
the rxrpc_call struct (only one DATA packet will be being secured or
verified at a time).
Finally there is no need to split a split-page buffer into two SG entries
so code dealing with that has been removed.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/insecure.c')
-rw-r--r-- | net/rxrpc/insecure.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/rxrpc/insecure.c b/net/rxrpc/insecure.c index e571403613c1..c21ad213b337 100644 --- a/net/rxrpc/insecure.c +++ b/net/rxrpc/insecure.c @@ -17,11 +17,12 @@ static int none_init_connection_security(struct rxrpc_connection *conn) return 0; } -static void none_prime_packet_security(struct rxrpc_connection *conn) +static int none_prime_packet_security(struct rxrpc_connection *conn) { + return 0; } -static int none_secure_packet(const struct rxrpc_call *call, +static int none_secure_packet(struct rxrpc_call *call, struct sk_buff *skb, size_t data_size, void *sechdr) @@ -29,7 +30,7 @@ static int none_secure_packet(const struct rxrpc_call *call, return 0; } -static int none_verify_packet(const struct rxrpc_call *call, +static int none_verify_packet(struct rxrpc_call *call, struct sk_buff *skb, u32 *_abort_code) { |