Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp747483pxb; Wed, 29 Sep 2021 08:54:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAQLfyBf4M2AckLVTINrioJNXF5U3qhZYKaIXu6H13IJ/NQm7DkxuYcHIj8PW4ZdPfAUu9 X-Received: by 2002:a17:906:3395:: with SMTP id v21mr559269eja.210.1632930843193; Wed, 29 Sep 2021 08:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632930843; cv=none; d=google.com; s=arc-20160816; b=z+t/12akn8QeyqlHUDvhCaIsx9mhAAmmxJB6YU4X0BUIH+rnrxf+MtZ4SLM6FdZdLI MvdEBa4EUhWKBB8rmnPUUSJ+JOlJuDOSvb3ay/5fOp0KPrg9B6PVZp8XMlNqyKtoLWdM dxX+/W2zxZWcGoa+zJpbi2z9/9R3iofWDzfRJKCnXIyXjQTB/J0SC0hsvr89bTzu2Fyl ybqpQUjl0PnQGwyO69jC5zcPB8i7ZY54b4/78EdGiQgzLXFzs+5WOhLwG5MvIAjOJQGJ /q4nS0mxZa1MKMoR9xJBken1XsGJs0WLuYhxmdtOSkjemP5NxthySZwn0ez0754OTV5Z NjbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=VpJFG+HRBci4jU3mMMTVdmRRIFNrT+58BXbO4YO62cw=; b=B7KNG32OQqpxPgkD4AfJNJhGrm4HQY+qakjiTAjqhNrYzKqVs1Yfm20Qwg02mG+yE0 dvbbFvqp1iL0bn0/XnUFHJfbVN6zPRMTj5+4F59/IXlJEiSlnKxx7RqWlp0yIn9mgWVQ KwRgxYaLfg/cijDCzdzcFVj3XszNMD4N//UyW95ZrY7+0lSVUmkZYYCpnt3J4BrfUKIj kt3GoZF38gGYLA0fyPHiFKrsi4mqxOJblCOaz9/HbvDCeli1K8sVyx0V3MHJYNAFlRZF omjFt1mbecp7eWDwurBK/7tHzFS3HHv9JTrcYekX0tWZ/jcs1+PTCbc+t11QXpytML2L LscA== 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 v2si228755ejk.531.2021.09.29.08.53.38; Wed, 29 Sep 2021 08:54:03 -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 S1344110AbhI2NTT (ORCPT + 99 others); Wed, 29 Sep 2021 09:19:19 -0400 Received: from smtp181.sjtu.edu.cn ([202.120.2.181]:45458 "EHLO smtp181.sjtu.edu.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242801AbhI2NTR (ORCPT ); Wed, 29 Sep 2021 09:19:17 -0400 Received: from proxy02.sjtu.edu.cn (smtp188.sjtu.edu.cn [202.120.2.188]) by smtp181.sjtu.edu.cn (Postfix) with ESMTPS id 7E4CB1008CBC1; Wed, 29 Sep 2021 21:17:34 +0800 (CST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy02.sjtu.edu.cn (Postfix) with ESMTP id 683C3200B5753; Wed, 29 Sep 2021 21:17:34 +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 VQDhVj2_m4GK; Wed, 29 Sep 2021 21:17:34 +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 0C34E200B574E; Wed, 29 Sep 2021 21:17:28 +0800 (CST) From: Guo Zhi To: Alexander Viro Cc: Guo Zhi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs/elf: Fix kernel pointer leak Date: Wed, 29 Sep 2021 21:17:02 +0800 Message-Id: <20210929131703.1163417-1-qtxuning1999@sjtu.edu.cn> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- fs/binfmt_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index f3523807dbca..440a483656ed 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -393,7 +393,7 @@ static unsigned long elf_map(struct file *filep, unsigned long addr, if ((type & MAP_FIXED_NOREPLACE) && PTR_ERR((void *)map_addr) == -EEXIST) - pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n", + pr_info("%d (%s): Uhuuh, elf segment at %p requested but the memory is mapped already\n", task_pid_nr(current), current->comm, (void *)addr); return(map_addr); -- 2.33.0