All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Tomlin <atomlin@redhat.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "mcgrof@kernel.org" <mcgrof@kernel.org>,
	"cl@linux.com" <cl@linux.com>,
	"pmladek@suse.com" <pmladek@suse.com>,
	"mbenes@suse.cz" <mbenes@suse.cz>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>,
	"atomlin@atomlin.com" <atomlin@atomlin.com>,
	"ghalat@redhat.com" <ghalat@redhat.com>,
	"oleksandr@natalenko.name" <oleksandr@natalenko.name>,
	"neelx@redhat.com" <neelx@redhat.com>
Subject: Re: [PATCH v4 2/2] module: Introduce module unload taint tracking
Date: Mon, 2 May 2022 19:45:30 +0100	[thread overview]
Message-ID: <20220502184530.qjbl7rkilmxtmsgg@ava.usersys.com> (raw)
In-Reply-To: <73869e4f-7190-221c-897b-fc13ec54c8cb@csgroup.eu>

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


  reply	other threads:[~2022-05-02 18:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  9:08 [PATCH v4 0/2] module: Introduce module unload taint tracking Aaron Tomlin
2022-04-25  9:08 ` [PATCH v4 1/2] module: Make module_flags_taint() accept a module's taints bitmap directly Aaron Tomlin
2022-04-25  9:08 ` [PATCH v4 2/2] module: Introduce module unload taint tracking Aaron Tomlin
2022-05-02 11:07   ` Christophe Leroy
2022-05-02 18:45     ` Aaron Tomlin [this message]
2022-04-25 23:31 ` [PATCH v4 0/2] " Luis Chamberlain
2022-04-26  8:39   ` Aaron Tomlin
2022-04-26 16:22     ` Luis Chamberlain
2022-04-27  9:07       ` Aaron Tomlin

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=20220502184530.qjbl7rkilmxtmsgg@ava.usersys.com \
    --to=atomlin@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=atomlin@atomlin.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=cl@linux.com \
    --cc=ghalat@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mcgrof@kernel.org \
    --cc=neelx@redhat.com \
    --cc=oleksandr@natalenko.name \
    --cc=pmladek@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.