Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4643513rwb; Tue, 6 Sep 2022 10:17:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR5msihDRcS/UtvnxeyjmDCFxbnKB3tj2MkI3Dw3U3zmq5EXm3SqckPtspz8Bb7Rf8uBFTCt X-Received: by 2002:a17:907:7242:b0:742:7c5:46b5 with SMTP id ds2-20020a170907724200b0074207c546b5mr26955346ejc.274.1662484660537; Tue, 06 Sep 2022 10:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662484660; cv=none; d=google.com; s=arc-20160816; b=YlUgm4Y3rujx02iZG2RfAIf4Xar9piAHjrY0annyXNVRM2X6bdysaCVQPsxVSO/Isw /Dv2uDZra+FO/bhRgplBwoYUmNKN0Mq6rkRtmjySbkIazpNT7JnRaYTkV44UcAGqG79m /WXKIsRJ3GfdsRM1G0Lv7M99n+oVeGeyr3j+m4sdKhNaWgr74te+XZ5jm1oPXZsskqZv cQre0omUS/vAXlU1HzzUt4MVlLDHnxD5yXDsa8hK1yq7Iw8JuKxSjdFH0IGYVVnOObfU IHDJFoTzrkI3Zzpl7uRIwCO/p9f7JJ+o9hrEJu9AuyBCb9FdrrD1SWsqW8ILd52N+ChG JXNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=N+eu8zBiaOf9T4szF1GKnY1xYtJ5b7WM8WLIvQQKwMs=; b=ikxTuTyBo8LqaD6Dm7wbK3QG7KyGvqta50H2CBXpkq8GYEszZQZ/wZdH/nrIuURZ15 xLph90s3CFf2bjYxGd8tLBwzKZyS9RqT2E/SV9DhdRZrFspMNxGga51TCWewehK/0ZQX u2p+qoI0NR2CjIgTbQ7ZcK0DP9WJ2oH31q7YXK1lhdw516x8INJVGElbYwp3F2SB4wrW vw4tOqLjkWND/9U/Nb9Lpkk0YMginsa8D+QFImtg4PzSTC7aYfHT94F8I+WQ+MlZAaGo 2xL/8Wolt/V+4WcM/G/ryfEtEq3V5Fk6uDMUszRXij613pHh+RVXNzO9AI88pivhOAfT 2ziQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb5-20020a170907960500b00738553043e5si10658765ejc.573.2022.09.06.10.17.14; Tue, 06 Sep 2022 10:17:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233854AbiIFQoy (ORCPT + 99 others); Tue, 6 Sep 2022 12:44:54 -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: X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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