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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5125d9ac-32d5-476d-82cc-b57d4e5d0807@I-love.SAKURA.ne.jp>
Date: Fri, 3 May 2024 08:54:10 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Marco Elver <elver@...gle.com>, paulmck@...nel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        syzbot <syzbot+b7c3ba8cdc2f6cf83c21@...kaller.appspotmail.com>,
        linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com,
        Nathan Chancellor <nathan@...nel.org>, Arnd Bergmann <arnd@...nel.org>,
        Al Viro <viro@...iv.linux.org.uk>, Jiri Slaby <jirislaby@...nel.org>
Subject: Re: [PATCH v3] tty: tty_io: remove hung_up_tty_fops

On 2024/05/03 2:29, Linus Torvalds wrote:
>> Hmm, debugfs assumes that f_op does not change?
>>
>> fs/debugfs/file.c: In function 'full_proxy_release':
>> fs/debugfs/file.c:357:45: warning: initialization discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
>>   const struct file_operations *proxy_fops = filp->f_op;
>>                                              ^~~~
> 
> This error is a direct result of placing the __data_racy in the wrong place.

Oops. But it seems to me that the problem is that

> 
> It's not that the _result_ of reading filp->f_op is racy. It's the
> read of filp->f_op itself that is.

debugfs (or maybe any filesystems that wraps f_op) caches filp->f_op into
private data

  struct debugfs_fsdata {
      const struct file_operations *real_fops; // <= may not be up to dated?
      (...snip...)
  }

and cannot update cached real_fops value when

	filp->f_op = &hung_up_tty_fops;

or

	mfile->file->f_op = &snd_shutdown_f_ops;

is called.

Such filesystems need to be updated to cache "struct file *" rather than
"struct file_operations *" ?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ