Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1832999rdh; Sat, 25 Nov 2023 04:53:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGg3bsckCyN2Ydm8FbPC3YBCjuypCb/qgtqO0xGQf3+eUUU+ml5s/8MP0W0iAe8VsO+mGbA X-Received: by 2002:a17:902:ec92:b0:1cf:bdcb:61d5 with SMTP id x18-20020a170902ec9200b001cfbdcb61d5mr310104plg.37.1700916798571; Sat, 25 Nov 2023 04:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700916798; cv=none; d=google.com; s=arc-20160816; b=fh7LVwbnjafpz689cWkZLMTRWRwZtPjdchBBd8bAjcTPdoelEXhnvzb5b6ysuIHoIU Hy4cGL+AhYiBy77J0DcmVzP29tZqR8XaAAsh/xMytpwiB5YFmieWcBE9XNECDrl3N9x1 a3PCZNI9JPi699r1r2w8JJ+TioOhyzVCbl47/z2G1Kbh4vHO6bv45qNe72xEvyGH8JM6 lRTjKaiyPiNcWcF/KVoOMAmp/kYqWxvz24FuNYpSi/R9JDVHGpbnrece0dH4o8CxIzqB mj+NlM7/OQ333rQU50mJJ7RHi8sBgiSzxfJs3D5HBUKLV3vLzahSgIZrdZdMMYbEcGkq KFZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=KrS+9zeB6A3S2wVegPV4LR2bBL8cadu7bgkOCqF/MbU=; fh=1v5zqbO9sIGUc9bsdyhYE0zxdK1knZz2xnJYWUWMFKo=; b=tQUAB6v6pws/TDwo73O/hBzIToNWaKrsnZI0F4UjBDNJX3ByehE6vbA5ZEmhJisERF cmGb6dxo7gnwuBq1erB6caRFH38IT9cTLuvkwnwpnQ4Y9IeU1CuWUb03Hupl21DLUpYE Pp29CIPo14POLN3/UF7Z1Fh7CBNZ7/SIfO9i/KH3bmSvP0MdxUtlOjN0znFz4IKb4v/C pAMQgOHvUqL0Br4wdmgSRhr8H78zGSDw7uLt45NEwnCQQZf1gc10bFXFsT3juuM9kzoI Q0Vik/6iGxbVNNjvgR/ZBpU63v45gkNb3RUJK8GuS3+HwJiP1xh/Oq8bfBykLAt1U+tM dz5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b="fC4/kcbE"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h11-20020a170902f54b00b001cf59949d5fsi5972639plf.405.2023.11.25.04.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 04:53:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b="fC4/kcbE"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id D29658043EFF; Sat, 25 Nov 2023 04:53:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232102AbjKYMw6 (ORCPT + 99 others); Sat, 25 Nov 2023 07:52:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbjKYMwy (ORCPT ); Sat, 25 Nov 2023 07:52:54 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 932558F; Sat, 25 Nov 2023 04:52:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1700916776; bh=TvazAFFGE0otnXYiwQcMdxMBACDm5WWzmf21WwSH3Jk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fC4/kcbE39t3cktG8KvZ2tjeXuGXOswHwzsR9Gbqe2FNKM8mZv2a+fLAb/OkUoGQl Ct/I3PU+OUB6zbRuI69jF5cGRu7dywPWwb2ewjxr+wSLSHc7HJdYyMbfjqrPEGja3h 89Rxn9tr6/tsHgNX0DJeeLmHsqiKHK5+aomenuXY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 25 Nov 2023 13:52:51 +0100 Subject: [PATCH RFC 2/7] bpf: cgroup: call proc handler through helper MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231125-const-sysctl-v1-2-5e881b0e0290@weissschuh.net> References: <20231125-const-sysctl-v1-0-5e881b0e0290@weissschuh.net> In-Reply-To: <20231125-const-sysctl-v1-0-5e881b0e0290@weissschuh.net> To: Kees Cook , "Gustavo A. R. Silva" , Luis Chamberlain , Iurii Zaikin , Greg Kroah-Hartman , Joel Granados Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1700916776; l=855; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=TvazAFFGE0otnXYiwQcMdxMBACDm5WWzmf21WwSH3Jk=; b=YdEbKegum1nk5186ZhIPwqPFp/VAJDdMZA4InijjRqP/7NAbrS1Qk9V7T+OhbslhbSi4ispVx jKuxCmX8CtFDorBAPbKAyM+pny1qZQU2W6Xbolh5PbFIiyaTYTPoO6C X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Sat, 25 Nov 2023 04:53:14 -0800 (PST) The sysctl core will introduce a second handler function. To prepare for this use the provided helper function to call either handler function. Signed-off-by: Thomas Weißschuh --- kernel/bpf/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c index 491d20038cbe..d537b1c80a36 100644 --- a/kernel/bpf/cgroup.c +++ b/kernel/bpf/cgroup.c @@ -1715,7 +1715,7 @@ int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head, ctx.cur_val = kmalloc_track_caller(ctx.cur_len, GFP_KERNEL); if (!ctx.cur_val || - table->proc_handler(table, 0, ctx.cur_val, &ctx.cur_len, &pos)) { + sysctl_run_handler(table, 0, ctx.cur_val, &ctx.cur_len, &pos)) { /* Let BPF program decide how to proceed. */ ctx.cur_len = 0; } -- 2.43.0