From patchwork Wed Nov 5 18:03:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 40217 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B23992404A for ; Wed, 5 Nov 2014 18:03:54 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf1206038wiv.6 for ; Wed, 05 Nov 2014 10:03:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:in-reply-to:user-agent:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-disposition; bh=94wu6uAUj+1ZeuQvoou1Ge1WtpKStgXcTuVuD5jIJnU=; b=W4T8PoEmQ/FFbk5eDKUkUM8aDm3+M46U17RGZOdczG3lD/y5Lo1fNHovIjnezxlVIw DokgjyKLVoUsovOvg3GDcEhbdshRnvNfSXB1FLwGLC1fmobl7Y1gjHvvlZPnCLEDC+8s SFu0GNnIjdT5bTkR471yNxn61uN4IPvGhE5NflxiLl4cVHy5xCwQajV37xmyLRtptBFh 7H/wsoBdAbhmpjm02+H1m5O70RYCHZiuCkgAQNzg1ruT5TUfgQrdbipwxN8vJxnyJJJ/ 0eyxScaJ4xrXhzU4VkSBlxO/EaYq+E7RpzEGZv0lutE8pQCA38szRapxQyFSyAqHA/JM lMxw== X-Gm-Message-State: ALoCoQlRIgXOePcJ+0Vyu+ZyyNB1M4eL7z+7x4tYTvo+SNIVaPe3tczeez+MAtid6Q1JNvvDLkL+ X-Received: by 10.112.247.74 with SMTP id yc10mr4457083lbc.8.1415210633548; Wed, 05 Nov 2014 10:03:53 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.205 with SMTP id ba13ls115792lab.33.gmail; Wed, 05 Nov 2014 10:03:53 -0800 (PST) X-Received: by 10.152.6.228 with SMTP id e4mr69839357laa.71.1415210633377; Wed, 05 Nov 2014 10:03:53 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id an7si7334755lac.128.2014.11.05.10.03.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Nov 2014 10:03:53 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so1255027lbj.13 for ; Wed, 05 Nov 2014 10:03:53 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr69222826lbc.23.1415210632984; Wed, 05 Nov 2014 10:03:52 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp327635lbc; Wed, 5 Nov 2014 10:03:52 -0800 (PST) X-Received: by 10.68.219.35 with SMTP id pl3mr17126297pbc.143.1415210631219; Wed, 05 Nov 2014 10:03:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id px9si3611595pdb.159.2014.11.05.10.03.50 for ; Wed, 05 Nov 2014 10:03:51 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750951AbaKESDt (ORCPT + 25 others); Wed, 5 Nov 2014 13:03:49 -0500 Received: from foss-mx-na.foss.arm.com ([217.140.108.86]:53541 "EHLO foss-mx-na.foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750706AbaKESDr (ORCPT ); Wed, 5 Nov 2014 13:03:47 -0500 Received: from foss-smtp-na-1.foss.arm.com (unknown [10.80.61.8]) by foss-mx-na.foss.arm.com (Postfix) with ESMTP id 2A9BC1AA; Wed, 5 Nov 2014 12:03:33 -0600 (CST) Received: from collaborate-mta1.arm.com (highbank-bc01-b06.austin.arm.com [10.112.81.134]) by foss-smtp-na-1.foss.arm.com (Postfix) with ESMTP id EA8965FAD7; Wed, 5 Nov 2014 12:03:25 -0600 (CST) Received: from e104818-lin.cambridge.arm.com (e104818-lin.cambridge.arm.com [10.1.203.148]) by collaborate-mta1.arm.com (Postfix) with ESMTPS id 3CBB113F91E; Wed, 5 Nov 2014 12:03:25 -0600 (CST) Date: Wed, 5 Nov 2014 18:03:23 +0000 From: Catalin Marinas To: Miles Lane Cc: LKML Subject: Re: Linus GIT 3.18.0-rc2+ - BUG: unable to handle kernel paging request at ffff88021dc52000 - IP: [] scan_block+0x59/0x100 Message-ID: <20141105180322.GO32700@e104818-lin.cambridge.arm.com> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: catalin.marinas@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline On Sat, Nov 01, 2014 at 10:11:39PM +0000, Miles Lane wrote: > [ 69.271345] BUG: unable to handle kernel paging request at ffff88021dc52000 > [ 69.271417] IP: [] scan_block+0x59/0x100 [...] > [ 69.273425] Call Trace: > [ 69.273452] [] ? _raw_spin_lock_irqsave+0x48/0x52 > [ 69.273506] [] ? scan_gray_list+0xe2/0x15f > [ 69.273561] [] scan_gray_list+0xb7/0x15f > [ 69.273615] [] kmemleak_scan+0x294/0x45e > [ 69.273662] [] ? kmemleak_write+0x354/0x354 > [ 69.273711] [] kmemleak_scan_thread+0x82/0xa4 It looks like kmemleak scans an object which is not mapped. Unfortunately, it doesn't tell us where the object has been allocated. As a quick hack, for an architecture that implements kern_addr_valid() by walking the page tables (I think x86_64 does it), could you try this patch and see if it reports any more information? Once we know which object, we can call kmemleak_no_scan() or kmemleak_ignore() on such object. (another solution would be to use get_user in combination with set_fs during scanning to trap such faulting accesses) Thanks. diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 3cda50c1e394..eab2bf39a3f3 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1226,6 +1226,12 @@ static void scan_object(struct kmemleak_object *object) if (!(object->flags & OBJECT_ALLOCATED)) /* already freed object */ goto out; + if (!kern_addr_valid(object->pointer)) { + kmemleak_warn("Invalid object address: 0x%08lx\n", + object->pointer); + dump_object_info(object); + goto out; + } if (hlist_empty(&object->area_list)) { void *start = (void *)object->pointer; void *end = (void *)(object->pointer + object->size);