From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbdK0Xlf (ORCPT ); Mon, 27 Nov 2017 18:41:35 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:43859 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915AbdK0Xl3 (ORCPT ); Mon, 27 Nov 2017 18:41:29 -0500 X-ME-Sender: From: "Tobin C. Harding" To: Linus Torvalds Cc: "Tobin C. Harding" , "Jason A. Donenfeld" , "Theodore Ts'o" , Kees Cook , Paolo Bonzini , Tycho Andersen , "Roberts, William C" , Tejun Heo , Jordan Glover , Greg KH , Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky , Catalin Marinas , Will Deacon , Steven Rostedt , Chris Fries , Dave Weinstein , Daniel Micay , Djalal Harouni , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: [PATCH 4/5] KVM: use %px to print token identifier Date: Tue, 28 Nov 2017 10:40:57 +1100 Message-Id: <1511826058-2563-5-git-send-email-me@tobin.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511826058-2563-1-git-send-email-me@tobin.cc> References: <1511826058-2563-1-git-send-email-me@tobin.cc> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently token address is printed using %p. This exposes the address of the token in dmesg and potentially leaks sensitive information to userspace. In this instance the address is being used as a unique identifier for the token, we can use the newly defined printk specifier %px for exactly this purpose. Use the new %px specifier to print a unique identifier for the token. Signed-off-by: Tobin C. Harding --- virt/kvm/eventfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index f2ac53ab8243..9c700fdf571c 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -416,7 +416,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) irqfd->consumer.start = kvm_arch_irq_bypass_start; ret = irq_bypass_register_consumer(&irqfd->consumer); if (ret) - pr_info("irq bypass consumer (token %p) registration fails: %d\n", + pr_info("irq bypass consumer (token %px) registration fails: %d\n", irqfd->consumer.token, ret); } #endif -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tobin C. Harding" Subject: [PATCH 4/5] KVM: use %px to print token identifier Date: Tue, 28 Nov 2017 10:40:57 +1100 Message-ID: <1511826058-2563-5-git-send-email-me@tobin.cc> References: <1511826058-2563-1-git-send-email-me@tobin.cc> Cc: "Tobin C. Harding" , "Jason A. Donenfeld" , Theodore Ts'o , Kees Cook , Paolo Bonzini , Tycho Andersen , "Roberts, William C" , Tejun Heo , Jordan Glover , Greg KH , Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky , Catalin Marinas , Will Deacon , Steven Rostedt , Chris Fries , Dave Weinstein , Daniel Micay , To: Linus Torvalds Return-path: In-Reply-To: <1511826058-2563-1-git-send-email-me@tobin.cc> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Currently token address is printed using %p. This exposes the address of the token in dmesg and potentially leaks sensitive information to userspace. In this instance the address is being used as a unique identifier for the token, we can use the newly defined printk specifier %px for exactly this purpose. Use the new %px specifier to print a unique identifier for the token. Signed-off-by: Tobin C. Harding --- virt/kvm/eventfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index f2ac53ab8243..9c700fdf571c 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -416,7 +416,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) irqfd->consumer.start = kvm_arch_irq_bypass_start; ret = irq_bypass_register_consumer(&irqfd->consumer); if (ret) - pr_info("irq bypass consumer (token %p) registration fails: %d\n", + pr_info("irq bypass consumer (token %px) registration fails: %d\n", irqfd->consumer.token, ret); } #endif -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tobin C. Harding" Date: Tue, 28 Nov 2017 10:40:57 +1100 Message-Id: <1511826058-2563-5-git-send-email-me@tobin.cc> In-Reply-To: <1511826058-2563-1-git-send-email-me@tobin.cc> References: <1511826058-2563-1-git-send-email-me@tobin.cc> Subject: [kernel-hardening] [PATCH 4/5] KVM: use %px to print token identifier To: Linus Torvalds Cc: "Tobin C. Harding" , "Jason A. Donenfeld" , Theodore Ts'o , Kees Cook , Paolo Bonzini , Tycho Andersen , "Roberts, William C" , Tejun Heo , Jordan Glover , Greg KH , Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky , Catalin Marinas , Will Deacon , Steven Rostedt , Chris Fries , Dave Weinstein , Daniel Micay , Djalal Harouni , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kernel-hardening@lists.openwall.com List-ID: Currently token address is printed using %p. This exposes the address of the token in dmesg and potentially leaks sensitive information to userspace. In this instance the address is being used as a unique identifier for the token, we can use the newly defined printk specifier %px for exactly this purpose. Use the new %px specifier to print a unique identifier for the token. Signed-off-by: Tobin C. Harding --- virt/kvm/eventfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index f2ac53ab8243..9c700fdf571c 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -416,7 +416,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) irqfd->consumer.start = kvm_arch_irq_bypass_start; ret = irq_bypass_register_consumer(&irqfd->consumer); if (ret) - pr_info("irq bypass consumer (token %p) registration fails: %d\n", + pr_info("irq bypass consumer (token %px) registration fails: %d\n", irqfd->consumer.token, ret); } #endif -- 2.7.4