Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp996826ybp; Wed, 9 Oct 2019 07:25:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRZGO3TUgeUMzZTtdTxI06Jyah1ci8hv9na/FMi9LZXbOtt5g0V13RIkeaWEVuVgYCArF2 X-Received: by 2002:a17:906:af5c:: with SMTP id ly28mr3032305ejb.228.1570631140388; Wed, 09 Oct 2019 07:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570631140; cv=none; d=google.com; s=arc-20160816; b=RnBVqR1Aqo+gPAD8FE8wyENXTKbeBbGDgvYb/M/h+qD1tAh5fuXpexQoSFmRgXy29F fnNhFKrZm48N1J2/E6/kqNPuAGbCSuveSzBTj6vBicAkkLX36xHfnC21p3G0T1FV19rg VnDaZYClAAh6ioO+OgmmrVOcCynGF0rUZNPF+ljvx0duMCgci+Ejcu9azkPM4TquljKk tYs6/jYpjq6k3+Cj87wmI6zY1KqQqZYlXxfCzAlRR4ZW/KiglH9//aXFgqnhlAlrSWwU OJS8Ou1qSF4S3KiQW2j0xiSNf1TqxxNJFZWdKOtwTsOzJR6fnJ2SrUFOn3dxpOBr1GFZ Se9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ROXe+BrenNUp7Z1jUAfCHn7TlwTYTjHr9RXS600nyBU=; b=nHEic8ZfrLovmuAvbrAMaqNd1gfCrhbuIXd/EjqaW5/Z43s/of7Qzp76GvT+rJSpXc aSlQWGOVX5pRKy7zg8mOnJkdP0zH7uRDuhR2F5rGnrHpIsFhn2urEidh+NuxlPCtrSdB i/y+zZpO0V5fUCHUeqzkV1zVU3UNHxBP7z+XbNmr0iwlGCnPx587La4QOr0eXkUNqGNS XVN5kT1ShJQCEOKLkMx9gbKGNEqeMaFW6l2Mec0mVx6LSoNbDw9S9CGfr8qcRd/NjN+2 eEOGXZwMKhW/+yJO8y0JtPRAj2vluviwg+Ox7bh5c5btMb7FIuVUYAANj4yPUbFDi+1i mtFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id br24si1237597ejb.101.2019.10.09.07.25.13; Wed, 09 Oct 2019 07:25:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731443AbfJIOYn (ORCPT + 99 others); Wed, 9 Oct 2019 10:24:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43780 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729491AbfJIOYm (ORCPT ); Wed, 9 Oct 2019 10:24:42 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADD4333027C; Wed, 9 Oct 2019 14:24:42 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5258D60BF4; Wed, 9 Oct 2019 14:24:36 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Alexey Dobriyan , Andrew Morton , "Aneesh Kumar K.V" , Anthony Yznaga , Dan Williams , Michal Hocko , Mike Rapoport , Naoya Horiguchi , Pankaj gupta , Qian Cai , Stephen Rothwell , Toshiki Fukasawa Subject: [PATCH v2 0/2] mm: Don't access uninitialized memmaps in PFN walkers Date: Wed, 9 Oct 2019 16:24:33 +0200 Message-Id: <20191009142435.3975-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 09 Oct 2019 14:24:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is the follow-up of: [PATCH v1] mm: Fix access of uninitialized memmaps in fs/proc/page.c We have multiple places where we might access uninitialized memmaps and trigger kernel BUGs. Make sure to only access initialized memmaps. Some of these places got easier to trigger with: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory As memmaps are now also poisoned when memory is offlined, before it is actually removed. v1 -> v2: - Drop ZONE_DEVICE support from the /proc/k... files as requested by Michal - Further simplify the code - Split up into two patches David Hildenbrand (2): mm: Don't access uninitialized memmaps in fs/proc/page.c mm/memory-failure.c: Don't access uninitialized memmaps in memory_failure() fs/proc/page.c | 28 ++++++++++++++++------------ mm/memory-failure.c | 14 ++++++++------ 2 files changed, 24 insertions(+), 18 deletions(-) -- 2.21.0