linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: KASAN: use-after-free Write in vcs_read
       [not found] <000000000000e8f42805ad5d136c@google.com>
@ 2020-08-22  7:31 ` syzbot
  2020-08-22  7:34   ` Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: syzbot @ 2020-08-22  7:31 UTC (permalink / raw)
  To: akpm, gregkh, jirislaby, jslaby, jslaby, linux-kernel, linux-mm,
	nico, syzkaller-bugs

syzbot has bisected this issue to:

commit b1c32fcfadf5593ab7a63261cc8a5747c36e627e
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Tue Aug 18 08:57:05 2020 +0000

    vc_screen: extract vcs_read_buf_header

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13259dee900000
start commit:   494d311a Add linux-next specific files for 20200821
git tree:       linux-next
final oops:     https://syzkaller.appspot.com/x/report.txt?x=10a59dee900000
console output: https://syzkaller.appspot.com/x/log.txt?x=17259dee900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a61d44f28687f508
dashboard link: https://syzkaller.appspot.com/bug?extid=ad1f53726c3bd11180cb
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=16704b7e900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1588a046900000

Reported-by: syzbot+ad1f53726c3bd11180cb@syzkaller.appspotmail.com
Fixes: b1c32fcfadf5 ("vc_screen: extract vcs_read_buf_header")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: KASAN: use-after-free Write in vcs_read
  2020-08-22  7:31 ` KASAN: use-after-free Write in vcs_read syzbot
@ 2020-08-22  7:34   ` Jiri Slaby
  2020-08-24  8:03     ` Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2020-08-22  7:34 UTC (permalink / raw)
  To: syzbot, akpm, gregkh, jslaby, jslaby, linux-kernel, linux-mm,
	nico, syzkaller-bugs

On 22. 08. 20, 9:31, syzbot wrote:
> syzbot has bisected this issue to:
> 
> commit b1c32fcfadf5593ab7a63261cc8a5747c36e627e
> Author: Jiri Slaby <jslaby@suse.cz>
> Date:   Tue Aug 18 08:57:05 2020 +0000
> 
>     vc_screen: extract vcs_read_buf_header

It's like 7th e-mail about the very same issue. Can it be
suspended/acknowledged somehow?

> Reported-by: syzbot+ad1f53726c3bd11180cb@syzkaller.appspotmail.com

I haven't managed to find the root cause on Fri yet, I will chase it on
Mon again.

thanks,
-- 
js
suse labs


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: KASAN: use-after-free Write in vcs_read
  2020-08-22  7:34   ` Jiri Slaby
@ 2020-08-24  8:03     ` Jiri Slaby
  2020-08-24  8:22       ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2020-08-24  8:03 UTC (permalink / raw)
  To: syzbot, akpm, gregkh, jslaby, linux-kernel, linux-mm, nico,
	syzkaller-bugs

On 22. 08. 20, 9:34, Jiri Slaby wrote:
> On 22. 08. 20, 9:31, syzbot wrote:
>> syzbot has bisected this issue to:
>>
>> commit b1c32fcfadf5593ab7a63261cc8a5747c36e627e
>> Author: Jiri Slaby <jslaby@suse.cz>
>> Date:   Tue Aug 18 08:57:05 2020 +0000
>>
>>     vc_screen: extract vcs_read_buf_header
> 
> It's like 7th e-mail about the very same issue. Can it be
> suspended/acknowledged somehow?
> 
>> Reported-by: syzbot+ad1f53726c3bd11180cb@syzkaller.appspotmail.com
> 
> I haven't managed to find the root cause on Fri yet, I will chase it on
> Mon again.

Ah, I see now. And the easiest way of handling this is simply revert the
commit now, re-think and redo during the next merge window.

There are two issues with the patch:
1) vcs_read rounds the 'count' up to an even number. So if we read odd
bytes from the header (3 in the reproducer), the second byte of
(2-byte/ushort) write to temporary con_buf won't fit. It is because with
the patch applied, we only subtract the real number read (3 bytes) and
not the whole header (4 bytes).

2) in this scenario, we perform unaligned accesses now. 2-byte/ushort
writes to odd addresses. Due to the same reason as above.

So Greg, could you revert with the above reasoning? It reverts cleanly.
Or do you want me to send a revert?

thanks,
-- 
js
suse labs


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: KASAN: use-after-free Write in vcs_read
  2020-08-24  8:03     ` Jiri Slaby
@ 2020-08-24  8:22       ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2020-08-24  8:22 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: syzbot, akpm, jslaby, linux-kernel, linux-mm, nico, syzkaller-bugs

On Mon, Aug 24, 2020 at 10:03:54AM +0200, Jiri Slaby wrote:
> On 22. 08. 20, 9:34, Jiri Slaby wrote:
> > On 22. 08. 20, 9:31, syzbot wrote:
> >> syzbot has bisected this issue to:
> >>
> >> commit b1c32fcfadf5593ab7a63261cc8a5747c36e627e
> >> Author: Jiri Slaby <jslaby@suse.cz>
> >> Date:   Tue Aug 18 08:57:05 2020 +0000
> >>
> >>     vc_screen: extract vcs_read_buf_header
> > 
> > It's like 7th e-mail about the very same issue. Can it be
> > suspended/acknowledged somehow?
> > 
> >> Reported-by: syzbot+ad1f53726c3bd11180cb@syzkaller.appspotmail.com
> > 
> > I haven't managed to find the root cause on Fri yet, I will chase it on
> > Mon again.
> 
> Ah, I see now. And the easiest way of handling this is simply revert the
> commit now, re-think and redo during the next merge window.
> 
> There are two issues with the patch:
> 1) vcs_read rounds the 'count' up to an even number. So if we read odd
> bytes from the header (3 in the reproducer), the second byte of
> (2-byte/ushort) write to temporary con_buf won't fit. It is because with
> the patch applied, we only subtract the real number read (3 bytes) and
> not the whole header (4 bytes).
> 
> 2) in this scenario, we perform unaligned accesses now. 2-byte/ushort
> writes to odd addresses. Due to the same reason as above.
> 
> So Greg, could you revert with the above reasoning? It reverts cleanly.
> Or do you want me to send a revert?

If you send a revert it is always easier for me to apply that :)

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-24  8:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <000000000000e8f42805ad5d136c@google.com>
2020-08-22  7:31 ` KASAN: use-after-free Write in vcs_read syzbot
2020-08-22  7:34   ` Jiri Slaby
2020-08-24  8:03     ` Jiri Slaby
2020-08-24  8:22       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).