Message ID | 20231214213408.GT1674809@ZenIV |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-134-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8866596dys; Thu, 14 Dec 2023 13:34:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxfWkOOajyvFadRUo34a3f/NhC/GMiAqy/InB/lE8De7bey4W5VRveIxoBkrWABbJf7nV/ X-Received: by 2002:a17:906:c14f:b0:a1c:f8db:c6a5 with SMTP id dp15-20020a170906c14f00b00a1cf8dbc6a5mr6606199ejc.46.1702589678775; Thu, 14 Dec 2023 13:34:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702589678; cv=none; d=google.com; s=arc-20160816; b=uLSicL5Ld0XkTXpHLHIAX50N9V92N+nOisjZa1GP4KV8dNFKjjYpXRiKGynDWD06jJ vf+IPdNfJWnIFHpsIo28Newlh/vCKLRW2v/9R6mPR1kjrkmcntUfnisiQ0C5Ry7F/OE4 ZKPWvIMk7BuPfN9/3JLir1kZoqpnEuCBcXGrQ67uNyirIfizFLxlCZTQAGGDXNgxhTbe kTFrTQRv+hWTndFiDDDneNs48UfaYZUFoL8WnM+BS1e8sgIJt9QO/4A+YmSwwNUHWfI0 TD8ehZdu1Y98Z4kO9h+9mWdXN2/rnBSu2QnffNouwSV4gGHgEtfvQdMrshHTevZA6DQp d3JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=7z3XIWKiQRXINTdgZuNu80jE2Rb8fh/bbs66WhEruCg=; fh=vsYOPGr1Inu1i4tEI/ZpdFlIgIEuBQZsuoq/7aKJI/o=; b=UaUi4QiyP1o1t3kd18lncCtsz540D42k6GK6BprQhrcHS8Ac+baEgfQVGS+uJl8VHc FLJUWEPkV/zwSEmDNhYknjRXv+MJ/As0qMoiqeZ6Qs5CeTvOu39LTr2iqR8Xk8/SnUSY VYip/MUUvAm/9KxZ5l0CBzXuIaAt+lDR3x0x0faopgKbOM7Bg6uIWds9wdwG0yWYX//g 3lPl2bJGeJIT74p/udsQ5xeoww4nsQsc3oe7g3a1T/cCW6Ho8I6RcNfQfxRkvG8wSzrF dyW75iCjUdo1jaBz6px1Hl3hqnKgQ6wIZ+PceWCUylSnKN67va4IFKbYLnmLZwK89JLX kvuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=Fu+beiHV; spf=pass (google.com: domain of linux-kernel+bounces-134-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id mj20-20020a170906af9400b00a1f5e366b66si6888018ejb.238.2023.12.14.13.34.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 13:34:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=Fu+beiHV; spf=pass (google.com: domain of linux-kernel+bounces-134-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 602BD1F22825 for <ouuuleilei@gmail.com>; Thu, 14 Dec 2023 21:34:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F1D86DD08; Thu, 14 Dec 2023 21:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="Fu+beiHV" X-Original-To: linux-kernel@vger.kernel.org Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (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 615BB5F1E2; Thu, 14 Dec 2023 21:34:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=7z3XIWKiQRXINTdgZuNu80jE2Rb8fh/bbs66WhEruCg=; b=Fu+beiHVoGWcFtzO1l1v442y+G ZADPfDlPm1kvo7RrdZoRnKoAF5Y4VI18NANwACar38pRjLoW65lkgyU2ScZFE6b9iiF8vn4mxQ4cY H3hpQ6VX3M6idL2rB6fuD9ky0HgJ9x5RuE/hQK2SG/edPXpL3k3xOw+HuoGHYujgdnL+IK1fEgwd4 QW4gOnqCMlBBtQhsAg9qhgkl479tU/seoO9vOc5zJHDdJuW3L2QFzm1kabCJWHsQYnTmwG0EDst4C X3nO/ayP9FrIDXH6LpJ8P7Vgq1ZzkHVq+oIV+8zi19ftKujxKXIzZcODKYtbtgJoeRvk6M1HlPGC/ utPAIY8w==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rDtLM-00CSwl-10; Thu, 14 Dec 2023 21:34:08 +0000 Date: Thu, 14 Dec 2023 21:34:08 +0000 From: Al Viro <viro@zeniv.linux.org.uk> To: Jens Axboe <axboe@kernel.dk> Cc: Breno Leitao <leitao@debian.org>, Jakub Kicinski <kuba@kernel.org>, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] fix breakage in SOCKET_URING_OP_SIOC* implementation Message-ID: <20231214213408.GT1674809@ZenIV> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: Al Viro <viro@ftp.linux.org.uk> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785294675288778601 X-GMAIL-MSGID: 1785294675288778601 |
Series |
fix breakage in SOCKET_URING_OP_SIOC* implementation
|
|
Commit Message
Al Viro
Dec. 14, 2023, 9:34 p.m. UTC
In 8e9fad0e70b7 "io_uring: Add io_uring command support for sockets"
you've got an include of asm-generic/ioctls.h done in io_uring/uring_cmd.c.
That had been done for the sake of this chunk -
+ ret = prot->ioctl(sk, SIOCINQ, &arg);
+ if (ret)
+ return ret;
+ return arg;
+ case SOCKET_URING_OP_SIOCOUTQ:
+ ret = prot->ioctl(sk, SIOCOUTQ, &arg);
SIOC{IN,OUT}Q are defined to symbols (FIONREAD and TIOCOUTQ) that come from
ioctls.h, all right, but the values vary by the architecture.
FIONREAD is
0x467F on mips
0x4004667F on alpha, powerpc and sparc
0x8004667F on sh and xtensa
0x541B everywhere else
TIOCOUTQ is
0x7472 on mips
0x40047473 on alpha, powerpc and sparc
0x80047473 on sh and xtensa
0x5411 everywhere else
->ioctl() expects the same values it would've gotten from userland; all
places where we compare with SIOC{IN,OUT}Q are using asm/ioctls.h, so
they pick the correct values. io_uring_cmd_sock(), OTOH, ends up
passing the default ones.
Fixes: 8e9fad0e70b7 ("io_uring: Add io_uring command support for sockets")
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
Comments
On Thu, 14 Dec 2023 21:34:08 +0000, Al Viro wrote: > In 8e9fad0e70b7 "io_uring: Add io_uring command support for sockets" > you've got an include of asm-generic/ioctls.h done in io_uring/uring_cmd.c. > That had been done for the sake of this chunk - > + ret = prot->ioctl(sk, SIOCINQ, &arg); > + if (ret) > + return ret; > + return arg; > + case SOCKET_URING_OP_SIOCOUTQ: > + ret = prot->ioctl(sk, SIOCOUTQ, &arg); > > [...] Applied, thanks! [1/1] fix breakage in SOCKET_URING_OP_SIOC* implementation commit: 1ba0e9d69b2000e95267c888cbfa91d823388d47 Best regards,
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index acbc2924ecd2..7d3ef62e620a 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -7,7 +7,7 @@ #include <linux/nospec.h> #include <uapi/linux/io_uring.h> -#include <uapi/asm-generic/ioctls.h> +#include <asm/ioctls.h> #include "io_uring.h" #include "rsrc.h"