g>
Delivered-To: hi@josie.lol
Received: from witcher.mxrouting.net
	by witcher.mxrouting.net with LMTP
	id qIzELlzwnWkm6DIAYBR5ng
	(envelope-from <io-uring+bounces-12404-hi=josie.lol@vger.kernel.org>)
	for <hi@josie.lol>; Tue, 24 Feb 2026 18:39:24 +0000
Return-path: <io-uring+bounces-12404-hi=josie.lol@vger.kernel.org>
Envelope-to: hi@josie.lol
Delivery-date: Tue, 24 Feb 2026 18:39:24 +0000
Received: from sin.lore.kernel.org ([104.64.211.4])
	by witcher.mxrouting.net with esmtps  (TLS1.3) tls TLS_AES_256_GCM_SHA384
	(Exim 4.98)
	(envelope-from <io-uring+bounces-12404-hi=josie.lol@vger.kernel.org>)
	id 1vuxJb-0000000EGWn-33aQ
	for hi@josie.lol;
	Tue, 24 Feb 2026 18:39:24 +0000
Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sin.lore.kernel.org (Postfix) with ESMTP id 3220F3008CB3
	for <hi@josie.lol>; Tue, 24 Feb 2026 18:39:19 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D25563A7F7A;
	Tue, 24 Feb 2026 18:39:16 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="eIG1meQc"
X-Original-To: io-uring@vger.kernel.org
Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC2E133AD9C
	for <io-uring@vger.kernel.org>; Tue, 24 Feb 2026 18:39:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1771958356; cv=none; b=REQON+UghG59jn+Raz3v4GrrsxqYrWXUPQGTBoZJVYzoidWoP6uWD6gLT6fj8uzyoUm0hf6cPbobKveV0ldRFkPOzmz6opHYwYV67m/CrCkWSJlhftzkVuVM3m6aDWYNCs+vhP70Qse16Bgut61zErro7Rptjh0kyhz9CHqatuQ=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1771958356; c=relaxed/simple;
	bh=f9tq7Z1kiO8tl0OTx6dfSejjWL7J59iylc9Ot2jqXZU=;
	h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type; b=Mh78aQn+3h20NES5zzBEYUKYH/SJpdZmDVAFW8BmKWWkhYuxmp0yjdISzQ6IO3axS4zoobZ4rLFrwy8IKIO55tm6jpFq7N591sEd5tgknHvPOH0DktxPNGUQi9B0P5MOAuRmw2CVS7Wlp35LVF7rw+8yQiMPfZesZHqoYPdZA8k=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=eIG1meQc; arc=none smtp.client-ip=209.85.167.179
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk
Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-463f00cda04so3480738b6e.2
        for <io-uring@vger.kernel.org>; Tue, 24 Feb 2026 10:39:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1771958353; x=1772563153; darn=vger.kernel.org;
        h=content-transfer-encoding:subject:from:to:content-language
         :user-agent:mime-version:date:message-id:from:to:cc:subject:date
         :message-id:reply-to;
        bh=NBTDEJZp+82WEOKAWTqxON7yMT6y1QFNKvnkUneEv/s=;
        b=eIG1meQcZUZkZHgOfzt9h0kBASVUndiZoiSvC7kZ6GqYxu/NsEtWp2wCTx67YASHcY
         r9jtplvTBMp3huUAmk8TXNK6wmBbj9ikmnykF2Mo291Y9en4TtFYEM5Upc+XqxSlZKC3
         rf8qspZe5WR/WrfNTwP35vWh/UVKb3IXGvlXYdcN+UcYydztAfMUzz+nJHEz1kMNRpFY
         r/Mto9pdmCPe167bW4Z6HzU9NvKse0mg4QGx70pgRQ8u4WVH2Dg5l5VvIm6tKg0BGB/R
         zMmvtJD92qTs09dz7vjGA0PM2qxVtgV/fBcAp+/DHjWDOafah7D7m2WO73rgPyI9zKEo
         rjoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1771958353; x=1772563153;
        h=content-transfer-encoding:subject:from:to:content-language
         :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=NBTDEJZp+82WEOKAWTqxON7yMT6y1QFNKvnkUneEv/s=;
        b=N2J+TJBQpat/3kLjHVodtaEJlvNINcbaJ37vm0VkOCyH4DXJvV3Op2Uyr1A7kqTDqh
         EJ/2T8VYbFJ1ouwOzYRDl3llmvCP97Tu5PtSljmA+C24p3tHdiHZnsf3CQ8A+uXplyMH
         lR3cm3BSfoTHKm3xd1dP5aKRq7i9ihdPLil335QeHbCvP/R3hQZMilOhYU7V8T1kOhz7
         Gc8Fcv9ZZ41qZm0UJ6wELGZsw+YVG/mo+BEEVMc5+JH/J/IFruXOq8Hskf7PM0OPHz8N
         kuVS8EX67vrhBJL+JKziunUl4ntNnChGtWeaADoz7LkaSejHtHiUp/ZdGtd5ZPhgkMQB
         IR3A==
X-Gm-Message-State: AOJu0YwMWnWZu3Zas3UrGtSc6W5Qb9FyuOOTmXR/XHYaOQHpdixymt+6
	ZKMCihOsqt6N/zb3CbuNh911sThfDJglkUhWYX/An8qgDZcM05lglRH/XOCuqr32TSzo5DwKCVZ
	SxHN3
X-Gm-Gg: AZuq6aINigeuAv2OhkA9sutZkq3O3fdsUJb16OfcoX1PH+CkF9V+9oYPlD7fOOGvixM
	1X7s8nqIYpU3JzX/Vk4eKXzFrBn5b3q1kVWaA/H1xH8JGaAqq/7ij5y8IsJkJvLV6ld/FKCUolo
	rfM2attfFDIW2QoAMXyowUnDcmWCRMLDTa1RSJKfx7EcdGA/xoVmppNyV2HLcotJg08tUNMOTpj
	yaJ3ONdQN7N+tE+acbpN4XfpeGqT8/9qoWZBEe+RzV5yMCXXmR8fhvrsQojBc2qB4BY8fLGMfIe
	/qjVoiTG5gNsdSMkifBPBjsprqqn6RDlQJ2vN8eMT08mlX0fFIZPSJVTZ27fymTI1QrRUH1s8xa
	NA2y08QvDY9TY4wKcNDRahFVEAjTi4NLSbYtkfemgdeQ8e3goCdouyZl47MQWKLROOnBLQ7P4IU
	2vgXySoOcix1bxa8BQ3z8lPkAXcby6y80G8r2/wfLIRYpoiObXCtPDYTa0zU6tECBj4DvXQYwKF
	pZPtUs78Q==
X-Received: by 2002:a05:6870:a10c:b0:409:4a88:aa53 with SMTP id 586e51a60fabf-4157ac72fa2mr6420787fac.13.1771958353182;
        Tue, 24 Feb 2026 10:39:13 -0800 (PST)
Received: from [192.168.1.150] ([198.8.77.157])
        by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4157cd55637sm10014489fac.3.2026.02.24.10.39.12
        for <io-uring@vger.kernel.org>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Tue, 24 Feb 2026 10:39:12 -0800 (PST)
Message-ID: <bf698d49-e7bc-4939-9778-3698a2f15db2@kernel.dk>
Date: Tue, 24 Feb 2026 11:39:12 -0700
Precedence: bulk
X-Mailing-List: io-uring@vger.kernel.org
List-Id: <io-uring.vger.kernel.org>
List-Subscribe: <mailto:io-uring+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:io-uring+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: io-uring <io-uring@vger.kernel.org>
From: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH] io_uring/cmd_net: use READ_ONCE() for ->addr3 read
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-DKIM: signer='kernel-dk.20230601.gappssmtp.com' status='pass' reason=''
DKIMCheck: Server passes DKIM test, 0 Spam score
X-Spam-Score: 0.5 (/)
X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has
 performed the tests listed below against this email.
 Information: https://docs.mxroute.com/docs/expert-spam-filtering.html
 ---
 Content analysis details:   (0.5 points)
 ---
  pts rule name              description
 ---- ---------------------- -----------------------------------------
  0.0 RCVD_IN_DNSWL_BLOCKED  RBL: ADMINISTRATOR NOTICE: The query to
                             DNSWL was blocked.  See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block
                              for more information.
                             [104.64.211.4 listed in list.dnswl.org]
  1.5 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
  0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
                             valid
 -0.1 DKIM_VALID             Message has at least one valid DKIM or DK signature
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager
SpamTally: Final spam score: 5

Any SQE read should use READ_ONCE(), to ensure the result is read once
and only once. Doesn't really matter for this case, but it's better to
keep these 100% consistent and always use READ_ONCE() for the prep side
of SQE handling.

Fixes: 5d24321e4c15 ("io_uring: Introduce getsockname io_uring cmd")
Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

diff --git a/io_uring/cmd_net.c b/io_uring/cmd_net.c
index 57ddaf874611..125a81c520a6 100644
--- a/io_uring/cmd_net.c
+++ b/io_uring/cmd_net.c
@@ -146,7 +146,7 @@ static int io_uring_cmd_getsockname(struct socket *sock,
 		return -EINVAL;
 
 	uaddr = u64_to_user_ptr(READ_ONCE(sqe->addr));
-	ulen = u64_to_user_ptr(sqe->addr3);
+	ulen = u64_to_user_ptr(READ_ONCE(sqe->addr3));
 	peer = READ_ONCE(sqe->optlen);
 	if (peer > 1)
 		return -EINVAL;

-- 
Jens Axboe



From - Tue Feb 24 18:56:02 2026
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
Return-Path: <io-uring+bounces-12405-hi=josie.lol@vger.kernel.org>
Delivered-To: hi@josie.lol
Received: from witcher.mxrouting.net
	by witcher.mxrouting.net with LMTP
	id CO2tDD70nWkPRDUAYBR5ng
	(envelope-from <io-uring+bounces-12405-hi=josie.lol@vger.kernel.org>)
	for <hi@josie.lol>; Tue, 24 Feb 2026 18:55:58 +0000
Return-path: <io-uring+bounces-12405-hi=josie.lol@vger.kernel.org>
Envelope-to: hi@josie.lol
Delivery-date: Tue, 24 Feb 2026 18:55:58 +0000
Received: from sea.lore.kernel.org ([172.234.253.10])
	by witcher.mxrouting.net with esmtps  (TLS1.3) tls TLS_AES_256_GCM_SHA384
	(Exim 4.98)
	(envelope-from <io-uring+bounces-12405-hi=josie.lol@vger.kernel.org>)
	id 1vuxZd-0000000EkFh-1lES
	for hi@josie.lol;
	Tue, 24 Feb 2026 18:55:57 +0000
Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 8F75A30C3654
	for <hi@josie.lol>; Tue, 24 Feb 2026 18:54:38 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D1D42DA75A;
	Tue, 24 Feb 2026 18:54:38 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XqEtMT1U"
X-Original-To: io-uring@vger.kernel.org
Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CE0527E054
	for <io-uring@vger.kernel.org>; Tue, 24 Feb 2026 18:54:36 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.128.45
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1771959278; cv=pass; b=VKQFHR7z6CEWV1Dom9nTBuBJOsiZWN8yh3Ogy1zzPGb8wVuSXURrkfDYpFVPKqzCqANZb05nFWLXPTFpRTF/MWldN6xfYe4MfbvtGpaoqvu7M9CXdsa+NOJuCKERnDWueiqRMz3PTsKSsC+bFnkc1b6BkhhSv3iXRAKxv4IzNsw=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1771959278; c=relaxed/simple;
	bh=7kYf38Y4iDvXs4qp/u1OTPuMQjxxHFTdTFxvoFrFL6M=;
	h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
	 To:Cc:Content-Type; b=ahoPp+kZFIz6M0fEqJ+DGalymQm8KX0m8ZOPhPp3ToG/fESjIcBNUl5eWQiaQvmdHobEHZSAXkzCz7AGzAolk0+Xtph6OeAhcA+xXcW67oQ1ENTOVprtn89JkFowv/hEyUWo4vNFVkkoo+sxIR8l8UgSwwV1Emn8uThmiEXc5+E=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XqEtMT1U; arc=pass smtp.client-ip=209.85.128.45
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-48372efa020so47209325e9.2
        for <io-uring@vger.kernel.org>; Tue, 24 Feb 2026 10:54:36 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1771959275; cv=none;
        d=google.com; s=arc-20240605;
        b=B5pbiWZd6QZPXOdabbiTIbM18JRSYuham4pXulkB+3z0EaVIRwzTlCysGxxthRrw8X
         e/kR6d6PqvaZcje6YrKpHibct2FysdQ9EuVI8yKH0G8vrt4hIAtYTtxwcmhMpoh56Ka9
         w3dFc9I7ZbDhmwVkRcLFbJ0x77HuvLkD/zWrxCiWztLEmXLSiWtn9zLxGpeknO49y8+q
         Di5FcYw5vVuFPNpDvRtsSWA9XZcYI9tClS6E6LYYwqNLu0WnzyqOEcG8XRPzPaiy/GMS
   