linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] rxrpc: Fix a warning and a leak [ver #2]
@ 2020-05-22 23:42 David Howells
  2020-05-22 23:42 ` [PATCH net 1/2] rxrpc: Fix a warning " David Howells
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Howells @ 2020-05-22 23:42 UTC (permalink / raw)
  To: netdev; +Cc: Qiushi Wu, Markus Elfring, dhowells, linux-afs, linux-kernel


Here are a couple of fixes for AF_RXRPC:

 (1) Fix an uninitialised variable warning.

 (2) Fix a leak of the ticket on error in rxkad.

The patches are tagged here:

	git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
	rxrpc-fixes-20200523-v2

and can also be found on the following branch:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes

David
---
Qiushi Wu (1):
      rxrpc: Fix a memory leak in rxkad_verify_response()


 fs/afs/fs_probe.c | 2 +-
 net/rxrpc/rxkad.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] rxrpc: Fix a warning [ver #2]
  2020-05-22 23:42 [PATCH net 0/2] rxrpc: Fix a warning and a leak [ver #2] David Howells
@ 2020-05-22 23:42 ` David Howells
  2020-05-22 23:42 ` [PATCH net 2/2] rxrpc: Fix a memory leak in rxkad_verify_response() " David Howells
  2020-05-22 23:44 ` [PATCH net 0/2] rxrpc: Fix a warning and a leak " David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2020-05-22 23:42 UTC (permalink / raw)
  To: netdev; +Cc: dhowells, linux-afs, linux-kernel

Fix a warning due to an uninitialised variable.

le included from ../fs/afs/fs_probe.c:11:
../fs/afs/fs_probe.c: In function 'afs_fileserver_probe_result':
../fs/afs/internal.h:1453:2: warning: 'rtt_us' may be used uninitialized in this function [-Wmaybe-uninitialized]
 1453 |  printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__)
      |  ^~~~~~
../fs/afs/fs_probe.c:35:15: note: 'rtt_us' was declared here

Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/afs/fs_probe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/afs/fs_probe.c b/fs/afs/fs_probe.c
index 237352d3cb53..37d1bba57b00 100644
--- a/fs/afs/fs_probe.c
+++ b/fs/afs/fs_probe.c
@@ -32,7 +32,7 @@ void afs_fileserver_probe_result(struct afs_call *call)
 	struct afs_server *server = call->server;
 	unsigned int server_index = call->server_index;
 	unsigned int index = call->addr_ix;
-	unsigned int rtt_us;
+	unsigned int rtt_us = 0;
 	bool have_result = false;
 	int ret = call->error;
 



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] rxrpc: Fix a memory leak in rxkad_verify_response() [ver #2]
  2020-05-22 23:42 [PATCH net 0/2] rxrpc: Fix a warning and a leak [ver #2] David Howells
  2020-05-22 23:42 ` [PATCH net 1/2] rxrpc: Fix a warning " David Howells
@ 2020-05-22 23:42 ` David Howells
  2020-05-22 23:44 ` [PATCH net 0/2] rxrpc: Fix a warning and a leak " David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2020-05-22 23:42 UTC (permalink / raw)
  To: netdev; +Cc: Qiushi Wu, Markus Elfring, dhowells, linux-afs, linux-kernel

From: Qiushi Wu <wu000273@umn.edu>

A ticket was not released after a call of the function
"rxkad_decrypt_ticket" failed. Thus replace the jump target
"temporary_error_free_resp" by "temporary_error_free_ticket".

Fixes: 8c2f826dc3631 ("rxrpc: Don't put crypto buffers on the stack")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Markus Elfring <Markus.Elfring@web.de>
---

 net/rxrpc/rxkad.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 098f1f9ec53b..52a24d4ef5d8 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -1148,7 +1148,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn,
 	ret = rxkad_decrypt_ticket(conn, skb, ticket, ticket_len, &session_key,
 				   &expiry, _abort_code);
 	if (ret < 0)
-		goto temporary_error_free_resp;
+		goto temporary_error_free_ticket;
 
 	/* use the session key from inside the ticket to decrypt the
 	 * response */
@@ -1230,7 +1230,6 @@ static int rxkad_verify_response(struct rxrpc_connection *conn,
 
 temporary_error_free_ticket:
 	kfree(ticket);
-temporary_error_free_resp:
 	kfree(response);
 temporary_error:
 	/* Ignore the response packet if we got a temporary error such as



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] rxrpc: Fix a warning and a leak [ver #2]
  2020-05-22 23:42 [PATCH net 0/2] rxrpc: Fix a warning and a leak [ver #2] David Howells
  2020-05-22 23:42 ` [PATCH net 1/2] rxrpc: Fix a warning " David Howells
  2020-05-22 23:42 ` [PATCH net 2/2] rxrpc: Fix a memory leak in rxkad_verify_response() " David Howells
@ 2020-05-22 23:44 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-05-22 23:44 UTC (permalink / raw)
  To: dhowells; +Cc: netdev, wu000273, Markus.Elfring, linux-afs, linux-kernel

From: David Howells <dhowells@redhat.com>
Date: Sat, 23 May 2020 00:42:32 +0100

> 
> Here are a couple of fixes for AF_RXRPC:
> 
>  (1) Fix an uninitialised variable warning.
> 
>  (2) Fix a leak of the ticket on error in rxkad.
> 
> The patches are tagged here:
> 
> 	git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
> 	rxrpc-fixes-20200523-v2

Pulled, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-22 23:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 23:42 [PATCH net 0/2] rxrpc: Fix a warning and a leak [ver #2] David Howells
2020-05-22 23:42 ` [PATCH net 1/2] rxrpc: Fix a warning " David Howells
2020-05-22 23:42 ` [PATCH net 2/2] rxrpc: Fix a memory leak in rxkad_verify_response() " David Howells
2020-05-22 23:44 ` [PATCH net 0/2] rxrpc: Fix a warning and a leak " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).