mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Borislav Petkov' <bp@alien8.de>, Jann Horn <jannh@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	the arch/x86 maintainers <x86@kernel.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	Qiaowei Ren <qiaowei.ren@intel.com>,
	Mukesh Ojha <mojha@codeaurora.org>
Subject: RE: [PATCH v3 2/4] x86/microcode: Fix __user annotations around generic_load_microcode()
Date: Tue, 2 Apr 2019 10:26:30 +0000	[thread overview]
Message-ID: <fa9c73f385a649cfbedae47f21a5447f@AcuMS.aculab.com> (raw)
In-Reply-To: <20190402100134.GE6826@zn.tnic>

From: Borislav Petkov
> Sent: 02 April 2019 11:02
> 
> On Mon, Apr 01, 2019 at 07:53:46PM +0200, Jann Horn wrote:
> > Hm. request_microcode_fw() gets that buffer from
> > request_firmware_direct(), which does this:
> >
> >         __module_get(THIS_MODULE);
> >         ret = _request_firmware(firmware_p, name, device, NULL, 0,
> >                                 FW_OPT_UEVENT | FW_OPT_NO_WARN |
> >                                 FW_OPT_NOFALLBACK);
> >         module_put(THIS_MODULE);
> >         return ret;
> >
> > What is that module_get()/module_put() supposed to be good for? Are we
> > expecting that caller to do something ridiculous like calling
> > module_put() on us? This doesn't seem to make any sense.
> 
> Yah, the microcode thing used to be a module. Not anymore.

That probably makes diddly-squit difference.
There has to be a 'hold' on THIS_MODULE in order to be executing
code from it.
You only (usually) need an extra reference for a kernel thread,
and that needs to exit with module_put_and_exit().

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2019-04-02 10:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29 21:46 [PATCH v3 1/4] kernel.h: use parentheses around argument in u64_to_user_ptr() Jann Horn
2019-03-29 21:46 ` [PATCH v3 2/4] x86/microcode: Fix __user annotations around generic_load_microcode() Jann Horn
2019-04-01 17:30   ` Borislav Petkov
2019-04-01 17:53     ` Jann Horn
2019-04-02  9:55       ` David Laight
2019-04-02 10:01       ` Borislav Petkov
2019-04-02 10:26         ` David Laight [this message]
2019-03-29 21:46 ` [PATCH v3 3/4] x86/fpu: Fix __user annotations Jann Horn
2019-04-03 12:43   ` [tip:x86/fpu] " tip-bot for Jann Horn
2019-03-29 21:46 ` [PATCH v3 4/4] x86/uaccess: Fix implicit cast of __user pointer Jann Horn
2019-04-03 15:10   ` [tip:x86/asm] " tip-bot for Jann Horn
2019-04-03 11:10 ` [tip:core/urgent] linux/kernel.h: Use parentheses around argument in u64_to_user_ptr() tip-bot for Jann Horn

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=fa9c73f385a649cfbedae47f21a5447f@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mojha@codeaurora.org \
    --cc=qiaowei.ren@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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®