From nobody Sat Apr 18 12:37:21 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50E7AC43334 for ; Thu, 14 Jul 2022 15:39:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239921AbiGNPjo (ORCPT ); Thu, 14 Jul 2022 11:39:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240120AbiGNPjm (ORCPT ); Thu, 14 Jul 2022 11:39:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 76347252BE for ; Thu, 14 Jul 2022 08:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657813180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gdTH44nst3sD0nXnKIJ6b64daWYUB1e/UFpgOGWaKDE=; b=MmA4vD9Ul1BxlU7OBFix6jO7AnjT8Oop8Q+yvIQBBxxegDpvv2cw2uQPCAq68R9D5tWpHv lmICIOfyfLg4E7XWrjlUuky4PWa3CzTjkwtpzqfI0UhUvGVmGWxGCX4+Y82WuOjL1wHPwp d9LKAFKWHZPw/a2ZlXyCG5OHDOlt2dY= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-Y-6czHVSMQSzlclOYTi_rQ-1; Thu, 14 Jul 2022 11:39:38 -0400 X-MC-Unique: Y-6czHVSMQSzlclOYTi_rQ-1 Received: by mail-wm1-f71.google.com with SMTP id bg6-20020a05600c3c8600b003a03d5d19e4so914817wmb.1 for ; Thu, 14 Jul 2022 08:39:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gdTH44nst3sD0nXnKIJ6b64daWYUB1e/UFpgOGWaKDE=; b=CsU9U8l2KHqTulSEZ46aCllSRVZKQUtfy20HBqin9Ssjwq8qVXautHGXc6LHqeIE9c iguWUp8CGVoDR5gYluP4ja0UIpvttt5g898PmH3iuVzqbdC9XdDzqgnqz+WqYBHEBW45 0/nf0KlZ+5gsM3HbfuqjpHPnzRLiVAMHl8CA4a7X1bHk74PNslmaOF1WCaA3A3TOoEzU PMt/NLLX4IAzmD784uNEkVX9SN9OIe+2jh6gffDOMGs0wrjyP2ApJoULUvr1B74cUfzv GY/jBmescOwTG8XVp/tBzcnJBM84bSBebvG63vDlSIOWMTjaP96Rn14+25MUQ4XUHuL3 j7mg== X-Gm-Message-State: AJIora8J5rzOlqewsczCvVX06zyZ1WwyMhtkr8R+oE2zZ4MMNyWVDO0t 7SBMg00scdpexdF0FiXG5Lqt1RLCJB9U/hueIquSMY1nAOW3LS4IVPzW5G1GwGjv/Fc7FaiOpop mVhS8dP8ZoIgJH+Lv4u3mo8Y= X-Received: by 2002:a7b:c3d8:0:b0:3a2:fcc8:323 with SMTP id t24-20020a7bc3d8000000b003a2fcc80323mr8807231wmj.132.1657813177400; Thu, 14 Jul 2022 08:39:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v++nxe/HILzUPTol9MJsOq7z9uFWwle2BGD1WmbDuxwTakpTSviO6mtFLYqYSEKeUfbmFKiw== X-Received: by 2002:a7b:c3d8:0:b0:3a2:fcc8:323 with SMTP id t24-20020a7bc3d8000000b003a2fcc80323mr8807216wmj.132.1657813177237; Thu, 14 Jul 2022 08:39:37 -0700 (PDT) Received: from localhost (cpc111743-lutn13-2-0-cust979.9-3.cable.virginm.net. [82.17.115.212]) by smtp.gmail.com with ESMTPSA id m21-20020a05600c4f5500b0039c5ab7167dsm5870301wmq.48.2022.07.14.08.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 08:39:36 -0700 (PDT) From: Aaron Tomlin To: mcgrof@kernel.org, christophe.leroy@csgroup.eu Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, atomlin@atomlin.com, oleksandr@natalenko.name, neelx@redhat.com Subject: [PATCH v2 1/3] module: Modify module_flags() to accept show_state argument Date: Thu, 14 Jul 2022 16:39:31 +0100 Message-Id: <20220714153933.2095776-2-atomlin@redhat.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220714153933.2095776-1-atomlin@redhat.com> References: <20220714153933.2095776-1-atomlin@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" No functional change. With this patch a given module's state information (i.e. 'mod->state') can be omitted from the specified buffer. Please note that this is in preparation to include the last unloaded module's taint flag(s), if available. Signed-off-by: Aaron Tomlin --- kernel/module/internal.h | 2 +- kernel/module/main.c | 11 +++++++---- kernel/module/procfs.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/kernel/module/internal.h b/kernel/module/internal.h index bc5507ab8450..60312f23c7d0 100644 --- a/kernel/module/internal.h +++ b/kernel/module/internal.h @@ -100,7 +100,7 @@ struct module *find_module_all(const char *name, size_t= len, bool even_unformed) int cmp_name(const void *name, const void *sym); long module_get_offset(struct module *mod, unsigned int *size, Elf_Shdr *s= echdr, unsigned int section); -char *module_flags(struct module *mod, char *buf); +char *module_flags(struct module *mod, char *buf, bool show_state); size_t module_flags_taint(unsigned long taints, char *buf); =20 static inline void module_assert_mutex_or_preempt(void) diff --git a/kernel/module/main.c b/kernel/module/main.c index fed58d30725d..a4d23b0ebbc0 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2970,24 +2970,27 @@ static void cfi_cleanup(struct module *mod) } =20 /* Keep in sync with MODULE_FLAGS_BUF_SIZE !!! */ -char *module_flags(struct module *mod, char *buf) +char *module_flags(struct module *mod, char *buf, bool show_state) { int bx =3D 0; =20 BUG_ON(mod->state =3D=3D MODULE_STATE_UNFORMED); + if (!mod->taints && !show_state) + goto out; if (mod->taints || mod->state =3D=3D MODULE_STATE_GOING || mod->state =3D=3D MODULE_STATE_COMING) { buf[bx++] =3D '('; bx +=3D module_flags_taint(mod->taints, buf + bx); /* Show a - for module-is-being-unloaded */ - if (mod->state =3D=3D MODULE_STATE_GOING) + if (mod->state =3D=3D MODULE_STATE_GOING && show_state) buf[bx++] =3D '-'; /* Show a + for module-is-being-loaded */ - if (mod->state =3D=3D MODULE_STATE_COMING) + if (mod->state =3D=3D MODULE_STATE_COMING && show_state) buf[bx++] =3D '+'; buf[bx++] =3D ')'; } +out: buf[bx] =3D '\0'; =20 return buf; @@ -3120,7 +3123,7 @@ void print_modules(void) list_for_each_entry_rcu(mod, &modules, list) { if (mod->state =3D=3D MODULE_STATE_UNFORMED) continue; - pr_cont(" %s%s", mod->name, module_flags(mod, buf)); + pr_cont(" %s%s", mod->name, module_flags(mod, buf, true)); } =20 print_unloaded_tainted_modules(); diff --git a/kernel/module/procfs.c b/kernel/module/procfs.c index 9a8f4f0f6329..cf5b9f1e6ec4 100644 --- a/kernel/module/procfs.c +++ b/kernel/module/procfs.c @@ -91,7 +91,7 @@ static int m_show(struct seq_file *m, void *p) =20 /* Taints info */ if (mod->taints) - seq_printf(m, " %s", module_flags(mod, buf)); + seq_printf(m, " %s", module_flags(mod, buf, true)); =20 seq_puts(m, "\n"); return 0; --=20 2.34.3 From nobody Sat Apr 18 12:37:21 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66DC3C433EF for ; Thu, 14 Jul 2022 15:39:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240398AbiGNPjq (ORCPT ); Thu, 14 Jul 2022 11:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240311AbiGNPjn (ORCPT ); Thu, 14 Jul 2022 11:39:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00EA328706 for ; Thu, 14 Jul 2022 08:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657813181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mpFwBg17MPLedEeXsKR0g11KSb+p+AI/SVxHMocug7Y=; b=im3+HXNiGhqsGk95vksTV3nLDDlrMfH7TZ4WYTU8TDxB58D3CW8NQuS2BPTI/OykRSNNic TwlQv288U+JCoqsTHG50e7QS5zy6x7FQNOAx4+lrkWCPvvvz17wBtVhnIl2cpUjq/yGdBQ 1nEeTFAxoV2R0TY1zwnIIDob/dUmh0w= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-97-_YV2GfGVO_yHwy21RbcE5Q-1; Thu, 14 Jul 2022 11:39:40 -0400 X-MC-Unique: _YV2GfGVO_yHwy21RbcE5Q-1 Received: by mail-wm1-f71.google.com with SMTP id z11-20020a05600c0a0b00b003a043991610so899023wmp.8 for ; Thu, 14 Jul 2022 08:39:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mpFwBg17MPLedEeXsKR0g11KSb+p+AI/SVxHMocug7Y=; b=QBHceKDOXFU715s+Iz677PDkig61umlWQxxhm2rdMXVOg7VwOSFw+kiTBJwI8pAqgN IHbIG8cXSMYNiM2ZoP9nHwVcliWgWbbvLgsfoUUnE81SVW4egKK7WJ27KEDzscIJ2tOJ oY/IXhB2GXZhYc+Wvss0aJ0BSKaXqyrQ5Xjn+InVXn8rfxRyXZOAIo+fpDQuk09DB2nY k2q10VZuIzNDzfQmNJV5R6KDknGN6pYK74yu0CRSVQ14wGKZ2ienHATdvUZgarE01QVj jMoLdPnnl1866HKt+Lw6HPUJWmiOY+r+W4BB9U6ejnD9DdNFg5OcEsCeOQ3z9c3g/xwI /MdA== X-Gm-Message-State: AJIora8cQkG8RPSAXUyitT5EnM3MZZKaUskFz6M/NqUDKTYp7XgSPiXZ SC5j6suCFkYyPiVwl9O8YiPTgzyINOb6aJQVjFw+cyCmP/PbCEtIAmfGKVsed6iGIl53WjGsMn2 bbNahwGtuv4cGhRlYVzM/s8A= X-Received: by 2002:adf:f746:0:b0:21d:6afd:b7d3 with SMTP id z6-20020adff746000000b0021d6afdb7d3mr8680745wrp.501.1657813179272; Thu, 14 Jul 2022 08:39:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t5tKhmAkul9pcobJT+isErEbVQ/CkLfg6Gb+rF4t/kzbOpZtS1pgsyb94YxSH6cD9DrPkr8Q== X-Received: by 2002:adf:f746:0:b0:21d:6afd:b7d3 with SMTP id z6-20020adff746000000b0021d6afdb7d3mr8680732wrp.501.1657813179045; Thu, 14 Jul 2022 08:39:39 -0700 (PDT) Received: from localhost (cpc111743-lutn13-2-0-cust979.9-3.cable.virginm.net. [82.17.115.212]) by smtp.gmail.com with ESMTPSA id w10-20020adfcd0a000000b0021d888e1132sm1729356wrm.43.2022.07.14.08.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 08:39:38 -0700 (PDT) From: Aaron Tomlin To: mcgrof@kernel.org, christophe.leroy@csgroup.eu Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, atomlin@atomlin.com, oleksandr@natalenko.name, neelx@redhat.com Subject: [PATCH v2 2/3] module: Use strscpy() for last_unloaded_module Date: Thu, 14 Jul 2022 16:39:32 +0100 Message-Id: <20220714153933.2095776-3-atomlin@redhat.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220714153933.2095776-1-atomlin@redhat.com> References: <20220714153933.2095776-1-atomlin@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The use of strlcpy() is considered deprecated [1]. In this particular context, there is no need to remain with strlcpy(). Therefore we transition to strscpy(). [1]: https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy Signed-off-by: Aaron Tomlin --- kernel/module/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index a4d23b0ebbc0..c5db13d06995 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -754,7 +754,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, nam= e_user, async_synchronize_full(); =20 /* Store the name of the last unloaded module for diagnostic purposes */ - strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); + strscpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); =20 free_module(mod); /* someone could wait for the module in add_unformed_module() */ --=20 2.34.3 From nobody Sat Apr 18 12:37:21 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB806C433EF for ; Thu, 14 Jul 2022 15:39:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240416AbiGNPj5 (ORCPT ); Thu, 14 Jul 2022 11:39:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240380AbiGNPjq (ORCPT ); Thu, 14 Jul 2022 11:39:46 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E77D114F for ; Thu, 14 Jul 2022 08:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657813184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zXjUnaumkR0TOxe9lPH1tSh7D3NCENEIHeJQmON/pbA=; b=JcjMS4NWs46Et3qo6viU20RsBD7JBGrVXJQ2OjEq6CZsVHWw56ontzB0NcPM44gWaPv84z dAksgQ77SdsMLdCo1ZEnKXe4GlrMY78hMx02ciyrbHUAqJopkbeLFSHisSIv5gpBrjlWNw XCe3+fpFP8y3qU7NQJXtXa8E4b6yJRY= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-DSi88q8OOWi2maST8bCe1g-1; Thu, 14 Jul 2022 11:39:42 -0400 X-MC-Unique: DSi88q8OOWi2maST8bCe1g-1 Received: by mail-wm1-f69.google.com with SMTP id a6-20020a05600c348600b003a2d72b7a15so2801358wmq.9 for ; Thu, 14 Jul 2022 08:39:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zXjUnaumkR0TOxe9lPH1tSh7D3NCENEIHeJQmON/pbA=; b=AGu48zSbEN9CcGgc9rcX+S7Q+4ILWpFOo/AmlLnhT5qsPwIHTm6a8ryd4KPUKNGoGa rhYQWxVjzgseIl+EaQVE5eR9KnYIZbTvXIjiecMi2Fogrfm1lEcSm4t6anFbwZIeNcVT OuOR+7dPdPynTcGl0GxBON/IZtbujHdYKzbc3Hh92R+CiieVXef7rerf+fgo2Jvw4L+U b/ITxIduAVQUBA2jFuCAh22MGEPmjbeSuf8W73x1JKMEuY/xW/6muEzak8ZxmEfyxnlI RXC1jMCzQUYrzZJGt/8S8rZEHYqVEKweM9Ofov/2jPAgQJSTKzqt3tnVDKFZlDGgQgrF zG+A== X-Gm-Message-State: AJIora/nwg+OwO3xV144FEKkjkuHIFREYCYV4JhnAcoihMKWQpFn7iH6 NUSUyRomALh3LOLgkflQpE+u8n/J2U26WujF4/Ib14cWfe9Td5ojtdezgalTfeu8gLq7N6EjAEZ DYagS0ZxX34aYltqgnGPy/BY= X-Received: by 2002:a05:600c:206:b0:3a2:e224:da6f with SMTP id 6-20020a05600c020600b003a2e224da6fmr16099549wmi.167.1657813181598; Thu, 14 Jul 2022 08:39:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1umKj6lyufc2E/Zv8r5bdD3dbXIXniFnzkwkp6SxSbe6WGK2L1R/iMwFMU8NMI5GYg/lzZAtQ== X-Received: by 2002:a05:600c:206:b0:3a2:e224:da6f with SMTP id 6-20020a05600c020600b003a2e224da6fmr16099535wmi.167.1657813181427; Thu, 14 Jul 2022 08:39:41 -0700 (PDT) Received: from localhost (cpc111743-lutn13-2-0-cust979.9-3.cable.virginm.net. [82.17.115.212]) by smtp.gmail.com with ESMTPSA id a15-20020adffb8f000000b0021dbac444a7sm1742198wrr.59.2022.07.14.08.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 08:39:40 -0700 (PDT) From: Aaron Tomlin To: mcgrof@kernel.org, christophe.leroy@csgroup.eu Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, atomlin@atomlin.com, oleksandr@natalenko.name, neelx@redhat.com Subject: [PATCH v2 3/3] module: Show the last unloaded module's taint flag(s) Date: Thu, 14 Jul 2022 16:39:33 +0100 Message-Id: <20220714153933.2095776-4-atomlin@redhat.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220714153933.2095776-1-atomlin@redhat.com> References: <20220714153933.2095776-1-atomlin@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" For diagnostic purposes, this patch, in addition to keeping a record/or track of the last known unloaded module, we now will include the module's taint flag(s) too e.g: " [last unloaded: fpga_mgr_mod(OE)]" Signed-off-by: Aaron Tomlin --- kernel/module/main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index c5db13d06995..96ec7f94228d 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -524,7 +524,10 @@ static struct module_attribute modinfo_##field =3D { = \ MODINFO_ATTR(version); MODINFO_ATTR(srcversion); =20 -static char last_unloaded_module[MODULE_NAME_LEN+1]; +static struct { + char name[MODULE_NAME_LEN + 1]; + char taints[MODULE_FLAGS_BUF_SIZE]; +} last_unloaded_module; =20 #ifdef CONFIG_MODULE_UNLOAD =20 @@ -694,6 +697,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, nam= e_user, { struct module *mod; char name[MODULE_NAME_LEN]; + char buf[MODULE_FLAGS_BUF_SIZE]; int ret, forced =3D 0; =20 if (!capable(CAP_SYS_MODULE) || modules_disabled) @@ -753,8 +757,9 @@ SYSCALL_DEFINE2(delete_module, const char __user *, nam= e_user, =20 async_synchronize_full(); =20 - /* Store the name of the last unloaded module for diagnostic purposes */ - strscpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); + /* Store the name and taints of the last unloaded module for diagnostic p= urposes */ + strscpy(last_unloaded_module.name, mod->name, sizeof(last_unloaded_module= .name)); + strscpy(last_unloaded_module.taints, module_flags(mod, buf, false), sizeo= f(last_unloaded_module.taints)); =20 free_module(mod); /* someone could wait for the module in add_unformed_module() */ @@ -3128,7 +3133,8 @@ void print_modules(void) =20 print_unloaded_tainted_modules(); preempt_enable(); - if (last_unloaded_module[0]) - pr_cont(" [last unloaded: %s]", last_unloaded_module); + if (last_unloaded_module.name[0]) + pr_cont(" [last unloaded: %s%s]", last_unloaded_module.name, + last_unloaded_module.taints); pr_cont("\n"); } --=20 2.34.3