From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.70 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795963167; b=id8i3BmXlIekgY8pE8dt2KJW3RPz44+5gtF1Av5y/B65E3AgJq/jT7pb8m+a5kFD0/Cp gCFdb1JgX0Nxu8U0DTgErpTbPOGaDhaPdfGedIWgHJpZJ8btQ4sn3sHeiL/giT8FOL6pp 51CBywlZ261NrYaYruC0yLZZcTLL/yTw+qUK7KMbDwIacHuaonR+9SKjLYivbAp2ty8OX KvNQ1PAocw3yy9tpXzb1C5bjGIGEzM3T145h0Dah0FBgv2KqBQzkoICiF0PXVtXaCpIxE Ol8TgVKwGcOrEyuwxP7RIZKlIq6FbsWIfAuH6EyQyNaa0SHR68nh2Gpnzbov+3/GfWQ== 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=btQMJ6d+m+em/hTn7nrWxmstzVgLyZv+tBHE2jf6qlP+lPSOs7xM518Q56ONEggMbDCA NmeQQzyyzVhlaFwlQWfOIQ6JyDFA5RphFAdKiRP0uY7ayJHa4IFeqgz7ZBMD3VG6d3EKu M07jnZI8rlt9WzQ4khYeRSImmgno4qiXtd8wTdW09VEybVG7fWBAx5ekjUrRu8zajqFPv c5+ZTPhfWPNSFnrrsknyZsFXfchicN5Yi9VMKX09CCP0FFq2+dZohKpSF9So9MpmiC7Ov VaMRVTrzOfaCB/JPWoPJODc/Sjs6Ake1qrBpK+a2AAHwoikx4xfZvQ4mqLL5/ncWjgw== 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=KD7YRsWU; arc=none smtp.remote-ip=209.85.219.70 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (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 AA3BA606A323 for ; Sun, 29 Nov 2026 14:39:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AA3BA606A323 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=KD7YRsWU Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-92126ecb4b8so154454106d6.3 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=1795963165; x=1796567965; 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=KD7YRsWUd3GEwEJuAUrNz7xVnJjhwwvfDIEAOmNPl0xqlsOQ4QC3t+PBEji0NzxdNl IMEB5B2tKZoR0HEKBV872BwjbatWzJgs+SId2foOE3YTSYeejBzcSRU1fMPzuRataVU+ iO6fritTUCvkTB9VwHJizIoBo7RRcVeATSKADKvnwMkjehchgibSd6BQgCMvCklQet6V yuiLVQw0NKe4LqWi3ouEJYa3cV800cf4HrEINNvF4yHjl0OQ79xHG+YmKGYxipJVrQLv 96CiX+EVimNun/4/rfoYC7a0vk6Noba+CwWgNJhTq1UlsR0atPr98zYARU0wSc+NdPXU T5Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795963165; x=1796567965; 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=w/o1eDXfQv6Q1iTz7iZk4sKATG4yvw4YGlKCLVvzxTTbAbgPfM5Ubb/Z3JApcT9wt6 MPhA5QV9+GghfcYk+fvdYmKqN5cYm11jLo2JhrYU17fk9Z6A1MRZZ26ihmDmuKNFWNM2 T6GUVQQQI0eGtfvJNpRPkBaWAMJo0v6Vcm51bErN5aX4N3XICKrn+M8HkIEEJN+jL1ZZ JSaFLreTBiYqErM1NjGTBoCX779xtjdCEZqjM8G3S8x3bp5XdKdj8okJGjUmy26kXIZo 11upncwLHuEdCkV38/DWiF/99b5cJ4EYTyi2I7IqcS8eCqqpYloSPq8aCxfWbwRqx8Y3 qgcg== X-Forwarded-Encrypted: i=1; AL+hErExJNgzHDP7aiPStCk4adE31zXD9Zn01Y8AL64j0DADYPkCs0DvwkRbbfYOd/qGeDE2UGBisapCCf0lifU=@vger.kernel.org X-Gm-Message-State: APuU4Z9M62Y/4+tSxPP7KcR50Ht5AvdIwpA3CvgPnFssOoNIlhRUh8Oc 05AoqG+rqXjY8DFH0dOTyR+r3tyZbRujq8k2C+eX+1NLe+xRw8febuhbu6sguHgEzMyCpIf+Q2b LEbkGySftsw== 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: linux-kernel@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