From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.198 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795935630; b=1GpkeCUH0HYECi4X7w+2b/gmZk1bS7MKao8+81oH3EGfA1KJZet1/Z1tMaWQa3c0DMZY hxZcsNasN05nts+862/SqJ++AgvQJbOLGCxlPXnnjGRg1LT+XWOvzN77Rsb0+6Ae6MAdn YrEN88K3zXXD+iXo4t3yU9viWM89q73KAd+mxNnxmjL3NNVq81Ilrby6lobk0fZKU/gSs BjwozY7/+kBg1fNN/YMnCgFPApkwGBxux9yVyNA1HCDSzyI3tjbLLLaXa7U6K8E31IQgd 16yebQM9aDqdrQ3Pp32d9Tnh5CGY62YvOMLIDDj1fC/G13e/mW3dRRhfqL8yf1cwnWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795935630; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Received:Date:In-Reply-To:Mime-Version: References:Message-ID:Subject:From:To:Cc:Content-Type; bh=RrFuAYeB9WofEWxceKMdBs7dz4/u+s5lccIh387z7Ug=; b=Amuv+J6V1irqV3bh93IDDfHDD3lhNFENI2QS7Kckb7AK1MQD8rRIhFj6jAoIshI+xGps n+AQnAoS3HpHpgmNe7Kj1ybyX3UW/QjdTuvc2QIeICoFUdVxlQVCJZr7HHiX7JyUbV9RE uuigw4GFB98fiOG2t4KHrcggaudpBbdadhWF3wg8fCp4VZm/YvNm3WOgyET7/UzWyp0nO IxYmM6EwTzT+Qv5ImNYYFQO7zDPS10TvF/s/qcyjbUtY1EA0HyOX2321o3XzBJuSwCqah N0RRuD0Ugb+urtNDQdJYFTOR2EQWeqZzaaJmqlyWmC6rlKsoD22eberAM9cyh3uv0KQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--kuniyu.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=YyObgn2y; arc=none smtp.remote-ip=209.85.210.198 Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (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 A33F1606A323 for ; Sun, 29 Nov 2026 07:00:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A33F1606A323 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--kuniyu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=YyObgn2y Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-8bfe396acb4so6010391b3a.1 for ; Sat, 28 Nov 2026 23:00:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1795935629; x=1796540429; 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=RrFuAYeB9WofEWxceKMdBs7dz4/u+s5lccIh387z7Ug=; b=YyObgn2yVUvptbjFjBO6dRFcEx3523mvZgk0VJb/UKM8ziHhPBS6KlL9aoQp440OTD O5MAp8ZMQXlQkl0lwMm/XKWzdGV5JI/OBz6iS2drl734DmbDMduz3+KEfwYaT0DIBq5H F6QJg2yZ4ydjU0Jb88Jh1+0ARMAOsNS5t4DflO25ycUfphqiVCtw9HH5uUdRSukaWMCN n3KOi+LI3xlfmp3IEKXCrPuxtxiQ/ZY98i3erqEsGu0f9spKPgmCWlz/0Wt96ra1n139 UumrhccOBtsdTlDgRSfm2EB2yhql4UfUjoJwTwrPzhRUBhxYGn0MudWoHGO+VizO5k/z 5CIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795935629; x=1796540429; 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=RrFuAYeB9WofEWxceKMdBs7dz4/u+s5lccIh387z7Ug=; b=QlwxeueJp8uKM0sW3CkJVBiULQwi/1UgGWcHMVbPzn4en5/Gri2+HO2GoX64hSBuGC bHRp9nj7sI3MpGN0MkaqATL2rXyFBMKsxE3vHRht+w5CEFLITCNdwgGrAM5NHJVKZpG1 xgmiNQsMVkCgR2dlwz0BEmjHoVJ5YEP8ItWQiogmMZW5pipJo3xwLOMqHgmmJ5sx4NDH yASRoe2DscJmAb3EoqfnchTJ0UG0e5EpKuBaRSP4dzZVJqt6rewcbee3XxZYd0DirzGo ULKQ0Lietf4l3P51TYHK4VnSU0h9ek2gx6fTMaSqcxLus+BS1Ipej2wAebE8pPRNyYKe JoEg== X-Gm-Message-State: APuU4Z+wzxdgjO/a/3hBvcq/4atxkKYjG4OqTCVHNf1uz2WEgl/qGore D/p3+lz93DXnHfdhZbGtt2RkLptOmDicFPZ7Rubz9RF1WchnrTQgaZ0prta7YHS/b6afCSvyvnp pub2bRg== X-Received: from pfbgk9.prod.google.com ([2002:a05:6a00:8489:b0:88e:f55:207e]) (user=kuniyu job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4b51:b0:8a0:3ed7:93a0 with SMTP id d2e1a72fcca58-8c87d519aa0mr29619911b3a.48.1795935628310; Sat, 28 Nov 2026 23:00:28 -0800 (PST) Date: Sun, 29 Nov 2026 07:00:27 +0000 In-Reply-To: <20261127-unix-atmark2-v1-1-d164028cdae7@certik.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: <20261127-unix-atmark2-v1-1-d164028cdae7@certik.com> Message-ID: Subject: Re: [PATCH net] af_unix: return 0 for SIOCATMARK on listeners From: Kuniyuki Iwashima To: Dickson Wu Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Willem de Bruijn Content-Type: text/plain; charset="us-ascii" On Fri, 27 Nov 2026 16:04:41 +0000, Dickson Wu wrote: > AF_UNIX listeners cannot receive out-of-band data, but SIOCATMARK > currently peeks at sk_receive_queue. That queue contains connection > requests, and unix_accept() can dequeue and free its head under > sk_receive_queue.lock without taking u->iolock. As a result, SIOCATMARK > can read the freed skb. > > Take u->iolock and the state lock in stream receive order. Return 0 > for TCP_LISTEN, and keep both locks over the receive-queue inspection. > This prevents a concurrent listen() transition between the state check > and the queue access. > > Fixes: e400cfa38bb0 ("af_unix: Fix wrong ioctl(SIOCATMARK) when consumed OOB skb is at the head.") > Signed-off-by: Dickson Wu > --- > This is the listener case left after d119775f2bad ("af_unix: Reject > SIOCATMARK on non-stream sockets"). The earlier queue-lock proposal > for the same lifetime problem was redirected toward rejecting > unsupported sockets: > https://lore.kernel.org/netdev/f6cbbc8da90e95584847b5ceb60aae830d1631c2.1775731983.git.wangjiexun2025@gmail.com/ > > net-next 387f48167305 ("af_unix: Remove MSG_OOB.") removes SIOCATMARK > along with AF_UNIX OOB, so this is only for net and stable. not worth a conflict. pw-bot: rejected