From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F05D35AC02; Sat, 28 Feb 2026 18:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772302696; cv=none; b=iE0IVEkTFmcIn8IQGWIulcshqB4iJgtvNIc5mG/FI5LBADyjMRzXLfJ0uaMpsKGVjop7P6MdRpHqhwktX0cP49hrukYouKLDUjWm+E8PPWGTCA5l/VLHPWcDZvWCRH8b+FkgylTHM0+H1/l9bcaEbRmS1KBNMzG5DFFPJuNu6bk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772302696; c=relaxed/simple; bh=Myv1uT6pgCKChE0Cthw3fmvc8MAoOj0B17opGgEWW1Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZV3phi8N1jFlV3/AmVnCqRbMMfsZBQNmGXb3QNNCnI9MK0revTub45BVDvl0l7IEYPM9qYZ2e06wRG2BIRYLEasG/MS7Bog7JndNZ2MK6+QJ26yQtdEap4Wec94GPUQEqlcHVj/DZkVlXnDPo8cRjKgYt0GLMRGBj3Z+3YFGV+U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=mZcgwfP9; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="mZcgwfP9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1772302218; bh=Myv1uT6pgCKChE0Cthw3fmvc8MAoOj0B17opGgEWW1Q=; h=From:To:Cc:Subject:Date:From; b=mZcgwfP9adD+pi0NUfxneqVnEoz1sYa6FR5axyr6kaHCioKpy0A5DC/jNZhyRJLuB ulhvutcv9ZFsfFBhb9fCvG+WayRvkBaGmfgjTWXpda3vKmhDxD7/OAmLA+RaHkuTn9 VuMwNfbsRkO9wfhBJGuFoI4NorGpeq6YP5ev1c3zZwYqGIQycLkT4lVV6ODtib0nF0 DCLYQzSQ150pBxuqQxoEfzLxZvPvVumf0I6PXrazXlMBBrK1uNWYMhoVV74Li2LHrc UOqf+HMSODUW25RrqzO6PY1UgXlZ+SdHF2hImGe2BYbafZlkef7ATeKhyAE+F/3NEg UYoY5WfqKsHCw== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id F2609600BF; Sat, 28 Feb 2026 18:10:17 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 7C80C201903; Sat, 28 Feb 2026 18:09:54 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: stable@vger.kernel.org Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , Jens Axboe , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Gabriel Krisman Bertazi Subject: [PATCH 6.12.y] io_uring/uring_cmd: fix too strict requirement on ioctl Date: Sat, 28 Feb 2026 18:08:53 +0000 Message-ID: <20260228180858.66938-1-ast@fiberby.net> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ Upstream commit 600b665b903733bd60334e86031b157cc823ee55 ] Attempting SOCKET_URING_OP_SETSOCKOPT on an AF_NETLINK socket resulted in an -EOPNOTSUPP, as AF_NETLINK doesn't have an ioctl in its struct proto, but only in struct proto_ops. Prior to the blamed commit, io_uring_cmd_sock() only had two cmd_op operations, both requiring ioctl, thus the check was warranted. Since then, 4 new cmd_op operations have been added, none of which depend on ioctl. This patch moves the ioctl check, so it only applies to the original operations. AFAICT, the ioctl requirement was unintentional, and it wasn't visible in the blamed patch within 3 lines of context. Cc: stable@vger.kernel.org Fixes: a5d2f99aff6b ("io_uring/cmd: Introduce SOCKET_URING_OP_GETSOCKOPT") Signed-off-by: Asbjørn Sloth Tønnesen Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Jens Axboe [Asbjørn: function moved in commit 91db6edc573b; updated subject prefix] Signed-off-by: Asbjørn Sloth Tønnesen --- io_uring/uring_cmd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index f927844c8ada7..e5d0cc8a8a562 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -338,16 +338,19 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags) struct proto *prot = READ_ONCE(sk->sk_prot); int ret, arg = 0; - if (!prot || !prot->ioctl) - return -EOPNOTSUPP; - switch (cmd->cmd_op) { case SOCKET_URING_OP_SIOCINQ: + if (!prot || !prot->ioctl) + return -EOPNOTSUPP; + ret = prot->ioctl(sk, SIOCINQ, &arg); if (ret) return ret; return arg; case SOCKET_URING_OP_SIOCOUTQ: + if (!prot || !prot->ioctl) + return -EOPNOTSUPP; + ret = prot->ioctl(sk, SIOCOUTQ, &arg); if (ret) return ret; base-commit: 444b39ef6108313e8452010b22aaba588e8fb92b -- 2.51.0