linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][net-next] rxrpc: fix uninitialized return value in variable err
@ 2019-08-09 17:02 Colin King
  2019-08-12  4:22 ` David Miller
  2019-08-12 12:05 ` David Howells
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-08-09 17:02 UTC (permalink / raw)
  To: David Howells, David S . Miller, linux-afs, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

An earlier commit removed the setting of err to -ENOMEM so currently
the skb_shinfo(skb)->nr_frags > 16 check returns with an uninitialized
bogus return code.  Fix this by setting err to -ENOMEM to restore
the original behaviour.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: b214b2d8f277 ("rxrpc: Don't use skb_cow_data() in rxkad")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/rxrpc/rxkad.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 8b4cddd8b673..c810a7c43b0f 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -248,8 +248,10 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
 	crypto_skcipher_encrypt(req);
 
 	/* we want to encrypt the skbuff in-place */
-	if (skb_shinfo(skb)->nr_frags > 16)
+	if (skb_shinfo(skb)->nr_frags > 16) {
+		err = -ENOMEM;
 		goto out;
+	}
 
 	len = data_size + call->conn->size_align - 1;
 	len &= ~(call->conn->size_align - 1);
-- 
2.20.1


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

* Re: [PATCH][net-next] rxrpc: fix uninitialized return value in variable err
  2019-08-09 17:02 [PATCH][net-next] rxrpc: fix uninitialized return value in variable err Colin King
@ 2019-08-12  4:22 ` David Miller
  2019-08-12 12:05 ` David Howells
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-08-12  4:22 UTC (permalink / raw)
  To: colin.king; +Cc: dhowells, linux-afs, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Fri,  9 Aug 2019 18:02:59 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> An earlier commit removed the setting of err to -ENOMEM so currently
> the skb_shinfo(skb)->nr_frags > 16 check returns with an uninitialized
> bogus return code.  Fix this by setting err to -ENOMEM to restore
> the original behaviour.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: b214b2d8f277 ("rxrpc: Don't use skb_cow_data() in rxkad")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

David, I assume you will pick this up.

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

* Re: [PATCH][net-next] rxrpc: fix uninitialized return value in variable err
  2019-08-09 17:02 [PATCH][net-next] rxrpc: fix uninitialized return value in variable err Colin King
  2019-08-12  4:22 ` David Miller
@ 2019-08-12 12:05 ` David Howells
  1 sibling, 0 replies; 3+ messages in thread
From: David Howells @ 2019-08-12 12:05 UTC (permalink / raw)
  To: Colin King
  Cc: dhowells, David S . Miller, linux-afs, netdev, kernel-janitors,
	linux-kernel

Colin King <colin.king@canonical.com> wrote:

> Fixes: b214b2d8f277 ("rxrpc: Don't use skb_cow_data() in rxkad")

This isn't in net or net-next and has been superseded in any case.

You can find it still in my afs-next branch, but the replacement in
rxrpc-fixes is fixed differently.

David

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

end of thread, other threads:[~2019-08-12 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 17:02 [PATCH][net-next] rxrpc: fix uninitialized return value in variable err Colin King
2019-08-12  4:22 ` David Miller
2019-08-12 12:05 ` David Howells

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).