Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3450514rdb; Wed, 13 Sep 2023 12:21:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH62efOzo7xVkULaBAgE2sKb/KcAA33Qx0WBpO9md8H8aRl9F2yQhwOjbiYZ1uMp2sTmJfZ X-Received: by 2002:a05:6a21:7905:b0:14d:a97c:90e with SMTP id bg5-20020a056a21790500b0014da97c090emr3441180pzc.23.1694632918581; Wed, 13 Sep 2023 12:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694632918; cv=none; d=google.com; s=arc-20160816; b=w27BEBmHfOHcZGEfK2wucw5dzoXflZRLDOcN7CCXZY/RQdpyDyFLE98N0U52OpUCOp bJeWWu60dF0NBuL3NkmVm5s6yhPVxMds/apkSNZ9ZnUUbsRQH9X1RB5qKzKXb6HCADWQ dNPJUa4V3wFIokdb+TpdlYr48zt0D0dfopocSan0STmYU7D2Fm/Tnc4ZRLHSPiBIV723 PxAhJ5SCPGk9/dhvxPsZRBM8N/UEPcHuevGsHrE6PqUDMdw/p6UiWGEI5qWPPC/y88TH Jdw1iPwbpSQUTSCB0sApOHz0t0QRsB1ZCfQFlbfcfR0LWnRvp55gB/Mfa7wVhbjZXf2A ZFzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rF5iM8ZkJqphGmjRFU1s0SbK7ImZ/Xg4gUBQOimY8QI=; fh=U2H3/FPocPBB6GPezKHW9HS+wZ8AoMiBoUwvb1zfBQs=; b=EwJzlSOBOvWaRMj1f2lXiS7ee2sTE3UBQHCcrZ9aieDixstNh9ZFgypS27MhptUDHL LppQo4Vn9KQDcxmZeftk2rrxOmKQ7G0ELCOqs4rgn6rmNiYOTzUesv44c/8sa9mdllJ8 DbR2NETPu6FVxcjiHV2/oitaoM38ZU+4YG5DvMuuQS/1FbDnRobgQD33BePEnNGl58kw zOih40sMqARTL5SPuWPli50e/xAmw6o4WT44xK35OxjQM7FpDoLiJQN/+qqmxMU8hBbn dt2I9maxp/5RMP2IV1TsDxlgUCXjwcrRB7s4thp5yWEzoQ7X4C9drfuH/xm3xWW2q0Xu aQSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b64-20020a633443000000b00565448156afsi6224730pga.715.2023.09.13.12.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 12:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CBAC483B6BE8; Wed, 13 Sep 2023 08:29:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbjIMP2s (ORCPT + 99 others); Wed, 13 Sep 2023 11:28:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbjIMP2i (ORCPT ); Wed, 13 Sep 2023 11:28:38 -0400 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD7BC1BE9; Wed, 13 Sep 2023 08:28:33 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-502b0d23f28so6812681e87.2; Wed, 13 Sep 2023 08:28:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694618912; x=1695223712; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rF5iM8ZkJqphGmjRFU1s0SbK7ImZ/Xg4gUBQOimY8QI=; b=i6HhVNKpabsOIC2vJKOGy/osVxXwPvIZ/0kg4nRvpeW7rlqSCb1WtpJvR0lMM09S17 J8HcNioLp2n4DbmP/s0PE+Cx37xLFQnqsGTt1q5oV+0tjQhOUnO2s2g4YpDqr0hcZpVV +wmiSyFHqRk7c/FXKqZ9/7odXustALINmGb73P30w0ZsdZwdZClnRaeqlh045jqSqYNJ P3h8eSIEfmfPOedoXjUZ6fCEau/tQETJjAY2+BgBFCdjibIpPxcTmXIEwWLLfxh9NUfo myMzxPlTF/YHEq1UnJuzKhkuwVGZf/dBtk85RChMXTsJOEiWtS+Lrh8mEBGe+f+W2ELg JcXA== X-Gm-Message-State: AOJu0Yy1OmCJGvkJJiddeQWIz0PrJy5qLdOPyI3QzvaFOlcNkez8eFY5 rEWUHMNu7+aLuEEsWmHwWXQ= X-Received: by 2002:a19:2d08:0:b0:4fe:1681:9378 with SMTP id k8-20020a192d08000000b004fe16819378mr2448500lfj.66.1694618912053; Wed, 13 Sep 2023 08:28:32 -0700 (PDT) Received: from localhost (fwdproxy-cln-001.fbsv.net. [2a03:2880:31ff:1::face:b00c]) by smtp.gmail.com with ESMTPSA id kj27-20020a170907765b00b0099b5a71b0bfsm8705015ejc.94.2023.09.13.08.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 08:28:31 -0700 (PDT) From: Breno Leitao To: sdf@google.com, axboe@kernel.dk, asml.silence@gmail.com, willemdebruijn.kernel@gmail.com, kuba@kernel.org, pabeni@redhat.com, martin.lau@linux.dev, krisman@suse.de Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, io-uring@vger.kernel.org Subject: [PATCH v6 5/8] io_uring/cmd: return -EOPNOTSUPP if net is disabled Date: Wed, 13 Sep 2023 08:27:41 -0700 Message-Id: <20230913152744.2333228-6-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230913152744.2333228-1-leitao@debian.org> References: <20230913152744.2333228-1-leitao@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 08:29:04 -0700 (PDT) Protect io_uring_cmd_sock() to be called if CONFIG_NET is not set. If network is not enabled, but io_uring is, then we want to return -EOPNOTSUPP for any possible socket operation. This is helpful because io_uring_cmd_sock() can now call functions that only exits if CONFIG_NET is enabled without having #ifdef CONFIG_NET inside the function itself. Signed-off-by: Breno Leitao --- io_uring/uring_cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index 60f843a357e0..5753c3611b74 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -167,6 +167,7 @@ int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, } EXPORT_SYMBOL_GPL(io_uring_cmd_import_fixed); +#if defined(CONFIG_NET) int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags) { struct socket *sock = cmd->file->private_data; @@ -193,3 +194,4 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags) } } EXPORT_SYMBOL_GPL(io_uring_cmd_sock); +#endif -- 2.34.1