Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3436960pxb; Wed, 13 Oct 2021 06:06:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrsUx16tTfF4CE4fRo1q7sdYzxYSaeJUiJPwpG0DBGcCFYDhub6wHHtg17IpTQG85GBk9D X-Received: by 2002:a17:90a:688c:: with SMTP id a12mr13314093pjd.227.1634130416619; Wed, 13 Oct 2021 06:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634130416; cv=none; d=google.com; s=arc-20160816; b=vGjmovZ7Z2ugXjwe2/Vp9I3HdrYIQoPyv+TGpFr2PweUZwYEQFZvp2cb6DO2urjIww FeklvdNiT570l9AO95jhEiAEIln71mgAqJvjKcxuBp8oDfaQLTSrNcOpap2xCFRCuNJb +4hIpiLEizye3S0fQbDrJqtLQ03bRNnopDJ4FFUoR8hSZSuFFB/7V1gnbzy8g1OUMvXj usS14BQ4kQGQsxBMoCcCGAP1oFGb8xZsDypNT0AACHnxUu3ZTNvS8DJx1duGVr28VhzN kfVKayTLkven/DSMTac2W/smWE+rz1iiB0l4M3FdtW+vcEG5en8TPQ/Q9uPvwUJqHDnR 4ERw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=JXvZYN4M85U79OB8iXawC8xD5OLSe8OsQ06W71TsNtY=; b=ircRAx1Zav7yV5inX2QR9J5QYDMCTWh2q7PSqAEUuJS5vEL4HRlO941K+ks5JJH42W nK6csy2CI8hRLiieCZCsixpmG6kedNiUjGrOeTpM6RboqT5BEnWVHoe9PaEnuCE+/4Uh yAL+b+Kp9t3D+8a0MaBoSwY1sq/17Nsf1JwIG6Tv6Iz+kvyvLCkEGHj/d0VwtOe19H57 Vpzxl6WsuN0R5XzkP73JeKYn0h7w3TpK1EQB27Us4X/sLwkmhoKYI1Qel4Ly/AoyOmhJ 4V2gJQD2h2O6VCDs9DZMZ1CgCxZubLhX+wIsqPBJ8vnYYQfPySUabV/lV3suZtnKJzdP I4xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f130si6085574pgc.557.2021.10.13.06.06.22; Wed, 13 Oct 2021 06:06:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233468AbhJMNHI (ORCPT + 99 others); Wed, 13 Oct 2021 09:07:08 -0400 Received: from smtp181.sjtu.edu.cn ([202.120.2.181]:46540 "EHLO smtp181.sjtu.edu.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232645AbhJMNHH (ORCPT ); Wed, 13 Oct 2021 09:07:07 -0400 Received: from proxy02.sjtu.edu.cn (smtp188.sjtu.edu.cn [202.120.2.188]) by smtp181.sjtu.edu.cn (Postfix) with ESMTPS id D4CB21008CBC0 for ; Wed, 13 Oct 2021 21:05:01 +0800 (CST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy02.sjtu.edu.cn (Postfix) with ESMTP id ADAF1200B574F; Wed, 13 Oct 2021 21:05:00 +0800 (CST) X-Virus-Scanned: amavisd-new at Received: from proxy02.sjtu.edu.cn ([127.0.0.1]) by localhost (proxy02.sjtu.edu.cn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ckdCJM8oQ-5q; Wed, 13 Oct 2021 21:04:59 +0800 (CST) Received: from guozhi-ipads.ipads-lab.se.sjtu.edu.cn (unknown [202.120.40.82]) (Authenticated sender: qtxuning1999@sjtu.edu.cn) by proxy02.sjtu.edu.cn (Postfix) with ESMTPSA id 7CA72200B5750; Wed, 13 Oct 2021 21:04:56 +0800 (CST) From: Guo Zhi Cc: Guo Zhi , linux-kernel@vger.kernel.org Subject: [PATCH] kernel/kallsym.c: Fix kernel pointer leak Date: Wed, 13 Oct 2021 21:04:46 +0800 Message-Id: <20211013130446.237421-1-qtxuning1999@sjtu.edu.cn> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pointers should be printed with %p rather than %px which printed kernel pointer directly. Change %px to %p to print the secured pointer. Signed-off-by: Guo Zhi --- kernel/kallsyms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 0ba87982d017..5a8ea50ce812 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -760,10 +760,10 @@ static int s_show(struct seq_file *m, void *p) */ type = iter->exported ? toupper(iter->type) : tolower(iter->type); - seq_printf(m, "%px %c %s\t[%s]\n", value, + seq_printf(m, "%p %c %s\t[%s]\n", value, type, iter->name, iter->module_name); } else - seq_printf(m, "%px %c %s\n", value, + seq_printf(m, "%p %c %s\n", value, iter->type, iter->name); return 0; } -- 2.33.0