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]
Date:   Mon, 24 Apr 2023 01:44:31 +0100
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc:     Dmitry Vyukov <dvyukov@...gle.com>,
        syzbot <syzbot+b7c3ba8cdc2f6cf83c21@...kaller.appspotmail.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [kernel?] KCSAN: data-race in __fput / __tty_hangup (4)

On Mon, Apr 24, 2023 at 08:55:58AM +0900, Tetsuo Handa wrote:
> On 2023/04/24 8:34, Al Viro wrote:
> > As for the original report - add a (failing) ->splice_read() in hung_ut_tty_fops
> > to deal with the original problem.
> 
> Yes, adding a dummy splice_read callback is OK for avoiding NULL pointer dereference.
> But we need more changes for avoiding KCSAN race reporting.
> 
> Are you OK with https://lkml.kernel.org/r/6bec279c-07b3-d6f1-0860-4d6b136a2025@I-love.SAKURA.ne.jp
> which will require touching so many locations ?
> 
> If you want tty layer handle this race without rewriting all f_op dereferences,
> we would need to replace
> 
>   filp->f_op = &hung_up_tty_fops;
> 
> with
> 
>   data_race(filp->some_flags_for_tty = true);
> 
> rather than
> 
>   data_race(filp->f_op = &hung_up_tty_fops);
> 
> and check
> 
>   if (data_race(filp->some_flags_for_tty)) {
>     return error;
>   }
> 
>  from each "struct tty_operations" callback function.

What struct tty_operations?  It's file_operations, unfortunately, and
their calls are on quite a few fast paths.

Do you mean doing that in method instances that are present in tty_fops
you mean doing that in method instances that are present in tty_fops
and different in hung_up_tty_fops?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ