From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E318C00144 for ; Mon, 1 Aug 2022 21:07:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E12C6B0071; Mon, 1 Aug 2022 17:07:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 769A16B0072; Mon, 1 Aug 2022 17:07:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60A638E0001; Mon, 1 Aug 2022 17:07:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4AE736B0071 for ; Mon, 1 Aug 2022 17:07:09 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1A5011C5E23 for ; Mon, 1 Aug 2022 21:07:09 +0000 (UTC) X-FDA: 79752258978.10.3D4CB16 Received: from r3-21.sinamail.sina.com.cn (r3-21.sinamail.sina.com.cn [202.108.3.21]) by imf16.hostedemail.com (Postfix) with SMTP id 453C11800F9 for ; Mon, 1 Aug 2022 21:07:06 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([114.249.59.48]) by sina.com (172.16.97.32) with ESMTP id 62E840550002A1C7; Mon, 2 Aug 2022 05:06:31 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 314821628863 From: Hillf Danton To: Dipanjan Das , Siddh Raman Pant Cc: LKML , linux-mm@kvack.org Subject: Re: [PATCH] kernel/watch_queue: Make pipe NULL while clearing watch_queue Date: Tue, 2 Aug 2022 05:06:55 +0800 Message-Id: <20220801210655.1376-1-hdanton@sina.com> In-Reply-To: <1825594fdb6.52eb2a02235647.5426665702277259900@siddh.me> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659388028; a=rsa-sha256; cv=none; b=fds1cB5ELllMudlQh9V9FzRdfDx2fqPgLv9O77mVHVN5mrJ+Fadsvfcb8iIdJER8PitCbS TU08ZxtcPh8r1pDFWR+avYGpy5jmcm5x35HljD5L9wZasTh4whnia8+0g8XHdwBuwQ+9Ej HMHL5X3nrGjyE8T0IJjIbdKiyA9i/jc= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.21 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659388028; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V5+LTIVkktLvtcGNYhesuNNHnHMMKqUUn4A9xahe5vc=; b=5fzqosgSyqZbLYpIwTgQiyJJsLu03iaQlBL5gQk7ZmamXpo0ZIRWHLIFHWEtAJR6Bm8g1R YFHBKgO2KOfgNYkurvXERNMuQD+QfqzUHMaJu7o4NxhtjhIJUU4jzQK8QE3RlnCs5xhGV+ yihcOmtOKKD7OwM+qv/eXN5bphPmRjQ= Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.21 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none X-Stat-Signature: r5yoaenqr6bpr5x6dmpazfmz4bzmun6n X-Rspamd-Queue-Id: 453C11800F9 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1659388026-967456 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 01 Aug 2022 00:16:43 +0530 Siddh Raman Pant wrote: > On Sun, 31 Jul 2022 23:41:31 +0530 Dipanjan Das wrote: > > On Wed, Jul 27, 2022 at 09:50:52PM +0530, Siddh Raman Pant wrote: > > > Thank you for explaining it! > > >=20 > > > I will send a v3. Should I add a Suggested-by tag mentioning you? > >=20 > > Sorry for jumping in. > >=20 > > We have reported the same bug in kernel v5.10.131 [https://lore.kernel.or= > g/all/CANX2M5bHye2ZEEhEV6PUj1kYL2KdWYeJtgXw8KZRzwrNpLYz+A@mail.gmail.com]. = > We have been suggested to join this discussion so that we can have appropri= > ate meta-information injected in this patch=E2=80=99s commit message to mak= > e sure that it gets backported to v5.10.y. Therefore, we would like to be = > in the loop so that we can offer help in the process, if needed. > >=20 > > As you are suggesting for backporting, I should CC the stable list, or mail > after it gets merged. You have reproduced it on v5.10, but the change seems= > to > be introduced by c73be61cede5 ("pipe: Add general notification queue suppor= > t"), > which got in at v5.8. So should it be backported till v5.8 instead? > > I actually looked this up on the internet / lore now for any other reports,= > and > it seems this fixes a CVE (CVE-2022-1882). > > The reporter of CVE seems to have linked his patch as a part of CVE report,= > of > which he sent v2, but he seems to do it in a roundabout way, and also in a = > way > similar to what Hillf Danton had replied to my v2 patch, wherein he missed > 353f7988dd84 ("watchqueue: make sure to serialize 'wqueue->defunct' properl= > y"), > so I guess I can propose my patch as a fix for the CVE. 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/ > > Note: I have already sent the v3, so please suggest any new improvements et= > c. > (except replying to the conversation here) to the v3, which can be found he= > re: > https://lore.kernel.org/linux-kernel/20220728155121.12145-1-code@siddh.me/ > > Also, you may want to break text into multiples lines instead of one huge l= > ine. > > Thanks, > Siddh