Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2520908rdg; Mon, 16 Oct 2023 07:03:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdx6aEY4Hii40d+AyAK+jYcDCuhm89/qcEfKP3cKQRoSaCkQQWoS4cihQutfZ8KebEkqZF X-Received: by 2002:a05:6a00:23c4:b0:6be:bf7:fda5 with SMTP id g4-20020a056a0023c400b006be0bf7fda5mr2963011pfc.12.1697465031776; Mon, 16 Oct 2023 07:03:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697465031; cv=none; d=google.com; s=arc-20160816; b=JSFz8g9UGhLZkXHngvocE/F61eyPGDdUEt+R4L97u58wMjyraa4BCKjEB44szBplkN CfV/Z/lBHpbAsf6RHm+hBaXSWdf5XdCNCmGTv42axLyRU5HTLMLTVDRtXluD5UVtd3B+ zQpUxOGx8Yl8l1NV2pX8si+9Q5fDeT672fEaM1YlGRhxySOKywALVtvhiLA4Yl5M+82N 5pJaoqpzR5RThIf9j1sA2iZhOA3bWcRqS9Nfu14W2rr3OCg4B96jNIpgbUojZFElohyK pfu+Ecnl515oVAbxfu7UD26bLSLcONVqVr3zvVI0cOTGn+R4uqyf8GprwHlV2wcy2Rl9 QcmQ== 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=J+1IratzCwRElqGveWEFhyqeH/oYCw38flsead1Kukk=; fh=U2H3/FPocPBB6GPezKHW9HS+wZ8AoMiBoUwvb1zfBQs=; b=YsvnA3KA5BMYp6IFmgU5T03W0XOAui0S1ztRbnE7GtG9EhQMVhHW9EgC2W6dbTKxk6 Da+0rj5BD3mvuYJVr/9zPKm5ekXi6Z9mHDuc0TpxwJUAnjNAQfA1EvULeBMETKc36IdX oA0qWi4KZplAv7i1oMEyk7dtgYPu9gKim6/boWRl/TeU9r+WzmCqw7ekzhY5SUPmKqMn yiz7ax7G0NajQRcTtGQOoZvNINrwzrzOHB6lI96yNldsEAkakpr4cb1Hk4lpxE1C6r5y PXkk08zER4eeHYqX5qRlZ+5De9qTh6eBxoY7vz/MSwUQuekxVLIV8BqFEkFV59Wyq+ek VC2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n30-20020aa7985e000000b006be0857ab24si2652293pfq.19.2023.10.16.07.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 07:03:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 6CD5A80ACED6; Mon, 16 Oct 2023 07:03:38 -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 S233621AbjJPOCp (ORCPT + 99 others); Mon, 16 Oct 2023 10:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233805AbjJPOCN (ORCPT ); Mon, 16 Oct 2023 10:02:13 -0400 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A68FA; Mon, 16 Oct 2023 07:02:07 -0700 (PDT) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-9a58dbd5daeso738058566b.2; Mon, 16 Oct 2023 07:02:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697464926; x=1698069726; 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=J+1IratzCwRElqGveWEFhyqeH/oYCw38flsead1Kukk=; b=odDokHQE8P3E56FUu42jksy1Av+ieE2a5YsXEPWdEfrvsUuECO6AEFHt/MYSpIGS/8 WhAx7yPgdZG2M7OgvKC4d3GBXgHl1ydlDnNKsJIvpN9nTgJ3C2L1aPUZYxpbGBH+pPQH 2ORS9iRAW5hIC0rHMiXvhylhDlh2pFfORu4/Q8eTpjHGncwrHUZQlQcpZG2KuYA8mU5s pF5GmTD43sEhy946ihSEmjauGL2a9r10rNUAN14JXLoQx/lxLh8UHt7XF1corsBKmerz 8i1Bm2Y7MGWAvOc80zZOt+5niJVXCPTexTTs0W3Uj+7EyTNbNsXH1cep53gsWFXhuT6H oI4Q== X-Gm-Message-State: AOJu0Yzotkr0i+58a9kykLK9Ea5Vl+Wu0Uf5J7sZ/7AhwQi21Ry8+BRL /69tHX/Ym1Zm18LArKrkgTc= X-Received: by 2002:a17:907:d24:b0:9bf:697b:8f44 with SMTP id gn36-20020a1709070d2400b009bf697b8f44mr5817823ejc.6.1697464924186; Mon, 16 Oct 2023 07:02:04 -0700 (PDT) Received: from localhost (fwdproxy-cln-017.fbsv.net. [2a03:2880:31ff:11::face:b00c]) by smtp.gmail.com with ESMTPSA id jz28-20020a17090775fc00b009ae57888718sm3997303ejc.207.2023.10.16.07.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 07:02:03 -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 v7 08/11] io_uring/cmd: return -EOPNOTSUPP if net is disabled Date: Mon, 16 Oct 2023 06:47:46 -0700 Message-Id: <20231016134750.1381153-9-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016134750.1381153-1-leitao@debian.org> References: <20231016134750.1381153-1-leitao@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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]); Mon, 16 Oct 2023 07:03:38 -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 4bedd633c08c..42694c07d8fd 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -214,6 +214,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; @@ -240,3 +241,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