[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e1fe6a44-3021-62ad-690a-69146e39e1ac@I-love.SAKURA.ne.jp>
Date: Mon, 24 Apr 2023 08:55:58 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Al Viro <viro@...iv.linux.org.uk>
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 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.
Powered by blists - more mailing lists