All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: syzbot <syzbot+3d2c27c2b7dc2a94814d@syzkaller.appspotmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	snovitoll@gmail.com,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Subject: Re: WARNING in iov_iter_revert (2)
Date: Sun, 21 Feb 2021 09:20:11 -0800	[thread overview]
Message-ID: <CAHk-=wgquwCP3hd-v+kc9eAL71omFLgnBMrvrw=ix3gm5mnpwA@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wgJuiASyuFSBR9GgN2iPSL7Ep7G_GR1kKsGTL=qhDTDUg@mail.gmail.com>

On Sat, Feb 20, 2021 at 4:45 PM Linus Torvalds
<torvalds@linux-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.

      parent reply	other threads:[~2021-02-21 17:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 16:18 WARNING in iov_iter_revert (2) syzbot
2021-02-20 14:25 ` syzbot
     [not found]   ` <CAHk-=wiEBTD884i-U9DU7aDdRxXuz66Q1r-rKTiJUzZoYFgp+g@mail.gmail.com>
2021-02-20 17:38     ` Al Viro
2021-02-20 17:40       ` [git pull] work.namei stuff (v2) Al Viro
2021-02-21 17:43         ` Linus Torvalds
2021-02-21 18:39         ` pr-tracker-bot
2021-02-20 19:29       ` WARNING in iov_iter_revert (2) Al Viro
2021-02-20 19:40         ` Al Viro
2021-02-21  0:45         ` Linus Torvalds
2021-02-21  8:37           ` Sabyrzhan Tasbolatov
2021-02-21 17:20           ` Linus Torvalds [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHk-=wgquwCP3hd-v+kc9eAL71omFLgnBMrvrw=ix3gm5mnpwA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snovitoll@gmail.com \
    --cc=syzbot+3d2c27c2b7dc2a94814d@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.