Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5043465rwr; Mon, 8 May 2023 17:19:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ISVGKikgtnwoescCtErcEY63EHVLnpJ8nkMkLlhZ4FM6p1ePdLhEFlXsBt5CBJYqMSqag X-Received: by 2002:a17:90a:65c7:b0:24d:e656:f24d with SMTP id i7-20020a17090a65c700b0024de656f24dmr12174586pjs.2.1683591564755; Mon, 08 May 2023 17:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683591564; cv=none; d=google.com; s=arc-20160816; b=abzieI7tUaI5fg/71cQ8HFUgIMpQkFotrOY/soU9Y3sy6sN7R7RzVwpDQHkOrrtPeh aAuJoH+7HPXXLctdr2mFlovVmmzzEuI5ayMYGbjX4JrrYHSbgcc4q6bikCBfvEJ4IBop dMbdAwECrdW9+i/2yFHTFqxrH1WR4uPo+BJ05UzLpQiN2Yu6y8lSp3GeroxqyiRIBaZc iwZT75aFe70OB2qVVNXnJVwuB8GiOE+CyjXYBbttKMXeU51H4zkr/jXg+QVmIaOuRfmi BKhzq3sBPyzg62kUJRQlTJGXo+c5PCIAfHXd3eZrK1Vaf5VTsWyf/g4Y0ePnoGvTQBE2 yvnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=J20KJD8UUGIZf35RzyX4QJCStx2hC/zK71qAj+ED4BU=; b=S9G/xlW69nuuZltuIwvFEtvCclZ44koiIIZgKysro/m/SHekoDqcG/Q/rzN9uA1K/5 Ip2YxpOpa3ETxWmYaRiGyZetg21pxSIhfByLSAyaEUrZVmjjHycKw2X6Nq3o2YwqIc2o +NBCl9oMgdnaUknXWBQQZA+7G5DnB9iG84tmLRXuW+CNJxYirPU6/XToArqxToTWTF/Z /e56WJsrEibYrA3J8HBY77ojbRODbGi+4HsL4jVb1GRdRN+258rveZTHcFGupXPaoxbG E/NIqwqzy5hQeLrt2emig6UR/QkBAwEfOtbT3s/GFJcxt1ddJw0o/sdh9qgf8m5velN/ vNCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=TNMGn3m6; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020a17090a728b00b0023418ec51f8si13928263pjg.136.2023.05.08.17.19.10; Mon, 08 May 2023 17:19:24 -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; dkim=pass header.i=@soleen.com header.s=google header.b=TNMGn3m6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232429AbjEHXWj (ORCPT + 99 others); Mon, 8 May 2023 19:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbjEHXWg (ORCPT ); Mon, 8 May 2023 19:22:36 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46AFF93E6 for ; Mon, 8 May 2023 16:22:34 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-757756e2eefso102226585a.3 for ; Mon, 08 May 2023 16:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1683588153; x=1686180153; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=J20KJD8UUGIZf35RzyX4QJCStx2hC/zK71qAj+ED4BU=; b=TNMGn3m6WEBl4N8JuGwvWyR7WctTWHrVftC5hiZc+tYMbbctCLn9sos4hh8iEGyDm5 5110E/Ts3cuwWgtVQzy6GgZQvFIuUQmm5K7wnEGtbGLk6sT8A1VO8cg1Im+govrADMOV Cy3Q+TEYXLHygksHb/uhHTtC/wyU5d4TaivEarWakk+ul7Rnm1CztBxTQhPcqPm7c15k NmY7elOhiRuBr5r94CHdVN1p+F/ne2xVcpGTtVJdluQqWcjPcftUAajG1zyCm6iqVxV7 nI+lYGjD842cyiWHZcP+QWXu19HTR2CEZIUESzAJTGZKgwxs62NdbD+juBhTQ29gzj3t uKNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683588153; x=1686180153; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=J20KJD8UUGIZf35RzyX4QJCStx2hC/zK71qAj+ED4BU=; b=DCcaNZMjworQVaP+XSxKeIQbwVldfJdZ1XzUjiuwkKbL3915q3HxV0wSttfOZsYIZl yOQSbhil6zXgbK3vSbEOut0wpQ+y+ldiwnrzIoDw1N6hDgFzrLQ/F7IIecvYx37CrBp8 UpF8lIpPEmtIizXPU4BR0f1cDhimcGENYgOeKQW5xcUuua0FGNvneTD4JBm3mRydOu9r ck3v49ZJiuZ7/4WjkwUVIXBkefTkdodqr5sXs8CArHUsOPrw/SNR2qJNCUhDMdaXCoCu 9DkZLq4Pgam08zkwh4DowIHhWWXRzfcKYRzOkE8f7kBsCG8sDJXK28sTpUPfAisVEdH5 cWXQ== X-Gm-Message-State: AC+VfDzWdAy39Uq5MTqWIGcZhyYFx2Nw+fUroTbi7mASQSpT3hTUXr9F QOp5j8NQWmXSITjAv1zkqlV/EB6mWP7JUf07ACSZhQ== X-Received: by 2002:a05:6214:2427:b0:61a:c2bf:9f0b with SMTP id gy7-20020a056214242700b0061ac2bf9f0bmr20819167qvb.6.1683588153435; Mon, 08 May 2023 16:22:33 -0700 (PDT) MIME-Version: 1.0 References: <000000000000258e5e05fae79fc1@google.com> <20230507135844.1231056-1-lrh2000@pku.edu.cn> In-Reply-To: From: Pasha Tatashin Date: Mon, 8 May 2023 16:21:57 -0700 Message-ID: Subject: Re: usbdev_mmap causes type confusion in page_table_check To: David Hildenbrand Cc: Matthew Wilcox , Ruihan Li , syzbot+fcf1a817ceb50935ce99@syzkaller.appspotmail.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 > For normal Kernel-MM operations, vm_normal_page() should be used to > get "struct page" based on vma+addr+pte combination, but > page_table_check does not use vma for its operation in order to > strengthen the verification of no invalid page sharing. But, even > vm_normal_page() can cause access to the "struct page" for VM_PFNMAP > if pfn_valid(pfn) is true. So, vm_normal_page() can return a struct > page for a user mapped slab page. Only for !ARCH_HAS_PTE_SPECIAL case, otherwise NULL is returned. Pasha