linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Tong Zhang <ztong0001@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Eric Biederman <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Iurii Zaikin <yzaikin@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christian Brauner <brauner@kernel.org>
Subject: Re: [PATCH v2 1/2] binfmt_misc: fix crash when load/unload module
Date: Tue, 25 Jan 2022 10:15:36 -0800	[thread overview]
Message-ID: <YfA+SJZrd4nkFSgH@bombadil.infradead.org> (raw)
In-Reply-To: <20220124181812.1869535-2-ztong0001@gmail.com>

On Mon, Jan 24, 2022 at 10:18:12AM -0800, Tong Zhang wrote:
> We should unregister the table upon module unload otherwise something
> horrible will happen when we load binfmt_misc module again. Also note
> that we should keep value returned by register_sysctl_mount_point() and
> release it later, otherwise it will leak.
> Also, per Christian's comment, to fully restore the old behavior that
> won't break userspace the check(binfmt_misc_header) should be
> eliminated.
> 
> reproduce:
> modprobe binfmt_misc
> modprobe -r binfmt_misc
> modprobe binfmt_misc
> modprobe -r binfmt_misc
> modprobe binfmt_misc
> 
> [   18.032038] Call Trace:
> [   18.032108]  <TASK>
> [   18.032169]  dump_stack_lvl+0x34/0x44
> [   18.032273]  __register_sysctl_table+0x6f4/0x720
> [   18.032397]  ? preempt_count_sub+0xf/0xb0
> [   18.032508]  ? 0xffffffffc0040000
> [   18.032600]  init_misc_binfmt+0x2d/0x1000 [binfmt_misc]
> [   18.042520] binfmt_misc: Failed to create fs/binfmt_misc sysctl mount point
> modprobe: can't load module binfmt_misc (kernel/fs/binfmt_misc.ko): Cannot allocate memory
> [   18.063549] binfmt_misc: Failed to create fs/binfmt_misc sysctl mount point
> [   18.204779] BUG: unable to handle page fault for address: fffffbfff8004802
> 
> Fixes: 3ba442d5331f ("fs: move binfmt_misc sysctl to its own file")
> Co-developed-by: Christian Brauner<brauner@kernel.org>
> Signed-off-by: Tong Zhang <ztong0001@gmail.com>

Acked-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis

  reply	other threads:[~2022-01-25 18:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  0:33 [PATCH v1] binfmt_misc: fix crash when load/unload module Tong Zhang
2022-01-24 10:40 ` Christian Brauner
2022-01-24 18:18   ` [PATCH v2 0/2] Fix regression on binfmt_misc Tong Zhang
2022-01-24 18:18   ` [PATCH v2 1/2] binfmt_misc: fix crash when load/unload module Tong Zhang
2022-01-25 18:15     ` Luis Chamberlain [this message]
2022-01-24 18:18   ` [PATCH v2 2/2] sysctl: fix return type to make compiler happy Tong Zhang
2022-01-24 18:23   ` [PATCH v1] binfmt_misc: fix crash when load/unload module Tong Zhang
2022-01-24 11:40 ` kernel test robot
2022-01-24 23:16   ` Andrew Morton
2022-01-25 18:14     ` Luis Chamberlain
2022-01-26  5:04     ` Murphy Zhou
2022-01-26  5:23       ` Tong Zhang
2022-01-26  6:33         ` Tong Zhang
2022-01-29  0:25           ` Murphy Zhou
2022-01-24 12:14 ` kernel test robot

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=YfA+SJZrd4nkFSgH@bombadil.infradead.org \
    --to=mcgrof@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yzaikin@google.com \
    --cc=ztong0001@gmail.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;
as well as URLs for NNTP newsgroup(s).