lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aecd4008-5795-0392-3e81-4bf5726cbbc0@vyatta.att-mail.com>
Date:   Mon, 22 Apr 2019 18:24:23 +0100
From:   Mike Manning <mmanning@...tta.att-mail.com>
To:     Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
        Ido Schimmel <idosch@...lanox.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "bridge@...ts.linux-foundation.org" 
        <bridge@...ts.linux-foundation.org>
Cc:     "davem@...emloft.net" <davem@...emloft.net>,
        "roopa@...ulusnetworks.com" <roopa@...ulusnetworks.com>,
        mlxsw <mlxsw@...lanox.com>
Subject: Re: [PATCH net-next] bridge: Fix possible use-after-free when
 deleting bridge port

On 22/04/2019 10:44, Nikolay Aleksandrov wrote:
> On 22/04/2019 12:33, Ido Schimmel wrote:
>> When a bridge port is being deleted, do not dereference it later in
>> br_vlan_port_event() as it can result in a use-after-free [1] if the RCU
>> callback was executed before invoking the function.
>>
> [snip]
>> Fixes: 9c0ec2e7182a ("bridge: support binding vlan dev link state to vlan member bridge ports")
>> Signed-off-by: Ido Schimmel <idosch@...lanox.com>
>> Cc: Mike Manning <mmanning@...tta.att-mail.com>
>> ---
>>  net/bridge/br.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/bridge/br.c b/net/bridge/br.c
>> index e69fc87a13e0..3c8e4b38f054 100644
>> --- a/net/bridge/br.c
>> +++ b/net/bridge/br.c
>> @@ -129,7 +129,8 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
>>  		break;
>>  	}
>>  
>> -	br_vlan_port_event(p, event);
>> +	if (event != NETDEV_UNREGISTER)
>> +		br_vlan_port_event(p, event);
>>  
>>  	/* Events that may cause spanning tree to refresh */
>>  	if (!notified && (event == NETDEV_CHANGEADDR || event == NETDEV_UP ||
>>
> Right, the br_del_if is just above. :)
>
> Acked-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>

Thanks for the fix, to avoid this I should have placed the check for the
br opt under the case handling in br_vlan_port_event().

Acked-by: Mike Manning <mmanning@...tta.att-mail.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ