Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6280847rdb; Thu, 14 Dec 2023 13:34:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+xTqsqcy5hx3aXLkgIpL1p5PAEO59v0Z/vLigooFXzXz4gb6OO8pB0YVjPqEOpfHtpufn X-Received: by 2002:a05:622a:44c:b0:423:6e3e:72ab with SMTP id o12-20020a05622a044c00b004236e3e72abmr15817339qtx.55.1702589668416; Thu, 14 Dec 2023 13:34:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702589668; cv=none; d=google.com; s=arc-20160816; b=lS1H3dE6i20lWffz8CJ+x+2ndwzHyetap+Yg9O+CRXeRCkWQQH8fsKiF9fCZROp8nd 6yfx5HUCXoUKzlO8YwjC6lGLz3yL0ZPrku3uUzcda+Ff5sOTw/qZOihYOutIgNoVQf2N HbifretaUaYHLgbk6EKaAqJdVpiLCbvAQ6w8V3Y292ad/T4gBBYMaa/SbvisrNdE2tSO /0S0U3kVCzXRlcX2y/kJ32xl/3BDnMidPsAmv/QfZybxwz6LA491VY8epY3dU1F5F4KM MaWCMgr/joWsywuodT07i2CYpmJQbyzvja+v7/OTXY75m1Q42awj1b0W9PEruLdQ7T5w nMaQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e5-20020ac81305000000b004237c7e78e7si15013001qtj.272.2023.12.14.13.34.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 13:34:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 30BC31C21D22 for ; Thu, 14 Dec 2023 21:34:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6A126ABBF; Thu, 14 Dec 2023 21:34:19 +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 To: Jens Axboe Cc: Breno Leitao , Jakub Kicinski , 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: Al Viro 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 --- 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 #include -#include +#include #include "io_uring.h" #include "rsrc.h"