Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1476026

[PATCH net-next 1/9] rxrpc: fix undefined behavior in rxrpc_mark_call_released

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 1/9] rxrpc: fix undefined behavior in rxrpc_mark_call_released
Date 2016-09-04 23:10 +0200
Message-ID <sdMPU-2JV-9@gated-at.bofh.it> (permalink)
References <sdMPU-2JV-11@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


From: Arnd Bergmann <arnd@arndb.de>

gcc -Wmaybe-initialized correctly points out a newly introduced bug
through which we can end up calling rxrpc_queue_call() for a dead
connection:

net/rxrpc/call_object.c: In function 'rxrpc_mark_call_released':
net/rxrpc/call_object.c:600:5: error: 'sched' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This sets the 'sched' variable to zero to restore the previous
behavior.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: f5c17aaeb2ae ("rxrpc: Calls should only have one terminal state")
Signed-off-by: David Howells <dhowells@redhat.com>
---

 net/rxrpc/call_object.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
index 516d8ea82f02..57e00fc9cff2 100644
--- a/net/rxrpc/call_object.c
+++ b/net/rxrpc/call_object.c
@@ -586,7 +586,7 @@ static void rxrpc_dead_call_expired(unsigned long _call)
  */
 static void rxrpc_mark_call_released(struct rxrpc_call *call)
 {
-	bool sched;
+	bool sched = false;
 
 	rxrpc_see_call(call);
 	write_lock(&call->state_lock);

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH net-next 1/9] rxrpc: fix undefined behavior in  rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-09-04 23:10 +0200

csiph-web