lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Sep 2018 18:07:22 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     David Howells <dhowells@...hat.com>, viro@...iv.linux.org.uk,
        torvalds@...ux-foundation.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 14/33] vfs: Implement a filesystem superblock
 creation/configuration context [ver #11]

Hi,

On (09/11/18 16:54), Guenter Roeck wrote:
> On Wed, Sep 12, 2018 at 12:17:35AM +0100, David Howells wrote:
> > Guenter Roeck <linux@...ck-us.net> wrote:
> > 
> > > [    8.507672] RIP: 0010:reconfigure_super+0x47/0x210
> > 
> > Can you tell me the file and line this corresponds to?
> > 
> I don't know, but some debugging shows that fc->ops == NULL.

This NULL derefs linux-next.

Emergency (sysrq remount/reboot):

emergency_remount()
 do_emergency_remount()
  do_emergency_remount_callback()
   reconfigure_super()

At fc->ops dereference:

 981         if (fc->ops->reconfigure) {
		^^^^^^^^^
 982                 retval = fc->ops->reconfigure(fc);
 983                 if (retval == 0) {
 984                         security_sb_reconfigure(fc);


So the check either better be

	if (fc->ops && fc->ops->reconfigure)

Or, we need to set ->ops properly. But I'm not sure if invoking
->init_fs_context() from emergency-reboot path is going to work
well all the time.

---

 fs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/super.c b/fs/super.c
index efb0567c8389..e2e03c47c817 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1017,6 +1017,7 @@ int reconfigure_super(struct fs_context *fc)
 static void do_emergency_remount_callback(struct super_block *sb)
 {
 	struct fs_context fc = {
+		.ops		= &legacy_fs_context_ops,
 		.purpose	= FS_CONTEXT_FOR_EMERGENCY_RO,
 		.fs_type	= sb->s_type,
 		.root		= sb->s_root,

---

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ