From nobody Sat Nov 23 05:15:18 2024 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 320531F8F0B; Thu, 14 Nov 2024 10:31:48 +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=1731580309; cv=none; b=D/YiAKqVCaECZ4IE6kNleCWjJH9Dxh2Qh0wBLaSBPIgMv9rlscJwhZvi2tqOrsxQb8uJZcb69h6fR28c019mVFJdjHjQR8VTSC0D6W+00mKhisLEmaSyg14eqf2iwEPnIwTruKRmAPxPmKLICm+VSmqaYpvd7s2ZTfXF7vM75iw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731580309; c=relaxed/simple; bh=e7Kv5H6ICil1nLzt3NYP114OkhApUX6xbrbhiUW00fA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DK4Q6/BVhuz7w9WVJmXtOAKlQWUh8jhL8nxsSsjDAuC1X6qFYDs8/5PeuZ4HaYhBbLJfB+aZ1RTKY2RSiuTSgTDZMtj09QpTRZ/AC/7HUxtrKWm30TcbMmECgxDAcbjnTjnwTvJ6JpW8Waq4+5BueQiQ621BPa1g/y8zjjBKN6o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vF5MYQed; 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="vF5MYQed" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30DCFC4CECD; Thu, 14 Nov 2024 10:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731580308; bh=e7Kv5H6ICil1nLzt3NYP114OkhApUX6xbrbhiUW00fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vF5MYQedB0REIKSNg/FLuVHeCXLxYAew4eFrJHYUMW0jQ2O9fCq/ebNE12pustAKL x87+TVMYD2w7t0DUBdnMimkPRGtRRNnpBR7wKYKKzXhpyNc8x6NzQ0pf8R6qk5Z5XM uOWezp38lvOJTiGe1bY+6QxcY5NB6BjdGlOdU8PHJKk/WOJ3XfIkNKSSVeAvNy7eUV F9ZvKnQzlRxbVQ8l6xYTHnuNEAzg3VfWu+ykjc4PBHxMPWoHO9JDr6xxRvU24SUDya udcJO9S2vY3EiMtn8SA3yEmJbmr+Mmi9xbz8LUL9p9vs6fvY3Hsiw1ATfIo0YiRP3f vD9DYhB892q7Q== From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Luis Chamberlain Cc: Werner Sembach , tux@tuxedocomputers.com, Petr Pavlu , Sami Tolvanen , Daniel Gomez , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, Thorsten Leemhuis Subject: [PATCH 1/2] module: Put known GPL offenders in an array Date: Thu, 14 Nov 2024 11:31:33 +0100 Message-ID: <20241114103133.547032-5-ukleinek@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114103133.547032-4-ukleinek@kernel.org> References: <20241114103133.547032-4-ukleinek@kernel.org> 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" X-Developer-Signature: v=1; a=openpgp-sha256; l=2109; i=ukleinek@kernel.org; h=from:subject; bh=e7Kv5H6ICil1nLzt3NYP114OkhApUX6xbrbhiUW00fA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBnNdGHLLvJH63zK3KlJYxSiv0fheuwhbx9HeKzx N49KScbzvWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZzXRhwAKCRCPgPtYfRL+ Tg9GB/9xsjdS29pA3GOb9iqYNvM4F4E2DPRSyCxHpBfLznY+FroS+8yER4dr417soNCiOUfQQJo zaVvuaWPxqWx57uRByaAiYa/ou2lYbAmD0x2vZmpgAF2lf9OR9jD7qtn4ZayMtzlYZoX3ogFCQf QeE5DTwq+Rea6O9/bP1mzW387vvcODy81ur198dFFwZytt1Y1YxIQYR/edyWZr+TD+IMuHaojVM x/mo2hQ7OAu6hXbmPZyyJrzFK2g2/3RZElCFYQ5//IDP6P8ds6TS76nhFdZZAnAwBueQogDYhcc aAl6s6Dht75+uW7lHTWzpak55bMmPbx4T4NN6296Z8PqQ01n X-Developer-Key: i=ukleinek@kernel.org; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable Instead of repeating the add_taint_module() call for each offender, create an array and loop over that one. This simplifies adding new entries considerably. Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman --- kernel/module/main.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index 5399c182b3cb..878191c65efc 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2332,11 +2332,20 @@ static int rewrite_section_headers(struct load_info= *info, int flags) return 0; } =20 +static const char *module_license_offenders[] =3D { + /* driverloader was caught wrongly pretending to be under GPL */ + "driverloader", + + /* lve claims to be GPL but upstream won't provide source */ + "lve", +}; + /* * These calls taint the kernel depending certain module circumstances */ static void module_augment_kernel_taints(struct module *mod, struct load_i= nfo *info) { int prev_taint =3D test_taint(TAINT_PROPRIETARY_MODULE); + size_t i; =20 if (!get_modinfo(info, "intree")) { if (!test_taint(TAINT_OOT_MODULE)) @@ -2385,15 +2394,11 @@ static void module_augment_kernel_taints(struct mod= ule *mod, struct load_info *i if (strcmp(mod->name, "ndiswrapper") =3D=3D 0) add_taint(TAINT_PROPRIETARY_MODULE, LOCKDEP_NOW_UNRELIABLE); =20 - /* driverloader was caught wrongly pretending to be under GPL */ - if (strcmp(mod->name, "driverloader") =3D=3D 0) - add_taint_module(mod, TAINT_PROPRIETARY_MODULE, - LOCKDEP_NOW_UNRELIABLE); - - /* lve claims to be GPL but upstream won't provide source */ - if (strcmp(mod->name, "lve") =3D=3D 0) - add_taint_module(mod, TAINT_PROPRIETARY_MODULE, - LOCKDEP_NOW_UNRELIABLE); + for (i =3D 0; i < ARRAY_SIZE(module_license_offenders); ++i) { + if (strcmp(mod->name, module_license_offenders[i]) =3D=3D 0) + add_taint_module(mod, TAINT_PROPRIETARY_MODULE, + LOCKDEP_NOW_UNRELIABLE); + } =20 if (!prev_taint && test_taint(TAINT_PROPRIETARY_MODULE)) pr_warn("%s: module license taints kernel.\n", mod->name); --=20 2.45.2 From nobody Sat Nov 23 05:15:18 2024 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 D03701FAC47; Thu, 14 Nov 2024 10:31:51 +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=1731580311; cv=none; b=uY6LvXsdQ8oZC8rPyUKpYJpm50C1wi9CXX4bbity/jO6w+T0YY59ZOKaPDDrmcqf6FSHc0VxA0LeAQ9QKa+BuVJ4J9wahVT++neB1ov6UPC56D8BWjTdlBCSX0E2b5B1RHhj+2+enHQgz3FcsDPonZoHhZuVh99d82N5JD5Rt1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731580311; c=relaxed/simple; bh=PvtFbg/8OOw9SaJ63G51HlH+PGdB8FZuVIeCmRurLBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l5TGd+wpWYO0nWSAcE2PrGJM5TCdoaQRaMDeCCySnQfiQD/WWyPTXeo0h8yanrPw3neAcuzJGEEabqG3harksEvMB2dy01f2Vr3paXL5sfH46RD3vCCRaHxZhYCIK52lp5NYkmDs7Raijb/eAhww/LvRbofsUsmqJ7XBpUckfHQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LHGS4Z8F; 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="LHGS4Z8F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5234EC4CECD; Thu, 14 Nov 2024 10:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731580311; bh=PvtFbg/8OOw9SaJ63G51HlH+PGdB8FZuVIeCmRurLBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LHGS4Z8F0wL30Lex/0uqMZFucCEXI1nFoncTAeW5vuigAA8+b7gR1JsyvEdqyJVME I8fEu/64CvkiMa02Wj1eZukHaKJ1FDHN2uwQ6GjXZjfoXgAeooO/tWLVwBVeO6QUru arXJjQ2+VjqCyRIdxQx09FnYa3DgImEGdEvthKyFpX1N3e8HnY3wAzgEM4sh0Gtq7l 9lMWEY+pRfALVU1Oy5ke+4Kd4ZlHkDj+M1BgNs/FAnbMstgjJo76vaZgT5toTpmFvQ Kcp3uMOg3VcI7qUTzKL4tLhRPMvF/e69yRCehWTAYHxQR9CPs0sW89KES4KTRMO/Dg rrlAlfloMvM/A== From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Luis Chamberlain Cc: Werner Sembach , tux@tuxedocomputers.com, Petr Pavlu , Sami Tolvanen , Daniel Gomez , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, Thorsten Leemhuis Subject: [PATCH 2/2] module: Block modules by Tuxedo from accessing GPL symbols Date: Thu, 14 Nov 2024 11:31:34 +0100 Message-ID: <20241114103133.547032-6-ukleinek@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114103133.547032-4-ukleinek@kernel.org> References: <20241114103133.547032-4-ukleinek@kernel.org> 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" X-Developer-Signature: v=1; a=openpgp-sha256; l=2072; i=ukleinek@kernel.org; h=from:subject; bh=PvtFbg/8OOw9SaJ63G51HlH+PGdB8FZuVIeCmRurLBE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBnNdGKZw0mWE7g1hW0HBpcAD8ExG6wnwPUjm1qA kSwKe5ZvrKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZzXRigAKCRCPgPtYfRL+ TtkrB/4rIFmp9c+r8N9S94itqsftcS4Kbq6QmiC/frrvUpaYaB23tXERKy8bFqrq18+P9UEDGG/ Ocn6aGWji3HRYFBX1VWTyRwvdKvN/cppS8RYGKQjzdXWxh0QJzEs5u46W3vWQwVcL3CyhkxA4Ai 5KOW5xbnl4FCoisUa5U98eZdohaRS4vS/enfzd1tt2S4ZTLCzinb4WcD6Urlhi2BVk0kRuJTWhn cx13X/3uSQK2OEYxUvepHzz60UhRJzisdpMlgCs1n3RyMI3irMrwHejdBGZILg8vi6NVDvHkCPd fmy2jNxqS4AvdJqucu+YVXDKZpZAuaD81ocYy2tUgsp3v05q X-Developer-Key: i=ukleinek@kernel.org; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable Tuxedo licenses the modules used on their hardware under GPLv3+, to "keep control of the upstream pacing" =E2=80=93 and want to re-license the = code while upstreaming. They were asked to then at least not use MODULE_LICENSE("GPL") which declares compatibility to the kernel's GPLv2. They accepted the pull request and shortly after reverted the change and so continue to lie about the license. So teach the module loader that these modules are proprietary despite their declaration to be GPLv2 compatible "until the legal stuff is sorted out". Link: https://gitlab.com/tuxedocomputers/development/packages/tuxedo-driver= s/-/commit/a8c09b6c2ce6393fe39d8652d133af9f06cfb427 Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman --- kernel/module/main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/kernel/module/main.c b/kernel/module/main.c index 878191c65efc..46badbb09d5e 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2338,6 +2338,39 @@ static const char *module_license_offenders[] =3D { =20 /* lve claims to be GPL but upstream won't provide source */ "lve", + + /* + * Tuxedo distributes their kernel modules under GPLv3, but intentially + * lies in their MODULE_LICENSE() calls. + * See https://gitlab.com/tuxedocomputers/development/packages/tuxedo-dri= vers/-/commit/a8c09b6c2ce6393fe39d8652d133af9f06cfb427 + */ + "gxtp7380", + "ite_8291", + "ite_8291_lb", + "ite_8297", + "ite_829x", + "stk8321", + "tuxedo_compatibility_check", + "tuxedo_io", + "tuxedo_nb02_nvidia_power_ctrl", + "tuxedo_nb04_keyboard", + "tuxedo_nb04_wmi_ab", + "tuxedo_nb04_wmi_bs", + "tuxedo_nb04_sensors", + "tuxedo_nb04_power_profiles", + "tuxedo_nb04_kbd_backlight", + "tuxedo_nb05_keyboard", + "tuxedo_nb05_kbd_backlight", + "tuxedo_nb05_power_profiles", + "tuxedo_nb05_ec", + "tuxedo_nb05_sensors", + "tuxedo_nb05_fan_control", + "tuxi_acpi", + "tuxedo_tuxi_fan_control", + "clevo_wmi", + "tuxedo_keyboard", + "clevo_acpi", + "uniwill_wmi", }; =20 /* --=20 2.45.2