[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200207.112154.1238920306232628596.davem@davemloft.net>
Date: Fri, 07 Feb 2020 11:21:54 +0100 (CET)
From: David Miller <davem@...emloft.net>
To: dhowells@...hat.com
Cc: netdev@...r.kernel.org, linux-afs@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] rxrpc: Fix service call disconnection
From: David Howells <dhowells@...hat.com>
Date: Thu, 06 Feb 2020 13:55:01 +0000
> The recent patch that substituted a flag on an rxrpc_call for the
> connection pointer being NULL as an indication that a call was disconnected
> puts the set_bit in the wrong place for service calls. This is only a
> problem if a call is implicitly terminated by a new call coming in on the
> same connection channel instead of a terminating ACK packet.
>
> In such a case, rxrpc_input_implicit_end_call() calls
> __rxrpc_disconnect_call(), which is now (incorrectly) setting the
> disconnection bit, meaning that when rxrpc_release_call() is later called,
> it doesn't call rxrpc_disconnect_call() and so the call isn't removed from
> the peer's error distribution list and the list gets corrupted.
>
> KASAN finds the issue as an access after release on a call, but the
> position at which it occurs is confusing as it appears to be related to a
> different call (the call site is where the latter call is being removed
> from the error distribution list and either the next or pprev pointer
> points to a previously released call).
>
> Fix this by moving the setting of the flag from __rxrpc_disconnect_call()
> to rxrpc_disconnect_call() in the same place that the connection pointer
> was being cleared.
>
> Fixes: 5273a191dca6 ("rxrpc: Fix NULL pointer deref due to call->conn being cleared on disconnect")
> Signed-off-by: David Howells <dhowells@...hat.com>
Applied and queued up for -stable.
Powered by blists - more mailing lists