From: "David Wang" <00107082@163.com>
To: "Suren Baghdasaryan" <surenb@google.com>
Cc: mcgrof@kernel.org, petr.pavlu@suse.com,
linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] module: release codetag section when module load fails
Date: Tue, 20 May 2025 00:30:00 +0800 (CST) [thread overview]
Message-ID: <3e1bf257.c0a6.196e961769d.Coremail.00107082@163.com> (raw)
In-Reply-To: <CAJuCfpEeo2qKcyan9BnYGvEaYeso24wQT1eX-CxnBkjbEuY7sg@mail.gmail.com>
At 2025-05-20 00:03:16, "Suren Baghdasaryan" <surenb@google.com> wrote:
>On Sun, May 18, 2025 at 3:12 AM David Wang <00107082@163.com> wrote:
>>
>> When module load failed after memory for codetag sections ready,
>
>nit: s/ready/is ready
>
>> codetag section memory was not properly released. This
>> causes memory leak, and if next module load happens to got the
>
>nit: s/happens to got/happens to get
>
Thanks, I will send new version.
>
>> same module address, codetag may pick the uninitialized section
>> when manipulating tags during module unload, and lead to
>> "unable to handle page fault" BUG.
>>
>> Closes: https://lore.kernel.org/all/20250516131246.6244-1-00107082@163.com/
>> Signed-off-by: David Wang <00107082@163.com>
>
>Acked-by: Suren Baghdasaryan <surenb@google.com>
>
>> ---
>> kernel/module/main.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/kernel/module/main.c b/kernel/module/main.c
>> index a2859dc3eea6..5c6ab20240a6 100644
>> --- a/kernel/module/main.c
>> +++ b/kernel/module/main.c
>> @@ -2829,6 +2829,7 @@ static void module_deallocate(struct module *mod, struct load_info *info)
>> {
>> percpu_modfree(mod);
>> module_arch_freeing_init(mod);
>> + codetag_free_module_sections(mod);
>>
>> free_mod_mem(mod);
>> }
>> --
>> 2.39.2
>>
next prev parent reply other threads:[~2025-05-19 16:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-18 10:12 David Wang
2025-05-19 16:03 ` Suren Baghdasaryan
2025-05-19 16:30 ` David Wang [this message]
2025-05-19 16:38 ` [PATCH v2] " David Wang
2025-05-19 16:46 ` Suren Baghdasaryan
2025-05-19 16:57 ` Suren Baghdasaryan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e1bf257.c0a6.196e961769d.Coremail.00107082@163.com \
--to=00107082@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=petr.pavlu@suse.com \
--cc=surenb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®