Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1473422
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released |
| Date | 2016-08-31 14:40 +0200 |
| Message-ID | <sccYa-2pg-23@gated-at.bofh.it> (permalink) |
| References | <sccYa-2pg-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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")
---
net/rxrpc/call_object.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
index 104ee8b1de06..2daec1eaec6f 100644
--- a/net/rxrpc/call_object.c
+++ b/net/rxrpc/call_object.c
@@ -595,6 +595,8 @@ static void rxrpc_mark_call_released(struct rxrpc_call *call)
sched = __rxrpc_abort_call(call, RX_CALL_DEAD, ECONNRESET);
if (!test_and_set_bit(RXRPC_CALL_EV_RELEASE, &call->events))
sched = true;
+ } else {
+ sched = 0;
}
write_unlock(&call->state_lock);
if (sched)
--
2.9.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-08-31 14:40 +0200
[PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann <arnd@arndb.de> - 2016-08-31 14:40 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-08-31 19:40 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann <arnd@arndb.de> - 2016-08-31 21:50 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-08-31 22:30 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann <arnd@arndb.de> - 2016-08-31 22:40 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-08-31 23:10 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-08-31 22:30 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann <arnd@arndb.de> - 2016-08-31 22:40 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Miller <davem@davemloft.net> - 2016-08-31 23:00 +0200
Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Trond Myklebust <trondmy@primarydata.com> - 2016-08-31 15:20 +0200
Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-08-31 15:40 +0200
Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Trond Myklebust <trondmy@primarydata.com> - 2016-08-31 17:10 +0200
Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-08-31 18:00 +0200
csiph-web