Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2466774rdb; Wed, 21 Feb 2024 08:27:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXkVrkZrOYsAGxb1T9dgQcJwKvo7zljvw8+gMYPxqqdwdTRF58be0hEgcXVF1yy3nQsxtX+I8e1F9dikokf1VR/6c+KclFCrIk0OuKQPQ== X-Google-Smtp-Source: AGHT+IEojrJyypKxLFTA4nVD6KPDs00oSJfL9RNAevebpr8QbQNzzrqKmkeMB0u7Sw8dQQzABfSd X-Received: by 2002:a05:6359:459d:b0:176:543c:8ef0 with SMTP id no29-20020a056359459d00b00176543c8ef0mr15130255rwb.21.1708532868204; Wed, 21 Feb 2024 08:27:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708532868; cv=pass; d=google.com; s=arc-20160816; b=hFy/R28q2edoY/aBqJ392Ri5ng0TgEKeor09T5QFcTc5abx7iLPYsBSneITzxEl3Ou xdBbNlOLGC4gFV4kpPdi5yvFNya7nyPUY/htVy3z73SnmFT/y3pEEzFdqaFwrLEGXDAw POTBL/vpuOw9ZnnYUpw48C8vX/GsVMzQ55D5KgQbYSb/eyizimq6Iqix/SqO2ZrmJ9gz SI24qtN+N8v4OGjVzfKuJJF29Kg2tpKQlbFU9h8VCjJ/zAKTTVb4tgFUx6bohk5RjE/o pf59z+wAeimoCHTwYs26FBXkTSUYd2tDRMpAq6kOrxc6YfrSz9JuVgyxAYsTGrXSJ3ZG 1Gog== 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=TJKw+AsLlnEjjlOKsgrZe41IFOqxNYjqahfqLxS9e5A=; fh=hc4Y6F7QBSV+XcCZzl4ZOgjmnikSFu9Au/ny4/yLvAg=; b=ed68G8St5yZ4qee3MY+QR9L59ZjyL7OW4kUjrCTMzinmLAwWfdXXRKh2qKzZy81ULt buoyLALSds4Fq1NhMuxBOmQ1BoaJb+tykvJaJ/pY3JsvEuXFSn5VpDQ5Vsnqkvvk0Ukl ktalGBatc+QrRiYz68tEJVvZV/ip3bIwo2GB/HxzLUTKGfwHZr/OPJig/dSpx2G+WrSA l+Vo+PWkLsPLireVpDnZ4YX3ZHiJcLEmrB3gdP769a7J0uPM3fsoW2vWLVy7rGqLpXDQ a8+jzuUf1KSFYnUG64ldZ4W08eMAoLIULfg5a2+M0QsjSj6bQdDY7Gc0tUjCADS9RstD +BiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GwbLSn6x; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75105-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75105-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q11-20020a056a00088b00b006e0379f3935si8641750pfj.261.2024.02.21.08.27.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 08:27:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75105-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GwbLSn6x; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75105-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75105-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DD583287709 for ; Wed, 21 Feb 2024 16:27:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B97A684FCD; Wed, 21 Feb 2024 16:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GwbLSn6x" 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 D4ED68286E; Wed, 21 Feb 2024 16:25:59 +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=1708532760; cv=none; b=HmJ65YMwo1tAy9o0DGzdWmi7P03+OmMnLVXooy/Tu4xrAIiAaLBRQ0L4QSvMFjXXZPmD0WBk/MrN76LZdP/J7EjughRxWDXZioX2s8WCcUCZ/cb8MQ+yWIGYnwD46aDN41/1L5n31cDe8Mx+Appa16yegqgv++ZMRlxAxoqtMpE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708532760; c=relaxed/simple; bh=lWc/Co5ySMroMa/eudRddSJ5CcdAiLdAB0D5VhBoAvg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ShwC4ssvoRxrDWmEDucjyyqMudCLg3DOetm7tXbr9rUp3QoeUKsMDqOEHOqIJgj65Tu+xF7X0clga9UsVm9wiSAL1JgrQTjcXdf8Hfpfi/0U/w5030Ur1uT8EcWjhs8I2WQDntcBE+/udH/MTHqy8LUiij3MTwQRhAlXHlbbBYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GwbLSn6x; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE607C43390; Wed, 21 Feb 2024 16:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708532759; bh=lWc/Co5ySMroMa/eudRddSJ5CcdAiLdAB0D5VhBoAvg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GwbLSn6xfNvIGSAxA1xlvN0b77mdW4g4P25/ipPqgH2WNHi+62OtpMBDANQyXnSim i7ki2gEQlsABylfFaHex6cdNqqkcNT6iK+Arhphll+f+Kv8AUX4oV+Y0dPdUJa2dN8 i+1ch7jrLH5E7aobE7omru6fHItFPwFpGEyZwruunze5APqYzEUfI0hS9wV/qH2rZq AhmX7rgXN7xDivI2idAs7nkVppZz86ircA+ZvmWjrfh0ZvdI88UERhKWvV2aQSAGYM +SdvDgsvD9nNrrAEQ8HMpwE77Y55+NJ56EaBDOzfPjplahzraWk4UKUVqOsSMXnt3H /Ca0U1ekgf3Uw== From: Benjamin Tissoires Date: Wed, 21 Feb 2024 17:25:24 +0100 Subject: [PATCH RFC bpf-next v3 08/16] bpf/verifier: do_misc_fixups for is_bpf_timer_set_sleepable_cb_kfunc 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: <20240221-hid-bpf-sleepable-v3-8-1fb378ca6301@kernel.org> References: <20240221-hid-bpf-sleepable-v3-0-1fb378ca6301@kernel.org> In-Reply-To: <20240221-hid-bpf-sleepable-v3-0-1fb378ca6301@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=1708532719; l=894; i=bentiss@kernel.org; s=20230215; h=from:subject:message-id; bh=lWc/Co5ySMroMa/eudRddSJ5CcdAiLdAB0D5VhBoAvg=; b=ma84XtgROEN9tdF4Dzdxs29bXjzrN6p+Au89dZQv99gHRtEVfXxzOusC8V/KtrG053LncKsqR IKtRuMr0yyuAKjr2zIVovJWW31GKuD6siie2Jkmepj5X7klAxLQuLpx X-Developer-Key: i=bentiss@kernel.org; a=ed25519; pk=7D1DyAVh6ajCkuUTudt/chMuXWIJHlv2qCsRkIizvFw= This is still a WIP, but I think this can be dropped as we never get to this instruction. So what should we do here? Signed-off-by: Benjamin Tissoires --- kernel/bpf/verifier.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 4766c43606c4..8a9f268c4ee2 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -19720,7 +19720,8 @@ static int do_misc_fixups(struct bpf_verifier_env *env) continue; } - if (insn->imm == BPF_FUNC_timer_set_callback) { + if (insn->imm == BPF_FUNC_timer_set_callback || + is_bpf_timer_set_sleepable_cb_kfunc(insn->imm)) { /* The verifier will process callback_fn as many times as necessary * with different maps and the register states prepared by * set_timer_callback_state will be accurate. -- 2.43.0