All of lore.kernel.org
 help / color / mirror / Atom feed
From: Siddh Raman Pant <code@siddh.me>
To: "hdanton" <hdanton@sina.com>
Cc: "linux-kernel" <linux-kernel@vger.kernel.org>,
	"linux-mm" <linux-mm@kvack.org>,
	"Dipanjan Das" <mail.dipanjan.das@gmail.com>,
	"David Howells" <dhowells@redhat.com>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
	"Eric Dumazet" <edumazet@google.com>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	"linux-security-modules" <linux-security-module@vger.kernel.org>,
	"linux-kernel-mentees" 
	<linux-kernel-mentees@lists.linuxfoundation.org>,
	"syzbot+c70d87ac1d001f29a058" 
	<syzbot+c70d87ac1d001f29a058@syzkaller.appspotmail.com>,
	"Marius Fleischer" <fleischermarius@googlemail.com>,
	"Priyanka Bose" <its.priyanka.bose@gmail.com>
Subject: Re: [PATCH] kernel/watch_queue: Make pipe NULL while clearing watch_queue
Date: Mon, 01 Aug 2022 18:22:02 +0530	[thread overview]
Message-ID: <18259769e5e.52eb2082293078.3991591702430862151@siddh.me> (raw)
In-Reply-To: <20220801121513.28E4B5204D1@webmail.sinamail.sina.com.cn>

On Mon, 01 Aug 2022 17:45:13 +0530  Hillf Danton <hdanton@sina.com> wrote:
> What is not clear is what you are fixing, with CVE-2022-1882 put aside,
> given the mainline tree survived the syzbot test [1] irrespective of
> other fixing efforts [2, 3].
> 
> Hillf
> 
> [1] https://lore.kernel.org/lkml/000000000000c7a83905e52bd127@google.com/
> 
> //	syzbot has tested the proposed patch and the reproducer did not trigger any issue:
> //	
> //	Reported-and-tested-by: syzbot+c70d87ac1d001f29a058@syzkaller.appspotmail.com
> //	
> //	Tested on:
> //	
> //	commit:         3d7cb6b0 Linux 5.19
> //	git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> //	console output: https://syzkaller.appspot.com/x/log.txt?x=14066d7a080000
> //	kernel config:  https://syzkaller.appspot.com/x/.config?x=70dd99d568a89e0
> //	dashboard link: https://syzkaller.appspot.com/bug?extid=c70d87ac1d001f29a058
> //	compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> //	
> //	Note: no patches were applied.
> //	Note: testing is done by a robot and is best-effort only.
> 
> [2] https://lore.kernel.org/lkml/0000000000000dac0205e479ea39@google.com/
> 
> [3] https://lore.kernel.org/lkml/00000000000014c7ad05e4d535fc@google.com/
> 

(Fixed broken formatting)

This bug is about watch_queue still having a reference to a freed pipe,
which was being accessed by post_one_notification() at the time of when
I posted the v1 patch for fixing it on 23rd July, by removing the
reference to the freed pipe in the watch_queue.

Given ref. [3] by you leads to a bug about UAF in __post_watch_notification():
https://syzkaller.appspot.com/bug?extid=03d7b43290037d1f87ca

That bug is fixed by the following commit by David Howells on 28th July:
e64ab2dbd882 ("watch_queue: Fix missing locking in add_watch_to_object()")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e64ab2dbd882933b65cd82ff6235d705ad65dbb6

Given ref. [2] by you is of a patch tested by you, which can be found below:
https://groups.google.com/g/syzkaller-bugs/c/RbmAFTAIuyY/m/-vMjf-BXAQAJ

This had overlooked the existing serialization of wqueue->defunct, which
you had yourself pointed out in the reply to v2, which can be found below:
https://lore.kernel.org/linux-kernel-mentees/20220724071958.2557-1-hdanton@sina.com/

Given ref. [1] by you is about a syzbot test which was ran today, which no
longer triggers the issue. This probably happens due to the commit by David
Howells referenced earlier by me. While it does cause the reproducer to fail,
it doesn't really fix the particular issue concerned by this patch, which is
that the watch_queue has a reference to a freed pipe, which had caused a UAF.

Hope everything is clear.

Thanks,
Siddh

WARNING: multiple messages have this Message-ID (diff)
From: Siddh Raman Pant via Linux-kernel-mentees <linux-kernel-mentees@lists.linuxfoundation.org>
To: "hdanton" <hdanton@sina.com>
Cc: linux-security-modules <linux-security-module@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Marius Fleischer <fleischermarius@googlemail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	syzbot+c70d87ac1d001f29a058
	<syzbot+c70d87ac1d001f29a058@syzkaller.appspotmail.com>,
	David Howells <dhowells@redhat.com>,
	linux-mm <linux-mm@kvack.org>,
	Dipanjan Das <mail.dipanjan.das@gmail.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Priyanka Bose <its.priyanka.bose@gmail.com>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	linux-kernel-mentees
	<linux-kernel-mentees@lists.linuxfoundation.org>
Subject: Re: [PATCH] kernel/watch_queue: Make pipe NULL while clearing watch_queue
Date: Mon, 01 Aug 2022 18:22:02 +0530	[thread overview]
Message-ID: <18259769e5e.52eb2082293078.3991591702430862151@siddh.me> (raw)
In-Reply-To: <20220801121513.28E4B5204D1@webmail.sinamail.sina.com.cn>

On Mon, 01 Aug 2022 17:45:13 +0530  Hillf Danton <hdanton@sina.com> wrote:
> What is not clear is what you are fixing, with CVE-2022-1882 put aside,
> given the mainline tree survived the syzbot test [1] irrespective of
> other fixing efforts [2, 3].
> 
> Hillf
> 
> [1] https://lore.kernel.org/lkml/000000000000c7a83905e52bd127@google.com/
> 
> //	syzbot has tested the proposed patch and the reproducer did not trigger any issue:
> //	
> //	Reported-and-tested-by: syzbot+c70d87ac1d001f29a058@syzkaller.appspotmail.com
> //	
> //	Tested on:
> //	
> //	commit:         3d7cb6b0 Linux 5.19
> //	git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> //	console output: https://syzkaller.appspot.com/x/log.txt?x=14066d7a080000
> //	kernel config:  https://syzkaller.appspot.com/x/.config?x=70dd99d568a89e0
> //	dashboard link: https://syzkaller.appspot.com/bug?extid=c70d87ac1d001f29a058
> //	compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> //	
> //	Note: no patches were applied.
> //	Note: testing is done by a robot and is best-effort only.
> 
> [2] https://lore.kernel.org/lkml/0000000000000dac0205e479ea39@google.com/
> 
> [3] https://lore.kernel.org/lkml/00000000000014c7ad05e4d535fc@google.com/
> 

(Fixed broken formatting)

This bug is about watch_queue still having a reference to a freed pipe,
which was being accessed by post_one_notification() at the time of when
I posted the v1 patch for fixing it on 23rd July, by removing the
reference to the freed pipe in the watch_queue.

Given ref. [3] by you leads to a bug about UAF in __post_watch_notification():
https://syzkaller.appspot.com/bug?extid=03d7b43290037d1f87ca

That bug is fixed by the following commit by David Howells on 28th July:
e64ab2dbd882 ("watch_queue: Fix missing locking in add_watch_to_object()")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e64ab2dbd882933b65cd82ff6235d705ad65dbb6

Given ref. [2] by you is of a patch tested by you, which can be found below:
https://groups.google.com/g/syzkaller-bugs/c/RbmAFTAIuyY/m/-vMjf-BXAQAJ

This had overlooked the existing serialization of wqueue->defunct, which
you had yourself pointed out in the reply to v2, which can be found below:
https://lore.kernel.org/linux-kernel-mentees/20220724071958.2557-1-hdanton@sina.com/

Given ref. [1] by you is about a syzbot test which was ran today, which no
longer triggers the issue. This probably happens due to the commit by David
Howells referenced earlier by me. While it does cause the reproducer to fail,
it doesn't really fix the particular issue concerned by this patch, which is
that the watch_queue has a reference to a freed pipe, which had caused a UAF.

Hope everything is clear.

Thanks,
Siddh
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2022-08-01 12:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 12:15 [PATCH] kernel/watch_queue: Make pipe NULL while clearing watch_queue Hillf Danton
2022-08-01 12:52 ` Siddh Raman Pant [this message]
2022-08-01 12:52   ` Siddh Raman Pant via Linux-kernel-mentees
  -- strict thread matches above, loose matches on Subject: below --
2022-07-23 13:54 Siddh Raman Pant
2022-07-23 13:54 ` Siddh Raman Pant via Linux-kernel-mentees
2022-07-23 14:03 ` Greg KH
2022-07-23 14:03   ` Greg KH
2022-07-23 14:29   ` Siddh Raman Pant via Linux-kernel-mentees
2022-07-23 14:29     ` Siddh Raman Pant
2022-07-24  3:45     ` Khalid Masum
2022-07-24  3:45       ` Khalid Masum
2022-07-24  4:02       ` Siddh Raman Pant
2022-07-24  4:02         ` Siddh Raman Pant via Linux-kernel-mentees
2022-07-23 14:04 ` Greg KH
2022-07-23 14:04   ` Greg KH
2022-07-23 14:29   ` Siddh Raman Pant via Linux-kernel-mentees
2022-07-23 14:29     ` Siddh Raman Pant
2022-07-27 14:46   ` David Howells
2022-07-27 14:46     ` David Howells
2022-07-27 16:20     ` Siddh Raman Pant
2022-07-27 16:20       ` Siddh Raman Pant via Linux-kernel-mentees
2022-07-31 18:11       ` Dipanjan Das
2022-07-31 18:11         ` Dipanjan Das
2022-07-31 18:46         ` Siddh Raman Pant
2022-07-31 18:46           ` Siddh Raman Pant via Linux-kernel-mentees
2022-08-01  8:47           ` Greg KH
2022-08-01  8:47             ` Greg KH
2022-08-01  8:53             ` Siddh Raman Pant
2022-08-01  8:53               ` Siddh Raman Pant via Linux-kernel-mentees
2022-08-01 21:06           ` Hillf Danton
2022-08-02  1:14             ` Siddh Raman Pant
2022-08-02  1:19             ` Siddh Raman Pant
2022-07-27 14:15 ` David Howells
2022-07-27 14:15   ` David Howells
2022-07-27 14:23   ` Siddh Raman Pant
2022-07-27 14:23     ` Siddh Raman Pant via Linux-kernel-mentees

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=18259769e5e.52eb2082293078.3991591702430862151@siddh.me \
    --to=code@siddh.me \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=fleischermarius@googlemail.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdanton@sina.com \
    --cc=its.priyanka.bose@gmail.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mail.dipanjan.das@gmail.com \
    --cc=syzbot+c70d87ac1d001f29a058@syzkaller.appspotmail.com \
    /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.