From patchwork Fri Jul 19 16:12:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via B4 Relay X-Patchwork-Id: 13737416 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 76A612CA6 for ; Fri, 19 Jul 2024 16:12:43 +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=1721405563; cv=none; b=LE5FsfD97EUNlxnI6G11LPCEr81B0xE15y+C4B5FHBL3tjRqweQMFDiCqBApy0uO9im/ulSnjMMEO8plNWWUB1yVEDjXYO+Muc5gP06HR+3cbgYJ+ssQ4cknQLs2Z7flM0FBhbf93s4A/JzaM52t57WSUtygZtLlfDKAnrOXay0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721405563; c=relaxed/simple; bh=hwFpOOZXNjN4VymfHrn632VSPvfq4GkUSetMM4BUh1k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AfidqHPT3KFZNtMMJkV6h5Vbl2LRDF+LEil7yT0VGBEjVO2uo/uqY0J+k++1tY9VmOcdV8bnG9+RtSHk8B0SysdLs+JhX819l+Uvn8XEau4uAbWgw0f4rJAd5aOskD9izq4DR60R28fzHbBPjYpsXRZrR7Ox9DhRwtzSPXgOfHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZCnKX5fo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZCnKX5fo" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2B8F2C4AF09; Fri, 19 Jul 2024 16:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721405563; bh=hwFpOOZXNjN4VymfHrn632VSPvfq4GkUSetMM4BUh1k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ZCnKX5foctJJ7lf60Ay6EBHZ801zaPxZ1FuO+kPMLURU5b1sxW72BcYx1+kVO7Zls ox9iTkD/Ul7oxi7BnRWatpZS292/VZEMSEBUp9iNIiVGJF+iaC+260wdrC/wYYkUJp csNPEddy0Zb7YQJKvNOgrhyyq62829guIKZuomv624CUjTM3cpnpVbhow5wtXQoder xcP/gJKgg4BkMw0WUKXr5Wu2N3xpwvFlCXhT+SEotBnIAsQlt98XU2Vh0nR+oPN8qJ eH+RRvJIzzcpeMxpTpz1RDVY53k40XnKAEUwFPuRdLfjoFh3g2aBTGSd2GrSZGDwt+ fONxxmHpshEow== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17DFAC3DA59; Fri, 19 Jul 2024 16:12:43 +0000 (UTC) From: Emil Velikov via B4 Relay Date: Fri, 19 Jul 2024 17:12:41 +0100 Subject: [PATCH kmod 1/3] libkmod: document KMOD_INDEX_MODULES_BUILTIN_ALIAS in kmod_dump_index() Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240719-abi-fixes-v1-1-1e6d99a2846b@gmail.com> References: <20240719-abi-fixes-v1-0-1e6d99a2846b@gmail.com> In-Reply-To: <20240719-abi-fixes-v1-0-1e6d99a2846b@gmail.com> To: linux-modules@vger.kernel.org Cc: Marco d'Itri , Eugene Syromiatnikov , Josh Boyer , Yauheni Kaliuta , Alexey Gladkov , Emil Velikov X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721405562; l=1746; i=emil.l.velikov@gmail.com; s=20230301; h=from:subject:message-id; bh=8AhtTXAyZZ10eWdz87tQwKwm866stviAIl/eVpSKW9U=; b=DB495+JOHzWaoxN3xLGaBrchoWkB1mvIa7tfARaIdUPZBMCoX/bHAf3YOHOrohst9OfbFmlf0 vgvXqYM92ryCI05jNUfGdBx6VF21rSpkzkeKlZzk5bbbfGyK665WZTc X-Developer-Key: i=emil.l.velikov@gmail.com; a=ed25519; pk=qeUTVTNyI3rcR2CfNNWsloTihgzmtbZo98GdxwZKCkY= X-Endpoint-Received: by B4 Relay for emil.l.velikov@gmail.com/20230301 with auth_id=35 X-Original-From: Emil Velikov Reply-To: emil.l.velikov@gmail.com From: Emil Velikov The extra enum was introduced a few years ago, although the (only) function using it did not have it's documentation updated. The commit itself has caused an ABI break with kmod v27, since the KMOD_INDEX_MODULES_BUILTIN value has changed. A search through Google, Github and Arch packages have shown one user of kmod_dump_index() - the only API that uses the enum. In that case and all others, no projects referencing the changed enum were found. Although since recent and/or supported distros use kmod v27 or later we've decided to only update the documentation. Cc: Alexey Gladkov Fixes: b866b21 ("Lookup aliases in the modules.builtin.modinfo") Signed-off-by: Emil Velikov Reviewed-by: Lucas De Marchi --- The project itself being https://github.com/falconindy/modtree which hasn't been updated in 12 years. The following distros/versions ship kmod v26 or older, where bunch of them are no longer supported. - RHEL 8 + community variants Alma/Amazon/CentOS/Rocky/Scientific - Alpine Linux 3.11 - Debian 10 + derivatives - Ubuntu 18.04 --- libkmod/libkmod.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c index 213b424..fecb8e7 100644 --- a/libkmod/libkmod.c +++ b/libkmod/libkmod.c @@ -971,6 +971,7 @@ KMOD_EXPORT void kmod_unload_resources(struct kmod_ctx *ctx) * KMOD_INDEX_MODULES_DEP: index of module dependencies; * KMOD_INDEX_MODULES_ALIAS: index of module aliases; * KMOD_INDEX_MODULES_SYMBOL: index of symbol aliases; + * KMOD_INDEX_MODULES_BUILTIN_ALIAS: index of builtin module aliases. * KMOD_INDEX_MODULES_BUILTIN: index of builtin module. * @fd: file descriptor to dump index to * From patchwork Fri Jul 19 16:12:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via B4 Relay X-Patchwork-Id: 13737419 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 884D414658F for ; Fri, 19 Jul 2024 16:12:43 +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=1721405563; cv=none; b=Zyajzs4/kuiSKpl646CxkpfpKHMHyiabnQF9U1bOYIic32cX8ranJ2zhcAQXtyWeIzRMQVsoUtmeUYrutuMMaozJrj/Xa60AhtI0vWkgJDJc1ibtGx/OADWeuQ1XFWO++aqZOgKvpo04tnssjV34BdzQDrWmxYoaF65RCy5DyiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721405563; c=relaxed/simple; bh=4Z1X0/NEpWF7dEXQ5UagP9W5av05YVLekK0PgcbiTvE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dBcN0JBcY/ry4soxDd1+OXA8BOXacHSLABEIzGSbsmc20coIC8gLW3NKAu3oKhNDLV8bkh6kf5BEUH505O99iWzCT7e9A29yjW+8z+2kTz86l+TEPEpGsn+w77HlEZs92O7CHNM4hnOXMkW+rIjp86aycn7HS5Dczz4Wg14aOWw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gg8o2a8F; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gg8o2a8F" Received: by smtp.kernel.org (Postfix) with ESMTPS id 33B34C4AF0A; Fri, 19 Jul 2024 16:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721405563; bh=4Z1X0/NEpWF7dEXQ5UagP9W5av05YVLekK0PgcbiTvE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gg8o2a8FRdJfs4uTrExg1/8JF4npYYLhrpS5w5MjrNZmX5wnNOd0RLH5U38Asdcjy mJVfAVl4Ev2a/MIIwitU93nFgriNHxTYjcm6215XgYirfGUkcp0a918Maw6SimSAUH 1i6agAmmjWoy8jFp0H9eWNVuVVzR0Hl1NqSEMlyGJHxFIkGiEN5aoKxaCOQbVm6Bm8 UKK/vWf9A8hp4AOCWXjpRMySFXMLJh/HUBzJXpy1gj8urTgsw3yawKEQZGKfHJrFbb 5pzru3TCuAyRSUo6OB+visIyW0W7vdt4A0E+P0eXRpx0KYEW7k0KBrvVSF/FT60PFm B/lVoOj5QXOSQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25674C3DA7E; Fri, 19 Jul 2024 16:12:43 +0000 (UTC) From: Emil Velikov via B4 Relay Date: Fri, 19 Jul 2024 17:12:42 +0100 Subject: [PATCH kmod 2/3] libkmod: correctly tag kmod_module_new_from_name_lookup Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240719-abi-fixes-v1-2-1e6d99a2846b@gmail.com> References: <20240719-abi-fixes-v1-0-1e6d99a2846b@gmail.com> In-Reply-To: <20240719-abi-fixes-v1-0-1e6d99a2846b@gmail.com> To: linux-modules@vger.kernel.org Cc: Marco d'Itri , Eugene Syromiatnikov , Josh Boyer , Yauheni Kaliuta , Emil Velikov X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721405562; l=1620; i=emil.l.velikov@gmail.com; s=20230301; h=from:subject:message-id; bh=M4YnV9+hVYcdsO1S8HqSahF+HvXqm0LQJKAHn27gLdo=; b=CWvNKRHtB3FB1a1Ns3kXWRUkuOZzV8crymOuKk7taaxD9SKalrBrpN117Ll3tDdj1Npu7nlHX xauKNpyRmAqBrY/24bMrQr1xhG4LTH27jif7eKi4X9Ir+c4dQQ9ery5 X-Developer-Key: i=emil.l.velikov@gmail.com; a=ed25519; pk=qeUTVTNyI3rcR2CfNNWsloTihgzmtbZo98GdxwZKCkY= X-Endpoint-Received: by B4 Relay for emil.l.velikov@gmail.com/20230301 with auth_id=35 X-Original-From: Emil Velikov Reply-To: emil.l.velikov@gmail.com From: Emil Velikov The symbol was introduced with v30, yet was erroneously added in the v5 section. Move it to the correct place. In theory this might cause an issue - severity depends on how the runtime linker is setup. From a harmless warning (on stderr/stdout) to failure to load the library. In practise this shouldn't be a problem, since there are seemingly no external users of the API. Fixes: 9becaae ("libkmod: Add lookup from module name") Signed-off-by: Emil Velikov Reviewed-by: Lucas De Marchi --- I'm fairly confident this commit won't cause an issue, although auditing the whole internet is not possible in practise. In my search I checked through Google, Github and all Arch packages using libkmod, namely: - dracut - igt-gpu-tools - libblockdev - ndctl - open-scsi - pciutils - stress-ng - systemd Another option is to make the symbol as internal, since it's used solely by modinfo which static links libkmod. ...we could also leave things as-is. --- libkmod/libkmod.sym | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libkmod/libkmod.sym b/libkmod/libkmod.sym index 0d6d338..e71f488 100644 --- a/libkmod/libkmod.sym +++ b/libkmod/libkmod.sym @@ -31,7 +31,6 @@ global: kmod_module_new_from_name; kmod_module_new_from_path; kmod_module_new_from_lookup; - kmod_module_new_from_name_lookup; kmod_module_new_from_loaded; kmod_module_ref; kmod_module_unref; @@ -94,3 +93,8 @@ LIBKMOD_22 { global: kmod_get_dirname; } LIBKMOD_6; + +LIBKMOD_30 { +global: + kmod_module_new_from_name_lookup; +} LIBKMOD_22; From patchwork Fri Jul 19 16:12:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via B4 Relay X-Patchwork-Id: 13737418 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 8848F14658C for ; Fri, 19 Jul 2024 16:12:43 +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=1721405563; cv=none; b=pbqv06TKVvViHbpKv2MXC13A0S++r8B6f+nQLhDc2e6PcSBknnHpb1C5NflVHZpB0j1z9n2W1DTF/HlEPbocZ4tZ5f9i+6GLHWb+8pnVw6zsAhYMQk3nMZg+qF2Zdw5vffFA/PtBkDGQeYziKm2NIPU7+DPUxUSDF+NA5DLDAg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721405563; c=relaxed/simple; bh=UoI+ccD8HhCUWMF2aMaB3XNFhs9AFtClFMVC57QrS/8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eVFUrxeL8dyCB0bzD1wCvdFp2k9cslHMmeEZohdP3JwZivzHXX62kfTKwe70aDui0NNC1yKt2XM48jAuY1fJHFZtnq71w8U3FJBZ7j6ReDZuEtzIViw1M+e4ePTouK4CvMFB8XjSvN9mJ9ajK/VgcoiJlSC10p29AAi2OwDMZBU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kJ3Z7ieB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kJ3Z7ieB" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3A3F0C4AF0B; Fri, 19 Jul 2024 16:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721405563; bh=UoI+ccD8HhCUWMF2aMaB3XNFhs9AFtClFMVC57QrS/8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=kJ3Z7ieBMvW+AYBuJ1Pla9YCzPlLMW08QH3JfPDRt4fbn7N/sjw4tSJqbRgy5mEWH wICr+dw9Uk+MherVAYz3gu37bIdVE07fq5LjEZ7jh0x7OF9bYLdYJBiFMX3lYOV6jq rnKFpJzsYSUb3seoCmSQlfZnfgXnspRJMZpLZyPClN2NYFqZD63/5vAzf2+GL3DJAu t1e0gHEpGHFRuQgF/XfsEzmvwGkIf8Aufh64/JMGIfIKHBn3bqSsNoi01H2MQyXzdM WKSOtTECQ7/B1kIgjgamcS+SRtvOJcRqSmZXaNe4//+IKbpf4WvHUkXY+XTeg9Ku/G +LVpXLghBHLZA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31A5BC3DA70; Fri, 19 Jul 2024 16:12:43 +0000 (UTC) From: Emil Velikov via B4 Relay Date: Fri, 19 Jul 2024 17:12:43 +0100 Subject: [PATCH kmod 3/3] libkmod: move new weak API to separate section Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240719-abi-fixes-v1-3-1e6d99a2846b@gmail.com> References: <20240719-abi-fixes-v1-0-1e6d99a2846b@gmail.com> In-Reply-To: <20240719-abi-fixes-v1-0-1e6d99a2846b@gmail.com> To: linux-modules@vger.kernel.org Cc: Marco d'Itri , Eugene Syromiatnikov , Josh Boyer , Yauheni Kaliuta , Jose Ignacio Tornos Martinez , Emil Velikov X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721405562; l=1334; i=emil.l.velikov@gmail.com; s=20230301; h=from:subject:message-id; bh=vGLxbr7hhKT9ywrDmQYwW4P0+rL1j1tEnx5Lr/UUei0=; b=HkChS8BpMWSSsXkfB88Of9BJ3gC2qimdMCLTgfjlqyPIHnrwE1GaU/SjNRxecEZUABX/Y2HTE k1drtkMMPJeC8heA5dbSw7qoJsPjIGAhOqS0BbBnvaReZ5moP7k4IFK X-Developer-Key: i=emil.l.velikov@gmail.com; a=ed25519; pk=qeUTVTNyI3rcR2CfNNWsloTihgzmtbZo98GdxwZKCkY= X-Endpoint-Received: by B4 Relay for emil.l.velikov@gmail.com/20230301 with auth_id=35 X-Original-From: Emil Velikov Reply-To: emil.l.velikov@gmail.com From: Emil Velikov Add the new weak API, to a separate section in the version script. These will be exposed with the upcoming v33 release and not with v5 as the symbol tag implies. Cc: Jose Ignacio Tornos Martinez Fixes: 05828b4 ("libkmod: add weak dependecies") Signed-off-by: Emil Velikov Reviewed-by: Lucas De Marchi --- This might be a bit of nuisance for Debian which has a git packages in unstable. @Marco I think you'd _really_ want this for unstable. --- libkmod/libkmod.sym | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libkmod/libkmod.sym b/libkmod/libkmod.sym index e71f488..0046300 100644 --- a/libkmod/libkmod.sym +++ b/libkmod/libkmod.sym @@ -21,7 +21,6 @@ global: kmod_config_get_aliases; kmod_config_get_options; kmod_config_get_softdeps; - kmod_config_get_weakdeps; kmod_config_iter_get_key; kmod_config_iter_get_value; kmod_config_iter_next; @@ -42,7 +41,6 @@ global: kmod_module_get_dependencies; kmod_module_get_softdeps; - kmod_module_get_weakdeps; kmod_module_get_filtered_blacklist; kmod_module_get_name; @@ -98,3 +96,9 @@ LIBKMOD_30 { global: kmod_module_new_from_name_lookup; } LIBKMOD_22; + +LIBKMOD_33 { +global: + kmod_config_get_weakdeps; + kmod_module_get_weakdeps; +} LIBKMOD_30;