From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.69 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795963167; b=UvZNd8evcbsBUwPLPClbK6sUjANiRKbrR75GeQh6IngFyfUnlhYXZ8g56Id+FiSjndhD 9qQLarTpgLR/6TJVt4h8lXv/aXaWCfc+fY0vH03WjM/Tz/xAWaXrnQHoFzC76NruI9pKj I1TgXtuVNOwJXl0GUJCrJaBRrTyVtdpWzFqzq9glKZ4IpEuuxK8VddrVwKnGr+tPK6QRP Uk0Nuy1qQIxoij0BgEUd6YLmNceoWlBOCKX04Dlwh06LuRjXZoJrzSKtsEssSCz/JQad5 6MylNK1Y5tMa5uasNS+wNh+2MEN915bxvZx7wFiFn6X1nvlCV1IUUFuq1j4qh+QLmEg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795963167; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:Message-ID:Subject:From:To:Cc:Content-Type; bh=uAHokaPBJpNz8vQGumlObz1OsgSGR94s1DoHIXOiE8o=; b=TDITdQ+9GcnVqX689r2aLZloFV32pz2ygVnnYhsUfjg4q6qQI9DjEmpIsOBXwWRcMY6G QC6EkcDQO048jXpBiNikMqaa4kNY+mj+TZJUX4EbIBI5U7YzHI5TaVYR0e9QFTdNXDRAi qlT2hfA5IWMONMigPy4oGRYtnki8KsJQ1Igtx5vXd9bIytK2XR/KaWTaTe8wfWxl8+5C+ xwypkA7yku1duMopryjtzkhE+5tMFC1Zj4ttjT5rDH9FrgjFomsmTy49+1JXZSzAlkgRH IShLd0ahKSiaYJJsKlXcLIM/3A/70TvjoIIREr6JCXjmTaAI6t1EOer7MaK46Gy49GQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--willemb.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=TtsgZnti; arc=none smtp.remote-ip=209.85.219.69 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4C61606A325 for ; Sun, 29 Nov 2026 14:39:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D4C61606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--willemb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=TtsgZnti Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-920f97bcad4so158970556d6.0 for ; Sun, 29 Nov 2026 06:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1795963166; x=1796567966; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uAHokaPBJpNz8vQGumlObz1OsgSGR94s1DoHIXOiE8o=; b=TtsgZnti3GNMvwZD9qqnsz079hVZOe9+8vKrnVnsJJeXU2DPOaaqGtPemX3rL4cNjV LDRXWjPMCLxpsKDwDreF5ci/TJ7MNrqobhFFAUVH8jBH7YsLlx4Y9yPR20EDNnQhVvHk BQIEvZtrFhufaelLDie4mLKSmNopx13m/U7VJyaG+mwjjKPSGR4ouEEQnqgggDsAJ1Us 31zKUWMlTX9Ln1ToKR9znyr4WIQUcP+F05e5aoGpw1zvrsdGw9eZkjrIYzobQ5lsn+K+ 9jr3H9LoWhVeREuFdPPGK22rgzBa8NOTIRzDJdpvgQO295061zG4NLmYzoqpchq+v0r+ WoAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795963166; x=1796567966; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uAHokaPBJpNz8vQGumlObz1OsgSGR94s1DoHIXOiE8o=; b=mXoLsKbuOqw4BmUMhqgBHqJMvC/5tLfm+lpyyhr+zCzrUGW2OETLPzFQ0iqiErZK5s UVG2GrJbmNGWFYx2ErfU5/PTDlizGBU0fdXk7SVQq1kXJkpDfWdWPRiDxofoUAcrXZ0G d+goT1UoRhQx7MwQPJYroS2ketxZ53425qMnUFIo0qPtdWAF6fxZ7JmT9u9dyvPV+y33 q4yh8E/o7OIeCWR5/6hq1gOHdwURsEExnQ5o1lmWqidpC7lKhlSmYFXbamCZ2ge7oc0W 8me+XTUBAwThPB7MZcCpVDd58HMlJvdt9rYsAsjsr+b+O2ulwpyS+MJPnfGe9PVJF9by zAYA== X-Forwarded-Encrypted: i=1; AL+hErFVvebL9UQcEldcAzCKOHHj/tdkx/COAZp1qupS1uCZaUhPF0uyuR2/GNhBfksM1K4fa6D7rmE=@vger.kernel.org X-Gm-Message-State: APuU4Z87oeT7PB3moVzjEJ0/bsOXHdY+fT/uK7qfbKAhnoFdVv3rtbQg G8ua2496bDoXaU8pVK4RquCiSkXodcm2EoxIvaHIGfca7mxsaBN9YqjE3OZ+JbIVhKxIz+3++IS jGii45aPELw== X-Received: from qvbcp20.prod.google.com ([2002:ad4:4af4:0:b0:91e:fe23:63bf]) (user=willemb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6214:c42:b0:91e:f3ad:b744 with SMTP id 6a1803df08f44-92134b2e713mr618124456d6.32.1795963165241; Sun, 29 Nov 2026 06:39:25 -0800 (PST) Date: Sun, 29 Nov 2026 09:39:24 -0500 In-Reply-To: <20261120174341.35873-1-juanagusnicco@gmail.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261120174341.35873-1-juanagusnicco@gmail.com> Message-ID: Subject: Re: [PATCH net 0/4] udp: Fix bind conflict check bypasses From: willemb@google.com To: Juan Agustin Niccolini , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , Kuniyuki Iwashima , Willem de Bruijn , Willem de Bruijn , Eric Garver , Shuah Khan , linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes Juan Agustin Niccolini wrote: > An unprivileged user can get a UDP socket bound to an address and port > that another user's socket holds, in a state bind() would have refused, > and receive that socket's datagrams. This series fixes three bugs that > allow that and adds a selftest. > These are sibling vulnerabilities of the TCP one fixed by my > commit f675070191f2 ("tcp: Fix the SO_REUSEPORT bind cache admitting a > conflicting socket"). The one in patch 1 has the same kind of cause: a > SO_REUSEPORT shortcut that lets one matching socket stand for every > socket on the port. The other two predate git. All were discovered > during an LLM-based audit. > Juan Agustin Niccolini (4): > udp: Fix bind conflict check stopping at the first reuseport socket > udp: Keep the bound device on disconnect unless connect() set it > udp: Ignore a connect()-set device in the bind conflict check > selftests: net: Add UDP bind conflict tests No need to fix the pre-existing issues (connect() address narrowing, L2TP/IPv6, VRF conflict checks, or the residual ABA window), indeed. But please respin v2 onto net for the following: 1. Drop Patch 1 and rebase Patches 2-4 onto net: commit d77700039d09 ("udp: only quit inuse scan early on identical SO_REUSEPORT sockets") already landed in net with the same fix. Please keep the reuseport_* selftests in Patch 4 (with an updated commit message). 2. Patch 2: fix the new unlocked sk->sk_userlocks RMW race in __udp_disconnect() for ping/raw/L2TP that Sashiko flagged (which is a regression since __udp_disconnect() previously never wrote sk_userlocks). 3. Patch 2: address Sashiko's note on the VRF disconnect behavior change (at minimum move it from the "---" notes into the commit message, or preserve/restore the pre-connect ifindex). 4. Patch 3 (while rebasing): drop the redundant udp_bound_dev_if() calls. -- details - For (3), see also the parallel patch saving the pre-connect ifindex: https://lore.kernel.org/r/20261124180603.72523-1-dmnk@google.com - For (4), sk is being bound under lock_sock(sk), so read sk->sk_bound_dev_if directly, and load udp_bound_dev_if(sk2) once per candidate and pass it to udp_sk_reuseport_match(). -- pw-bot: cr