Received: by 10.192.165.148 with SMTP id m20csp4143786imm; Mon, 30 Apr 2018 12:34:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpo07lMHQ2WNWJn8sr1SWnCLP8EZDI7aaINVsVHTR7vmCV2/dvVzxIgneF0hdaybgHSBI9z X-Received: by 2002:a17:902:c81:: with SMTP id 1-v6mr13376756plt.126.1525116868517; Mon, 30 Apr 2018 12:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525116868; cv=none; d=google.com; s=arc-20160816; b=CSe/XWY9vHsB+mKW/TxEPb4E3SFiGveIeEnksRy87FoFb8nJ7DH9JmtoEF5WGBA2rX daeMSeLvYM0ocxIcClJgX21WfGZZsKiW38/AzLW0tCGcoHu9ueiKjouf9pCgIht5OhW1 87+12lkhqNi63CQXib/g1E7DRqoJG/NrwxYdwrZkYZzofhOTKUBYzMpWyN8ER4/pnd0u 9/BTvSM1eSAhUK+J85ydHoSqlBMJBl4jq9n34SgGl9N4LSZeUzRSnhl7sUZGRtplcGU5 PTgo0X0KsOutlMaQ0t/FnyqFQ/Fw7Xsva/mrN5n0wHLoa8aBQOUTEslYM/HRcYbLDOgu hKDQ== 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:dmarc-filter :arc-authentication-results; bh=d2sktCTXonHWNgyGWNhINFCe3Ed9LjzOOp1phQs9pJs=; b=GUC6jbyxnffPoOPkYB3hOPZIlnTeh/yqzX9z1iyHiuk4W5RnRmUbi04SZILN1xHsr7 lLhr1U6mDyuO1g1JdmJvoAq9ylwY2uRX544RQtKYUkm0Nh72xl/Q6x+sqQpk7gDa/JoW 0roesMqiURvrkONEeIetqp8PaEG56DhWqfqRODFjv81Bbg7XfSqyZAwrf3h4CqXdkbuM 6jmuuMoRdRzpFq9XPk6CIyNVXmGB5JScZAnW8/HwQxs1hK+3fsIRtSP7ut7lLm21ASOI 7WVla9FXh4WlrRFhYaSyvGxZVQtNvU8cRXbO+ys9o59s7wNDghKF1FfTvDC44SNDxqjV RdSg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3-v6si7820840plb.536.2018.04.30.12.34.14; Mon, 30 Apr 2018 12:34:28 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756450AbeD3T2z (ORCPT + 99 others); Mon, 30 Apr 2018 15:28:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:36844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756427AbeD3T2q (ORCPT ); Mon, 30 Apr 2018 15:28:46 -0400 Received: from localhost (unknown [104.132.1.102]) (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 7589F22DCB; Mon, 30 Apr 2018 19:28:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7589F22DCB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds , Thomas Richter , Jessica Yu Subject: [PATCH 4.16 094/113] module: Fix display of wrong module .text address Date: Mon, 30 Apr 2018 12:25:05 -0700 Message-Id: <20180430184019.174472473@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@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: Thomas Richter commit be71eda5383faa663efdba9ef54a6b8255e3c7f0 upstream. Reading file /proc/modules shows the correct address: [root@s35lp76 ~]# cat /proc/modules | egrep '^qeth_l2' qeth_l2 94208 1 - Live 0x000003ff80401000 and reading file /sys/module/qeth_l2/sections/.text [root@s35lp76 ~]# cat /sys/module/qeth_l2/sections/.text 0x0000000018ea8363 displays a random address. This breaks the perf tool which uses this address on s390 to calculate start of .text section in memory. Fix this by printing the correct (unhashed) address. Thanks to Jessica Yu for helping on this. Fixes: ef0010a30935 ("vsprintf: don't use 'restricted_pointer()' when not restricting") Cc: # v4.15+ Suggested-by: Linus Torvalds Signed-off-by: Thomas Richter Cc: Jessica Yu Signed-off-by: Jessica Yu Signed-off-by: Greg Kroah-Hartman --- kernel/module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/kernel/module.c +++ b/kernel/module.c @@ -1472,7 +1472,8 @@ static ssize_t module_sect_show(struct m { struct module_sect_attr *sattr = container_of(mattr, struct module_sect_attr, mattr); - return sprintf(buf, "0x%pK\n", (void *)sattr->address); + return sprintf(buf, "0x%px\n", kptr_restrict < 2 ? + (void *)sattr->address : NULL); } static void free_sect_attrs(struct module_sect_attrs *sect_attrs)