Message ID | 20211018221616.YJgTYjtfN%akpm@linux-foundation.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=mZRB=PG=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B2BEC433FE for <linux-mm@archiver.kernel.org>; Mon, 18 Oct 2021 22:16:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C67A360F57 for <linux-mm@archiver.kernel.org>; Mon, 18 Oct 2021 22:16:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C67A360F57 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6BD64940013; Mon, 18 Oct 2021 18:16:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64661940007; Mon, 18 Oct 2021 18:16:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50E80940013; Mon, 18 Oct 2021 18:16:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 3B657940007 for <linux-mm@kvack.org>; Mon, 18 Oct 2021 18:16:18 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 04692181AEF0B for <linux-mm@kvack.org>; Mon, 18 Oct 2021 22:16:18 +0000 (UTC) X-FDA: 78710967636.23.ADEDEDF Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf07.hostedemail.com (Postfix) with ESMTP id 7B8E710000A6 for <linux-mm@kvack.org>; Mon, 18 Oct 2021 22:16:20 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8D9A4610FB; Mon, 18 Oct 2021 22:16:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1634595376; bh=Mv+RmXu/RmPj1Tr2bewXlZx6MBqALC2O4s0g+gB0ME0=; h=Date:From:To:Subject:In-Reply-To:From; b=jiInY3O/Cft1u+KZDf3876maBLNsA0gin1u/JLmClOcRVj+1pSIO46ApUKVXpb1Ab bbsYrJkzK0Faa2rir4cqlqjVErdGjAf3kwZKs6A5Hx6FT/rFgysDMS/zN+cK/pJTRu LCNDdyikuKiBc/KPTCE6lr9feA4FIbhuaLeXOekg= Date: Mon, 18 Oct 2021 15:16:16 -0700 From: Andrew Morton <akpm@linux-foundation.org> To: akpm@linux-foundation.org, david@redhat.com, djwong@kernel.org, linux-mm@kvack.org, mm-commits@vger.kernel.org, rppt@linux.ibm.com, seanjc@google.com, stable@vger.kernel.org, stephenackerman16@gmail.com, torvalds@linux-foundation.org Subject: [patch 17/19] mm/secretmem: fix NULL page->mapping dereference in page_is_secretmem() Message-ID: <20211018221616.YJgTYjtfN%akpm@linux-foundation.org> In-Reply-To: <20211018151438.f2246e2656c041b6753a8bdd@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Queue-Id: 7B8E710000A6 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="jiInY3O/"; spf=pass (imf07.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: m88gxqkef4hpf7g7cpjeh9dc6iupbmwt X-Rspamd-Server: rspam05 X-HE-Tag: 1634595380-163841 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: <linux-mm.kvack.org> |
Series |
[01/19] mm/userfaultfd: selftests: fix memory corruption with thp enabled
|
expand
|
--- a/include/linux/secretmem.h~mm-fix-null-page-mapping-dereference-in-page_is_secretmem +++ a/include/linux/secretmem.h @@ -23,7 +23,7 @@ static inline bool page_is_secretmem(str mapping = (struct address_space *) ((unsigned long)page->mapping & ~PAGE_MAPPING_FLAGS); - if (mapping != page->mapping) + if (!mapping || mapping != page->mapping) return false; return mapping->a_ops == &secretmem_aops;