lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <SJ1PR11MB61538E0E3F5DF58CB528C90BBFF62@SJ1PR11MB6153.namprd11.prod.outlook.com>
Date: Thu, 6 Feb 2025 01:31:48 +0000
From: "Li, Fei1" <fei1.li@...el.com>
To: Haoyu Li <lihaoyu499@...il.com>, Shuo Liu <shuo.a.liu@...el.com>, "Chatre,
 Reinette" <reinette.chatre@...el.com>, Zhi Wang <zhi.a.wang@...el.com>, "Greg
 Kroah-Hartman" <gregkh@...uxfoundation.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"chenyuan0y@...il.com" <chenyuan0y@...il.com>, "stable@...r.kernel.org"
	<stable@...r.kernel.org>
Subject: RE: [PATCH] drivers: virt: acrn: hsm: Use kzalloc to avoid info leak
 in pmcmd_ioctl

> -----Original Message-----
> From: Haoyu Li <lihaoyu499@...il.com>
> Sent: Thursday, January 30, 2025 7:58 PM
> To: Li, Fei1 <fei1.li@...el.com>; Shuo Liu <shuo.a.liu@...el.com>; Chatre,
> Reinette <reinette.chatre@...el.com>; Zhi Wang <zhi.a.wang@...el.com>;
> Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: linux-kernel@...r.kernel.org; chenyuan0y@...il.com; Haoyu Li
> <lihaoyu499@...il.com>; stable@...r.kernel.org
> Subject: [PATCH] drivers: virt: acrn: hsm: Use kzalloc to avoid info leak in
> pmcmd_ioctl
> 
> In the "pmcmd_ioctl" function, three memory objects allocated by kmalloc are
> initialized by "hcall_get_cpu_state", which are then copied to user space. The
> initializer is indeed implemented in "acrn_hypercall2"
> (arch/x86/include/asm/acrn.h). There is a risk of information leakage due to
> uninitialized bytes.
> 
> Fixes: 3d679d5aec64 ("virt: acrn: Introduce interfaces to query C-states and P-
> states allowed by hypervisor")
> Signed-off-by: Haoyu Li <lihaoyu499@...il.com>
Acked-by: Fei Li <fei1.li@...el.com>
Thanks.
> Cc: stable@...r.kernel.org
> ---
>  drivers/virt/acrn/hsm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/virt/acrn/hsm.c b/drivers/virt/acrn/hsm.c index
> c24036c4e51e..e4e196abdaac 100644
> --- a/drivers/virt/acrn/hsm.c
> +++ b/drivers/virt/acrn/hsm.c
> @@ -49,7 +49,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr)
>  	switch (cmd & PMCMD_TYPE_MASK) {
>  	case ACRN_PMCMD_GET_PX_CNT:
>  	case ACRN_PMCMD_GET_CX_CNT:
> -		pm_info = kmalloc(sizeof(u64), GFP_KERNEL);
> +		pm_info = kzalloc(sizeof(u64), GFP_KERNEL);
>  		if (!pm_info)
>  			return -ENOMEM;
> 
> @@ -64,7 +64,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr)
>  		kfree(pm_info);
>  		break;
>  	case ACRN_PMCMD_GET_PX_DATA:
> -		px_data = kmalloc(sizeof(*px_data), GFP_KERNEL);
> +		px_data = kzalloc(sizeof(*px_data), GFP_KERNEL);
>  		if (!px_data)
>  			return -ENOMEM;
> 
> @@ -79,7 +79,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr)
>  		kfree(px_data);
>  		break;
>  	case ACRN_PMCMD_GET_CX_DATA:
> -		cx_data = kmalloc(sizeof(*cx_data), GFP_KERNEL);
> +		cx_data = kzalloc(sizeof(*cx_data), GFP_KERNEL);
>  		if (!cx_data)
>  			return -ENOMEM;
> 
> --
> 2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ