[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220502184530.qjbl7rkilmxtmsgg@ava.usersys.com>
Date: Mon, 2 May 2022 19:45:30 +0100
From: Aaron Tomlin <atomlin@...hat.com>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: "mcgrof@...nel.org" <mcgrof@...nel.org>,
"cl@...ux.com" <cl@...ux.com>,
"pmladek@...e.com" <pmladek@...e.com>,
"mbenes@...e.cz" <mbenes@...e.cz>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-modules@...r.kernel.org" <linux-modules@...r.kernel.org>,
"atomlin@...mlin.com" <atomlin@...mlin.com>,
"ghalat@...hat.com" <ghalat@...hat.com>,
"oleksandr@...alenko.name" <oleksandr@...alenko.name>,
"neelx@...hat.com" <neelx@...hat.com>
Subject: Re: [PATCH v4 2/2] module: Introduce module unload taint tracking
On Mon 2022-05-02 11:07 +0000, Christophe Leroy wrote:
> > @@ -150,6 +160,41 @@ int unregister_module_notifier(struct notifier_block *nb)
> > }
> > EXPORT_SYMBOL(unregister_module_notifier);
> >
> > +#ifdef CONFIG_MODULE_UNLOAD_TAINT_TRACKING
> > +static int try_add_tainted_module(struct module *mod)
> > +{
> > + struct mod_unload_taint *mod_taint;
> > +
> > + module_assert_mutex_or_preempt();
> > +
> > + list_for_each_entry_rcu(mod_taint, &unloaded_tainted_modules, list,
> > + lockdep_is_held(&module_mutex)) {
> > + size_t len = strlen(mod_taint->name);
>
> Why do you need that strlen() at all, can't you just use strcmp() ?
> With strncmp() what happens if for instance mod_taint->name is "dead"
> and mod->name is "deadbeef" ?
Hi Christophe,
Thanks for your feedback.
I see that. Furthermore, the length of a module's name is fixed.
Hence strcmp() should be fine.
Kind regards,
--
Aaron Tomlin
Powered by blists - more mailing lists