mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vegard Nossum <vegard.nossum@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	George Kennedy <george.kennedy@oracle.com>,
	linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
	syzbot+9c2bdc9d24e4a7abe741@syzkaller.appspotmail.com,
	Johan Hovold <johan@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Rudi Heitbaum <rudi@heitbaum.com>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [PATCH] module: always complete idempotent loads
Date: Tue, 4 Jul 2023 20:28:42 +0200	[thread overview]
Message-ID: <4650691f-a025-0a93-33ec-a99ff0ede157@oracle.com> (raw)
In-Reply-To: <CAHk-=wgy2q9viwq-bAqaq8X_WQHNqDsu1AzfeYXAcDQRZmCoAw@mail.gmail.com>

On 7/4/23 15:37, Linus Torvalds wrote:
> On Tue, 4 Jul 2023 at 03:09, Vegard Nossum <vegard.nossum@oracle.com> wrote:
>>
>> Commit 9b9879fc0327 added a hashtable storing lists of concurrent module
>> loads. However, it didn't fix up all the error paths in
>> init_module_from_file(); this would lead to leaving the function while an
>> on-stack 'struct idempotent' element is still in the hash table, which
>> leads to all sorts of badness as spotted by syzkaller:
> 
> You are of course 100% right.
> 
> However, I'd rather just use a wrapper function and make this thing
> much clearer. Like I should have done originally.
> 
> So I'd be inclined towards a patch like the attached instead. Works for you?

Harshit tells me there's still a crash... and indeed, with your wrapped
version we call file_inode() on a NULL pointer before checking the
fdget() return value.

It's likely you already changed this with the f_mode changes I commented
on, so maybe it's no longer a problem, though.


Vegard

  parent reply	other threads:[~2023-07-04 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230704092309.22669-1-vegard.nossum@oracle.com>
2023-07-04 10:08 ` Vegard Nossum
2023-07-04 13:37   ` Linus Torvalds
2023-07-04 15:11     ` Vegard Nossum
2023-07-04 17:10       ` Linus Torvalds
2023-07-04 18:28     ` Vegard Nossum [this message]
2023-07-04 18:38       ` Linus Torvalds

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=4650691f-a025-0a93-33ec-a99ff0ede157@oracle.com \
    --to=vegard.nossum@oracle.com \
    --cc=dan.j.williams@intel.com \
    --cc=david@redhat.com \
    --cc=george.kennedy@oracle.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=rudi@heitbaum.com \
    --cc=syzbot+9c2bdc9d24e4a7abe741@syzkaller.appspotmail.com \
    --cc=torvalds@linux-foundation.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®