[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wgquwCP3hd-v+kc9eAL71omFLgnBMrvrw=ix3gm5mnpwA@mail.gmail.com>
Date: Sun, 21 Feb 2021 09:20:11 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: syzbot <syzbot+3d2c27c2b7dc2a94814d@...kaller.appspotmail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
snovitoll@...il.com,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>
Subject: Re: WARNING in iov_iter_revert (2)
On Sat, Feb 20, 2021 at 4:45 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> I don't think the ttyprintk weirdness was intentional. I'd fix that,
> but in the meantime clearly we should make do_tty_write() protect
> against this insanity, and do something like
>
> --- a/drivers/tty/tty_io.c
> +++ b/drivers/tty/tty_io.c
> @@ -961,6 +961,9 @@ static inline ssize_t do_tty_write(
> ret = write(tty, file, tty->write_buf, size);
> if (ret <= 0)
> break;
> + /* ttyprintk historical oddity */
> + if (ret > size)
> + break;
Actually, we need to move the
written += ret;
line up above this thing too, so that we get the expected insane
return value to user space.
Of course, if ttyprintk gets fixed, this is all moot, but I've applied
this patch for now (since I was doing Greg's tty pull).
I've marked it as "fixing" 9bb48c82aced ("tty: implement write_iter")
even if the real cause is much older - the WARNING is new.
Linus
PS. Just lost power again. Oh joy.
Powered by blists - more mailing lists