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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F01EECAAD5 for ; Tue, 6 Sep 2022 16:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PurjmL0l2LRyHEKSSOXW6kQBAgQGrlrqzZ8zrE3/IpE=; b=YduMJTWu4yylUc jbHmhF8yJd7rfB5Chr5kCpMNn0GQt/NPRK+7kHgii1O2Q1Noil/MYkx7IJ/jB5A240yi3Pe0dnmtG TO+YUqekYAA82qOlYHv8zaTYDPJA9V0t9uhYI3SwtN0gyS6j7/c56yfecmREo9osrqsgPj2HdMtjh Cuot1GVGk5VWhAqKrA8CD7lJH0VrQ3sFjko2oH9PzGYDy2R5TKHpsew6b4OyxTRUJ2VXYOyDKZ93J lGNkzjl+Are9YhARlb4ciyLAI+c59JwftBVs4NPk5/jKYmo8PSmn4etExMoBePHS5fhENbqGPOImz jb+NIkWLn36iw8IWR9EQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVbgp-00FYGy-Ok; Tue, 06 Sep 2022 16:44:44 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVbMb-00FMi0-Pf for linux-arm-kernel@lists.infradead.org; Tue, 06 Sep 2022 16:23:51 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1A6FCB818D4; Tue, 6 Sep 2022 16:23:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B04CEC433D6; Tue, 6 Sep 2022 16:23:42 +0000 (UTC) Date: Tue, 6 Sep 2022 17:23:39 +0100 From: Catalin Marinas To: Andrey Konovalov Cc: Dmitry Vyukov , Linux ARM , LKML , syzkaller-bugs , tongtiangen@huawei.com, Vincenzo Frascino , Kefeng Wang , Will Deacon , syzbot , Evgenii Stepanov , Peter Collingbourne Subject: Re: [syzbot] KASAN: invalid-access Read in copy_page Message-ID: References: <0000000000004387dc05e5888ae5@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_092350_049790_F1DC1D32 X-CRM114-Status: GOOD ( 27.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 06, 2022 at 04:39:57PM +0200, Andrey Konovalov wrote: > On Tue, Sep 6, 2022 at 4:29 PM Catalin Marinas wrote: > > > > Does it take long to reproduce this kasan warning? > > > > > > syzbot finds several such cases every day (200 crashes for the past 35 days): > > > https://syzkaller.appspot.com/bug?extid=c2c79c6d6eddc5262b77 > > > So once it reaches the tested tree, we should have an answer within a day. > > To be specific, this syzkaller instance fuzzes the mainline, so the > patch with the WARN_ON needs to end up there. > > If this is unacceptable, perhaps, we could switch the MTE syzkaller > instance to the arm64 testing tree. It needs some more digging first. My first guess was that a PROT_MTE page was mapped into the user address space and the task repainted it but I don't think that's the case. > > That's good to know. BTW, does syzkaller write tags in mmap'ed pages or > > only issues random syscalls? > > syzkaller doesn't write tags. Or, at least, shouldn't. Theoretically > it could come up with same way to generate instructions that write > tags, but this is unlikely. Yeah. And colouring an entire page with the same tag is even less likely. > > I'm trying to figure out whether tag 0xf2 > > was written by the kernel without updating the corresponding > > page_kasan_tag() or it was syzkaller recolouring the page. > > Just in case, I want to point out that the kasantag == 0xa from the > page flags matches the pointer tag 0xf5 in the report. The tag value > is stored bitwise-inverted in the page flags. Not that this matters in > this case though. Yes, I'm aware of this. So copy_page() tries to read from page_address(src) with kasantag == 0xa (real tag 0xf5) while the in-memory tag is 0xf2. Since the user didn't repaint the page, I'm trying to figure out what set the tags to 0xf2 while leaving the page_kasan_tag() to 0xf5. Some of the page_kasan_tag_reset() calls in the past could have hidden a different issue. Since I can't find the kernel boot log for these runs, is there any kind of swap enabled? I'm trying to narrow down where the problem may be. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEF9EECAAD5 for ; Tue, 6 Sep 2022 16:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231496AbiIFQo4 (ORCPT ); Tue, 6 Sep 2022 12:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239161AbiIFQn4 (ORCPT ); Tue, 6 Sep 2022 12:43:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD8FBE0D4 for ; Tue, 6 Sep 2022 09:23:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7A85A614AA for ; Tue, 6 Sep 2022 16:23:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B04CEC433D6; Tue, 6 Sep 2022 16:23:42 +0000 (UTC) Date: Tue, 6 Sep 2022 17:23:39 +0100 From: Catalin Marinas To: Andrey Konovalov Cc: Dmitry Vyukov , Linux ARM , LKML , syzkaller-bugs , tongtiangen@huawei.com, Vincenzo Frascino , Kefeng Wang , Will Deacon , syzbot , Evgenii Stepanov , Peter Collingbourne Subject: Re: [syzbot] KASAN: invalid-access Read in copy_page Message-ID: References: <0000000000004387dc05e5888ae5@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 06, 2022 at 04:39:57PM +0200, Andrey Konovalov wrote: > On Tue, Sep 6, 2022 at 4:29 PM Catalin Marinas wrote: > > > > Does it take long to reproduce this kasan warning? > > > > > > syzbot finds several such cases every day (200 crashes for the past 35 days): > > > https://syzkaller.appspot.com/bug?extid=c2c79c6d6eddc5262b77 > > > So once it reaches the tested tree, we should have an answer within a day. > > To be specific, this syzkaller instance fuzzes the mainline, so the > patch with the WARN_ON needs to end up there. > > If this is unacceptable, perhaps, we could switch the MTE syzkaller > instance to the arm64 testing tree. It needs some more digging first. My first guess was that a PROT_MTE page was mapped into the user address space and the task repainted it but I don't think that's the case. > > That's good to know. BTW, does syzkaller write tags in mmap'ed pages or > > only issues random syscalls? > > syzkaller doesn't write tags. Or, at least, shouldn't. Theoretically > it could come up with same way to generate instructions that write > tags, but this is unlikely. Yeah. And colouring an entire page with the same tag is even less likely. > > I'm trying to figure out whether tag 0xf2 > > was written by the kernel without updating the corresponding > > page_kasan_tag() or it was syzkaller recolouring the page. > > Just in case, I want to point out that the kasantag == 0xa from the > page flags matches the pointer tag 0xf5 in the report. The tag value > is stored bitwise-inverted in the page flags. Not that this matters in > this case though. Yes, I'm aware of this. So copy_page() tries to read from page_address(src) with kasantag == 0xa (real tag 0xf5) while the in-memory tag is 0xf2. Since the user didn't repaint the page, I'm trying to figure out what set the tags to 0xf2 while leaving the page_kasan_tag() to 0xf5. Some of the page_kasan_tag_reset() calls in the past could have hidden a different issue. Since I can't find the kernel boot log for these runs, is there any kind of swap enabled? I'm trying to narrow down where the problem may be. -- Catalin