Message ID | 20240201130943.19536-1-mkoutny@suse.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-48198-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp137959dyb; Thu, 1 Feb 2024 05:11:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMxgnKN0QoRfNdHPd/kXXmyVNcQVht+IuWHA6iVej4Ru5FyyfS16yPztixDmE+O68tTdXR X-Received: by 2002:a05:622a:11c3:b0:42b:f615:7b29 with SMTP id n3-20020a05622a11c300b0042bf6157b29mr1390894qtk.3.1706793083027; Thu, 01 Feb 2024 05:11:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706793083; cv=pass; d=google.com; s=arc-20160816; b=N0NoX4LkadSEffvmj8u0bmrDupw1FNaijRchh67/IdXGT2tbkiFI9vdtP7puFjpUqo b8P8iX72arYnAwSFQSljAqzABgLHaO+N4J9PIlU4L0ehZ+sYJ5SSVDwDZHa1ffCQ2mKo YO+ATwR6kXSftm3Y1Tzc6AE7A8VN/5/HejLmVxKjgbm7SKXx/9eXm66r/lVp/Zmfz9Ia vRxVyTFsD6N6HEkmeUo/8Kj085NKXyNRv8JbWYJU9OyJkI6RXKxqsDK8iGFh2933xczt xIHH1rS4PQoQ0z2cO9XJs4moQ+rkj7eYCXY/0MPZJJ2vVFa2vIU3A2NQjnIu4NlExmm2 mC2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=0PVDSYqJ1G0wsY/wIF6aCbRfwUggmS4ekfVfUCAcpvM=; fh=rIriOTCAZ3oMSDyoC51jVVpLaedw4sAZl8swfS0SK+4=; b=DxZD9/H3/n/8Mt6xhXuiGtLrRP11gBhxABXASXZ8SlLzADQakUIUKGPUWKf58nf/xA FAFMjDHz2sy8JkS1EID8ntC6PjidEz70cqPeYMxA94Piz68m9HmQ4d9h7t27eca1c8Qo K1qcoIJBaNdat/VWdwPH8DBOWqKxztpHkYD2sECejSF/yAODQdrDYezXCju2pDzeSU+E 0JYJHmgemMZhWrwpEDyTo9hSLeYdxW9l639mODhwJTMneBRlKgLofmPWvLrgkrJ86+SY MLixkDcJfxAxLYCch2rYogM0195wsGsiApb4YrNuReZ7IqcY23GrD45QQJma0guMjCGM k99g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=k2fm2hyG; dkim=pass header.i=@suse.com header.s=susede1 header.b=k2fm2hyG; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-48198-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48198-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=1; AJvYcCU5ubKt/bMWAAEf5FKUDgwoosip0KMGpL2X5R+R/KT1g2u3WiyhoSzyzDAd6kPiZpP/FyydVQ5tD53uGwRnqLWdcgrDig== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c10-20020ac87dca000000b0042bf2bfec86si1354907qte.803.2024.02.01.05.11.22 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 05:11:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48198-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=k2fm2hyG; dkim=pass header.i=@suse.com header.s=susede1 header.b=k2fm2hyG; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-48198-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48198-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com 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 BC76D1C20365 for <ouuuleilei@gmail.com>; Thu, 1 Feb 2024 13:11:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF7FE5F47D; Thu, 1 Feb 2024 13:09:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="k2fm2hyG"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="k2fm2hyG" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85D7E53363; Thu, 1 Feb 2024 13:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706792990; cv=none; b=kC4Ms7a9X17xkhP5LcOKTXCrWlzql6Fla9LC9fy5JDDQPCwm06wOYTLE67jsYEst7q+kSf9zbrVbYR4cpT/khrJwOlKGzxYkcbEreWZuxes03MP1o4O4dLVAGpTn1J1CvPmzQFPJD+lst5eIqPmmKr0K+dYmwu7DCk5QefAR8U0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706792990; c=relaxed/simple; bh=TtPjt/x5e69CeWXDn7QeqQ1izpa9yi+Ue9HOIxIVdD8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jtC2fPBIc8MgGoh2uYO/9fKbPI26pVtKBdLMJpKYDHDBjT9aR2f+BlU0ojGl2/F6l+14JgJ5t05kZhpAoHrne5Szu7YX18/m71mMk/G0/dVmRJavx3eqhVbnLGrmlf3y58MjQEG1+F6hchfgikWgJ2NWmv2AY7YU7PYbln5BeRI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=k2fm2hyG; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=k2fm2hyG; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9CE8A1FBB1; Thu, 1 Feb 2024 13:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706792985; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0PVDSYqJ1G0wsY/wIF6aCbRfwUggmS4ekfVfUCAcpvM=; b=k2fm2hyGE6CxZcd2Y/GRhIFRm+yVvlhxpRO+J4FX7YqxZzWuz9MMDZwAO4tq7f/26ozDql VNLxPX0MUUoq2huRB3r7KadFyndwNj1AEak2CaF8VwYHEWVEYKmSGVYA1m4Y44aa2fCK5J uUqxkTZ1CWHGOpNiU6D6fS7o+EZMCPs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706792985; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0PVDSYqJ1G0wsY/wIF6aCbRfwUggmS4ekfVfUCAcpvM=; b=k2fm2hyGE6CxZcd2Y/GRhIFRm+yVvlhxpRO+J4FX7YqxZzWuz9MMDZwAO4tq7f/26ozDql VNLxPX0MUUoq2huRB3r7KadFyndwNj1AEak2CaF8VwYHEWVEYKmSGVYA1m4Y44aa2fCK5J uUqxkTZ1CWHGOpNiU6D6fS7o+EZMCPs= Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 788CD1329F; Thu, 1 Feb 2024 13:09:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id 25DkHBmYu2VafgAAn2gu4w (envelope-from <mkoutny@suse.com>); Thu, 01 Feb 2024 13:09:45 +0000 From: =?utf-8?q?Michal_Koutn=C3=BD?= <mkoutny@suse.com> To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, cake@lists.bufferbloat.net Cc: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jamal Hadi Salim <jhs@mojatatu.com>, Cong Wang <xiyou.wangcong@gmail.com>, Jiri Pirko <jiri@resnulli.us>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, Martin KaFai Lau <martin.lau@linux.dev>, Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>, Yonghong Song <yonghong.song@linux.dev>, John Fastabend <john.fastabend@gmail.com>, KP Singh <kpsingh@kernel.org>, Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>, =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>, Vinicius Costa Gomes <vinicius.gomes@intel.com>, Stephen Hemminger <stephen@networkplumber.org>, Simon Horman <horms@kernel.org>, Pedro Tammela <pctammela@mojatatu.com> Subject: [PATCH v5 0/4] net/sched: Load modules via alias Date: Thu, 1 Feb 2024 14:09:39 +0100 Message-ID: <20240201130943.19536-1-mkoutny@suse.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -1.80 X-Spamd-Result: default: False [-1.80 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-3.00)[100.00%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLk7of1183i6tu11bgyseu9iy5)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[28]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[davemloft.net,google.com,kernel.org,redhat.com,mojatatu.com,gmail.com,resnulli.us,iogearbox.net,linux.dev,toke.dk,intel.com,networkplumber.org]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789702263772683865 X-GMAIL-MSGID: 1789702263772683865 |
Series | net/sched: Load modules via alias | |
Message
Michal Koutný
Feb. 1, 2024, 1:09 p.m. UTC
These modules may be loaded lazily without user's awareness and control. Add respective aliases to modules and request them under these aliases so that modprobe's blacklisting mechanism (through aliases) works for them. (The same pattern exists e.g. for filesystem modules.) For example (before the change): $ tc filter add dev lo parent 10: protocol ip prio 10 handle 1: cgroup # cls_cgroup module is loaded despite a `blacklist cls_cgroup` entry # in /etc/modprobe.d/*.conf After the change: $ tc filter add dev lo parent 10: protocol ip prio 10 handle 1: cgroup Error: TC classifier not found. We have an error talking to the kernel # explicit/acknowledged (privileged) action is needed $ modprobe cls_cgroup # blacklist entry won't apply to this direct modprobe, module is # loaded with awareness A considered alternative was invoking `modprobe -b` always from request_module(), however, dismissed as too intrusive and slightly confusing in favor of the precedented aliases (the commit 7f78e0351394 ("fs: Limit sys_mount to only request filesystem modules."). User experience suffers in both alternatives. Its improvement is orthogonal to blacklist honoring. Changes from v1 (https://lore.kernel.org/r/20231121175640.9981-1-mkoutny@suse.com) - Treat sch_ and act_ modules analogously to cls_ Changes from v2 (https://lore.kernel.org/r/20231206192752.18989-1-mkoutny@suse.com) - reorganized commits (one generated commit + manual pre-/post- work) - used alias names more fitting the existing net- aliases - more info in commit messages and cover letter - rebased on current master Changes from v3 (https://lore.kernel.org/r/20240112180646.13232-1-mkoutny@suse.com) - rebase on netdev/net-next/main - correct aliases in cls_* modules (wrong sed) - replace repeated prefix strings with a macro - patch also request_module call in qdisc_set_default() Changes from v4 (https://lore.kernel.org/r/20240123135242.11430-1-mkoutny@suse.com) - update example in cover letter to existing module (cls_tcindex->cls_cgroup) - tested that ':-) - remove __stringify in alias macro, net-cls-cgroup instead of net-cls-"cgroup" - pass correct argument to request_module() (Simon) - rebased on netdev-next/main Michal Koutný (4): net/sched: Add helper macros with module names net/sched: Add module aliases for cls_,sch_,act_ modules net/sched: Load modules via their alias net/sched: Remove alias of sch_clsact include/net/act_api.h | 2 ++ include/net/pkt_cls.h | 2 ++ include/net/pkt_sched.h | 2 ++ net/sched/act_api.c | 2 +- net/sched/act_bpf.c | 1 + net/sched/act_connmark.c | 1 + net/sched/act_csum.c | 1 + net/sched/act_ct.c | 1 + net/sched/act_ctinfo.c | 1 + net/sched/act_gact.c | 1 + net/sched/act_gate.c | 1 + net/sched/act_ife.c | 1 + net/sched/act_mirred.c | 1 + net/sched/act_mpls.c | 1 + net/sched/act_nat.c | 1 + net/sched/act_pedit.c | 1 + net/sched/act_police.c | 1 + net/sched/act_sample.c | 1 + net/sched/act_simple.c | 1 + net/sched/act_skbedit.c | 1 + net/sched/act_skbmod.c | 1 + net/sched/act_tunnel_key.c | 1 + net/sched/act_vlan.c | 1 + net/sched/cls_api.c | 2 +- net/sched/cls_basic.c | 1 + net/sched/cls_bpf.c | 1 + net/sched/cls_cgroup.c | 1 + net/sched/cls_flow.c | 1 + net/sched/cls_flower.c | 1 + net/sched/cls_fw.c | 1 + net/sched/cls_matchall.c | 1 + net/sched/cls_route.c | 1 + net/sched/cls_u32.c | 1 + net/sched/sch_api.c | 4 ++-- net/sched/sch_cake.c | 1 + net/sched/sch_cbs.c | 1 + net/sched/sch_choke.c | 1 + net/sched/sch_codel.c | 1 + net/sched/sch_drr.c | 1 + net/sched/sch_etf.c | 1 + net/sched/sch_ets.c | 1 + net/sched/sch_fq.c | 1 + net/sched/sch_fq_codel.c | 1 + net/sched/sch_gred.c | 1 + net/sched/sch_hfsc.c | 1 + net/sched/sch_hhf.c | 1 + net/sched/sch_htb.c | 1 + net/sched/sch_ingress.c | 3 ++- net/sched/sch_mqprio.c | 1 + net/sched/sch_multiq.c | 1 + net/sched/sch_netem.c | 1 + net/sched/sch_pie.c | 1 + net/sched/sch_plug.c | 1 + net/sched/sch_prio.c | 1 + net/sched/sch_qfq.c | 1 + net/sched/sch_red.c | 1 + net/sched/sch_sfb.c | 1 + net/sched/sch_sfq.c | 1 + net/sched/sch_skbprio.c | 1 + net/sched/sch_taprio.c | 1 + net/sched/sch_tbf.c | 1 + 61 files changed, 66 insertions(+), 5 deletions(-) base-commit: 644c64318de0df5f4ea9f00e4b8cc262b343a93f
Comments
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Thu, 1 Feb 2024 14:09:39 +0100 you wrote: > These modules may be loaded lazily without user's awareness and > control. Add respective aliases to modules and request them under these > aliases so that modprobe's blacklisting mechanism (through aliases) > works for them. (The same pattern exists e.g. for filesystem > modules.) > > For example (before the change): > $ tc filter add dev lo parent 10: protocol ip prio 10 handle 1: cgroup > # cls_cgroup module is loaded despite a `blacklist cls_cgroup` entry > # in /etc/modprobe.d/*.conf > > [...] Here is the summary with links: - [v5,1/4] net/sched: Add helper macros with module names https://git.kernel.org/netdev/net-next/c/b26577001af4 - [v5,2/4] net/sched: Add module aliases for cls_,sch_,act_ modules https://git.kernel.org/netdev/net-next/c/241a94abcf46 - [v5,3/4] net/sched: Load modules via their alias https://git.kernel.org/netdev/net-next/c/2c15a5aee2f3 - [v5,4/4] net/sched: Remove alias of sch_clsact https://git.kernel.org/netdev/net-next/c/6cff01581789 You are awesome, thank you!