[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHXsK3DzBTsO00lb@horizon.localdomain>
Date: Tue, 13 Apr 2021 16:08:27 -0300
From: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To: Or Cohen <orcohen@...oaltonetworks.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
vyasevich@...il.com, nhorman@...driver.com, davem@...emloft.net,
kuba@...nel.org, linux-sctp@...r.kernel.org, lucien.xin@...il.com,
nmarkus@...oaltonetworks.com
Subject: Re: [PATCH v2] net/sctp: fix race condition in sctp_destroy_sock
On Tue, Apr 13, 2021 at 09:10:31PM +0300, Or Cohen wrote:
> If sctp_destroy_sock is called without sock_net(sk)->sctp.addr_wq_lock
> held and sp->do_auto_asconf is true, then an element is removed
> from the auto_asconf_splist without any proper locking.
>
> This can happen in the following functions:
> 1. In sctp_accept, if sctp_sock_migrate fails.
> 2. In inet_create or inet6_create, if there is a bpf program
> attached to BPF_CGROUP_INET_SOCK_CREATE which denies
> creation of the sctp socket.
>
> The bug is fixed by acquiring addr_wq_lock in sctp_destroy_sock
> instead of sctp_close.
>
> This addresses CVE-2021-23133.
>
> Reported-by: Or Cohen <orcohen@...oaltonetworks.com>
> Reviewed-by: Xin Long <lucien.xin@...il.com>
> Fixes: 610236587600 ("bpf: Add new cgroup attach type to enable sock modifications")
> Signed-off-by: Or Cohen <orcohen@...oaltonetworks.com>
Thanks folks.
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Powered by blists - more mailing lists