Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2215405imm; Mon, 28 May 2018 04:06:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZquYOFuQvDvF8Rn12DCtHy/OUuj8mNXefE3/nEPlo7RTdXwhP6KPqqbKEyNpP6SvTaihAsf X-Received: by 2002:a17:902:b789:: with SMTP id e9-v6mr13208437pls.102.1527505606574; Mon, 28 May 2018 04:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527505606; cv=none; d=google.com; s=arc-20160816; b=SZemtIII4Tl1ycZfYxCgiov7hGgUIokVdnWtNkGI94nXHWMx/x/9/QWwxpC0dsh7IV cO0J5IT7mPTkOf4gs0UVobLUuH6Ke94dSBtSzx3I9vuOEseuqWS0tlbTq131/tw5uENc UVGJbCymAyzrD8FCgqMN6bpKbVtdju5FVpqEdhyYo2xDSS4zNxKiZasHS8Gz0iR2se+Y FQVuMt7ucw2PnBBXHt5QNEDUNhNuWyubHb0nYqp6cl5bLswk3XAzQ1y0cmDmETjZY4jx vEDEQY1pDzybUeM/KAoGpoPQpeF+JA5p6dbZ6Dmh4Fs59IKdVZwulJ625QQlC9i66/pn ObMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=j1Jb3HRWxz80ZAMKaoPlVp1kHtyT6GizBbWBQZwUZm4=; b=JAMIw16vUunH7y+kvA1TgBHvCWPsu3dPyAYctWY1dGsnMzPUQdmvXRvpwxIpk8pO+a 1uEELh71lPQxMH2r6p0GS07NVBYsmggUlyuDrmtdV5XkCoBn3hqBDff93NLCCEYdP+WE TqT4Q12zRqujG1iy/sK3U0d7tHd4GtyhDExzoPCV9Sm3n0USwRPk/QARvkJuvV9C5fxx E/TAmVtIQ2bbP6vLeCUmK7kf1mlyEJchD6w0Untu8Ao5oUkLTn7UTNb+HoFeGQmarzf5 32rQsVuoYghzLxV8ML5uYxy6ZgW37EbndkBFloS7jKMa+OE3Vw2nZC8vzya4Q+Fb3kcN YBTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NWX5iJVg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n17-v6si30688779pfg.227.2018.05.28.04.06.31; Mon, 28 May 2018 04:06:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=NWX5iJVg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423147AbeE1LFh (ORCPT + 99 others); Mon, 28 May 2018 07:05:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423121AbeE1LFb (ORCPT ); Mon, 28 May 2018 07:05:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7BE2C208A4; Mon, 28 May 2018 11:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505531; bh=zXn2GqEEuFosAx/HUbMthHYH7A4HFTXjzDHJmjZ26a0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NWX5iJVg9ItqwauJBYAcXYhh/BB8yWqodk0p95faHL4faCA91oUaqfhrSPygofmx7 G3WYp7EeKFPH6ysQgLVccpkiIOCAh0SWumQJJNZtH8G86IF4SLbFrOi4QLO0GhtrEu xiDzALtptJtyv87LIbYEsVlhcjgrvCuCIJ2KO9E8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Hildenbrand , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton , Linus Torvalds Subject: [PATCH 4.16 036/272] kasan: fix memory hotplug during boot Date: Mon, 28 May 2018 12:01:09 +0200 Message-Id: <20180528100243.814846036@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100240.256525891@linuxfoundation.org> References: <20180528100240.256525891@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Hildenbrand commit 3f1959721558a976aaf9c2024d5bc884e6411bf7 upstream. Using module_init() is wrong. E.g. ACPI adds and onlines memory before our memory notifier gets registered. This makes sure that ACPI memory detected during boot up will not result in a kernel crash. Easily reproducible with QEMU, just specify a DIMM when starting up. Link: http://lkml.kernel.org/r/20180522100756.18478-3-david@redhat.com Fixes: 786a8959912e ("kasan: disable memory hotplug") Signed-off-by: David Hildenbrand Acked-by: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/kasan/kasan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c @@ -897,5 +897,5 @@ static int __init kasan_memhotplug_init( return 0; } -module_init(kasan_memhotplug_init); +core_initcall(kasan_memhotplug_init); #endif