Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp722714rdh; Wed, 14 Feb 2024 09:22:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUTkZLLO6Z/EPrNafwRFoWVZjyqIc0/0X7f0XvOs9rH8MzlRuDhTTYzdb8KTQiohh7EOgqEL6MOba+lrGwB6h3Rg2xY7smheOBIe4gJiA== X-Google-Smtp-Source: AGHT+IFu0ekA/qOG7e7NeKX+nuMiWke7xk9hK+Ioc6stdijljcBTFdUx2Zid29UC3BeKAXlxQN6w X-Received: by 2002:a05:6870:a102:b0:219:6c6d:b91 with SMTP id m2-20020a056870a10200b002196c6d0b91mr3110309oae.53.1707931354056; Wed, 14 Feb 2024 09:22:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707931354; cv=pass; d=google.com; s=arc-20160816; b=gh5m0SLfkboqRSr7cJQi+bBpPGWdf1Tr1SW9Iq0lEgu/6JO+9jK8LuxmvXOPh3iflx W2iWwy2ca75+HWFFepj8bbR55DZjoQ8dtSM0Ay98zCbFb58eQV2buj90WPRJAfKi4+YO PkFICE6Wbu/nTo1+7fYjNsi6QWIzDS4EKLAjYk24JO9RYSzPXstW/Hu9k+PO7b5mVSnW sBQ26JeTxK4QKcWc3X604dYt1c1UBP43AcPbJYW5uJyz+kucq++OENf0MyzWZ3+kC/QI Jl9gIKl1KGVRU4Sw9fvQbUlSud4AXNa6RdnPNxS52i2pAL/6hYhigXQ7b/KIUb3kfVr0 GeKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=puiVmzL5J+PBnyPVVnJ11DTHB1EqCRuXQt+Sznv0bMo=; fh=8BTBC0sQRj6s6cXoLAXh/Bn0ecASnlKSqglNoPFq5/c=; b=PJ35V1r9FcF+1YZc+Ma2D6dEfraWxSThWAdbtQPbSRbpOKhg77axqlwe0sr2W0vVOO 05WnQJ+hM5pA0E+U8y3uXqASgTpJKRtj1XXjHQZSSkTMoeMFD7T93W6UBeKusV1RfLxh cUY0tw+b3F64aT/SX9NoyT5E0kU9EBgQJdczz9axiykKA9M9L/F06/SJ2W9055PALYiJ zJP2+Hpq9rzDSNNwcfHOWqnWXMe5aGNYkjQwNqYIttR6Ui1UeYliTYz0HD3odPTQNs+f PxIsQnS+pZD4HMl/m4/11cu2ypNlXT0YDJ+GF8LyDxDuwkbRm3xZEgqYKLkn5BcoP8sH N7Jg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gSMJnCBh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65641-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65641-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXp1BQNu63kjP+PbJKrs3mBLR46EM27vTKmVCaO3xEPviY+vEacoOj0YyIIXIEoucol7Z+rRG5Nfwfl3xcstLYwlJy6tKs6PGZPqptKrg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vu16-20020a05620a561000b00785dadba14asi6124455qkn.222.2024.02.14.09.22.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 09:22:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65641-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gSMJnCBh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65641-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65641-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 8B67B1C28ECD for ; Wed, 14 Feb 2024 17:20:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DEC985285; Wed, 14 Feb 2024 17:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gSMJnCBh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B45B085268; Wed, 14 Feb 2024 17:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707931153; cv=none; b=Ce5JUzlmeQU+vgRiAJ83fLpL8rhA3A1/7LMd6TPwGDEILyKG5QtnLNeJRrDDdsvbk4DnIl189wwQ8/VT0nu7Pgt6+OB1MT8tSYiFyXLEl5kdheGSsZZL3ptci9sS5JjqL0HgRUHG2IQVJ/ZFAyZCSdJWItBP27+PYwwXeUC31WU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707931153; c=relaxed/simple; bh=4OdGUm9HFmtkn3vsq7JGFZKzQ/ITmuIGwj3G26a/QyQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qXKlWwhG5pILVnym8bJIdZ+rYP6s1mVMaOeTLAlOVGqPeyt00l4v9lmKKaY1ofoEbFuuNiTSA8PcaXNwOwvtnM1/LUxmF7B+Qf+HQrpqKZqXDKfWOCgf3fuww5ziisoqlT8JCeBzKHujnc7OLSPWsvMuhjHs3MMHkSZtAb8YkQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gSMJnCBh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D826C43609; Wed, 14 Feb 2024 17:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707931153; bh=4OdGUm9HFmtkn3vsq7JGFZKzQ/ITmuIGwj3G26a/QyQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gSMJnCBho8MLq6HzBArgTrzpXHh3JvSoM1We081wZJHl7DcWe/piB3tfHYotLdPrL Lc1Tr/q0BQMqwX44lHF27ViFqWkv3bEeJV9em6Sy4MF2w0m29s1XPPeroi6rmJ+/BW kEimX8BLv/6EAgVcn74JbpLEvlcPipp+OR5BiBL95d2Z9FSnn1FM++LpGHi3//Txw8 dVbzOCnJe1JCbYHIVJsFKn1Xj6WMmqj/18Pnh7YxK8ncjkkHW9fuU6kSDuF7weCxZa v5w7OAcbxXR9PYiz+W4nJIx0aeiZu8+XE+5FtJWFud+Ln5QFvTS1JRE498kew1isXw 0VVNHr5xM0aug== From: Benjamin Tissoires Date: Wed, 14 Feb 2024 18:18:32 +0100 Subject: [PATCH RFC bpf-next v2 03/10] bpf/verifier: allow more maps in sleepable bpf programs 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240214-hid-bpf-sleepable-v2-3-5756b054724d@kernel.org> References: <20240214-hid-bpf-sleepable-v2-0-5756b054724d@kernel.org> In-Reply-To: <20240214-hid-bpf-sleepable-v2-0-5756b054724d@kernel.org> To: Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Jiri Kosina , Benjamin Tissoires , Jonathan Corbet , Shuah Khan Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Benjamin Tissoires X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707931135; l=1041; i=bentiss@kernel.org; s=20230215; h=from:subject:message-id; bh=4OdGUm9HFmtkn3vsq7JGFZKzQ/ITmuIGwj3G26a/QyQ=; b=dqAI9nNqZJJSqL1WxlTEU41LIngJOXojPXunu816A7LhAL2wmgZqVLf71TIxKkD5v/TcP71l1 hyjLr7LL//CCJVyUI9mpcxpa840MSYCFWcS5Hpa7K/HzuzIprCpUJ0u X-Developer-Key: i=bentiss@kernel.org; a=ed25519; pk=7D1DyAVh6ajCkuUTudt/chMuXWIJHlv2qCsRkIizvFw= These 2 maps types are required for HID-BPF when a user wants to do IO with a device from a sleepable tracing point. Allowing BPF_MAP_TYPE_QUEUE (and therefore BPF_MAP_TYPE_STACK) allows for a BPF program to prepare from an IRQ the list of HID commands to send back to the device and then these commands can be retrieved from the sleepable trace point. Signed-off-by: Benjamin Tissoires --- changes in v2: - dropped BPF_MAP_TYPE_PROG_ARRAY from the list --- kernel/bpf/verifier.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 67da3f7bddb5..cb1266566b69 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -18094,6 +18094,8 @@ static int check_map_prog_compatibility(struct bpf_verifier_env *env, case BPF_MAP_TYPE_SK_STORAGE: case BPF_MAP_TYPE_TASK_STORAGE: case BPF_MAP_TYPE_CGRP_STORAGE: + case BPF_MAP_TYPE_QUEUE: + case BPF_MAP_TYPE_STACK: break; default: verbose(env, -- 2.43.0