From patchwork Thu Jun 8 19:41:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 103402 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp2392251obh; Thu, 8 Jun 2017 12:41:53 -0700 (PDT) X-Received: by 10.98.80.76 with SMTP id e73mr38398518pfb.31.1496950913570; Thu, 08 Jun 2017 12:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496950913; cv=none; d=google.com; s=arc-20160816; b=Ijuj/uegjSWsYHSI4sYS1aEa0wkC/H0Z+hul4aNpFcVyh69zCAzkQ4Xdp/I15WvoOs t+PVaBhcbL8d99huFL1QYEp427JeOzFtvCzD7+hZGuuEiMpzluZK6LC5k/9yEEUqyMtZ nEuSROJu88vJ9i0+ZRvTyhmDP2f9IWwUkGFkqF/NM05z+1NWvNEx4ZK0JQKt4e5XBAJp EM2dEyZeIoY8pt0oseADtveDO3ZZcvVz1/duvh8lm5v6dsFzcWP0Bm409ICIrkTbfKPk HKUJlgnieDSloxayZt1WJ8iyp4QaHQKRxPw948GqaET8WvaEcMHXnkXZSRdqDfleY7ZW jeJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=VYkpZzTHQM2QIhT+ETSecHbrhW1jYMLIR+1GUtSDWgc=; b=qPOydaOFGGzU9QUBShcWy1JFQva0e3GfWddJFoG/7qcwDfpNMiWq4wUq0ymqFg+yrf TGzOvd4lEk3d6xJ8CUpqzGENs4pow5BuDX6x9St8XCfouKecAfP9+DHgycfcZmBDf37M Jg8Kw+YKKs2YZYT8ujmuZ99eRizQ4SQzcam93hLDVTp29Jh4xy1UulSuvqcaWvn1VvYq WOR8Rof8gx96Ij9AxHtPOOHWk1hiCpCccTrOi63drgEj0BeCtmTFiCu2vv5EC6kp500/ ZFsGMgEKM3OrvBD7BNVvulD3+VjcjZ9OZjeAPn909PW+MrlmLAuuxUFdUpHFYPi8KJHx BssQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si229291pfc.9.2017.06.08.12.41.53; Thu, 08 Jun 2017 12:41:53 -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=@linaro.org; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751727AbdFHTlv (ORCPT + 25 others); Thu, 8 Jun 2017 15:41:51 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36802 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751501AbdFHTlt (ORCPT ); Thu, 8 Jun 2017 15:41:49 -0400 Received: by mail-wm0-f45.google.com with SMTP id 7so144248887wmo.1 for ; Thu, 08 Jun 2017 12:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=VYkpZzTHQM2QIhT+ETSecHbrhW1jYMLIR+1GUtSDWgc=; b=kObMPLGTZiBW1IJtWuLOFkoIc9T/aAPHdVQmsULtajcn7hJj5iJTTltnB2ah2qH/2s tqaOzopsQSi0NZLIOqrriDPQqG4LVlvRKIAa+4T8ZCsAKu8qAFbtD3eVD/VVAuak4TmN 756jwcoh7dqeuldLiV2kHQmzjfrEcY9J26JOE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VYkpZzTHQM2QIhT+ETSecHbrhW1jYMLIR+1GUtSDWgc=; b=eR/QyrZ/xl4p1RPJ7sDtndm3gIpRPhanrJQBUVqc2Tnwk/mc2ImUBOxyzMscMbndAV iTLJXVR9d0fDTyZ1zgOj8X2djN85xOUFC6bNgPbhrFQN6vkDgIiVE40jsE3fEIREdVt4 Y8o4dT5WclWSot8YhB02+U/xQabnkgXNWggpVkk4nkRaZhqAGPY1/FfPOQt+h7kafUM3 r0djsusjM3x61DlDvUxb6canp6E9FHxrHrlkMfydsxHSIzHPJu64r/IUanr7dFAk06Al arRJacGc1jSyYzscgvMBZMt0CB7FEK3yKoL1M+R8Be0y8BILy3y88clNwpJSpeisOm0L sZNw== X-Gm-Message-State: AODbwcBi4pasHPtwPhB+/l3qdP2zs3Ee7ZOVHEWAg5Gy6KYi1eusD7H9 LaBNPX6vtdfHfFmd9SJrMg== X-Received: by 10.28.150.200 with SMTP id y191mr5000368wmd.77.1496950908018; Thu, 08 Jun 2017 12:41:48 -0700 (PDT) Received: from localhost.localdomain ([160.162.216.209]) by smtp.gmail.com with ESMTPSA id x20sm5585038wrd.63.2017.06.08.12.41.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 12:41:47 -0700 (PDT) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, jolsa@kernel.org, mingo@kernel.org, akpm@linux-foundation.org, zhongjiang@huawei.com, labbott@fedoraproject.org, mark.rutland@arm.com, Ard Biesheuvel Subject: [PATCH 0/2] arm64: fix crash when reading /proc/kcore Date: Thu, 8 Jun 2017 19:41:37 +0000 Message-Id: <20170608194139.9250-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a follow-up to patches from zhonjiang [0] and myself [1] that aim to solve a problem in the kcore code, which gets confused by the presence of block mappings in the vmalloc region. While fixing the crash is quite straight forward [2], we need to tweak the kcore code itself to ensure that it operates correctly on arm64. Fortunately, we can achieve this with two very simple changes: - replace a call to is_vmalloc_or_module_addr() in read_kcore() with a comparison of the kclist type field (#1) - enable CONFIG_ARCH_PROC_KCORE_TEXT for arm64 (#2) [0] http://marc.info/?l=linux-mm&m=149632393629295&w=2 [1] http://marc.info/?l=linux-mm&m=149685966530180&w=2 [2] http://marc.info/?l=linux-mm&m=149694975123959&w=2 Ard Biesheuvel (2): fs/proc: kcore: use kcore_list type to check for vmalloc/module address arm64: mm: select CONFIG_ARCH_PROC_KCORE_TEXT arch/arm64/Kconfig | 3 +++ fs/proc/kcore.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.9.3 Acked-by: Mark Rutland Tested-by: Mark Rutland Reviewed-by: Laura Abbott Reported-by: Tan Xiaojun Tested-by: Tan Xiaojun Reviewed-by: Jiri Olsa