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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230925154333.55668-1-qiuxu.zhuo@intel.com>
Date:   Mon, 25 Sep 2023 23:43:33 +0800
From:   Qiuxu Zhuo <qiuxu.zhuo@...el.com>
To:     tglx@...utronix.de
Cc:     arjan@...ux.intel.com, bp@...en8.de, chang.seok.bae@...el.com,
        linux-kernel@...r.kernel.org, nik.borisov@...e.com, x86@...nel.org,
        qiuxu.zhuo@...el.com
Subject: Re: Subject: [patch V3 09/30] x86/microcode/intel: Switch to kvmalloc()

> ...
> From: Thomas Gleixner <tglx@...utronix.de>
> 
> Microcode blobs are getting larger and might soon reach the kmalloc()
> limit. Switch over kvmalloc().
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> 
> ---
>  arch/x86/kernel/cpu/microcode/intel.c |   50 +++++++++++++++++-----------------
>  1 file changed, 26 insertions(+), 24 deletions(-)
> ---
> --- a/arch/x86/kernel/cpu/microcode/intel.c
> +++ b/arch/x86/kernel/cpu/microcode/intel.c
> ... 
>  static void save_microcode_patch(struct microcode_intel *patch)
>  {
> -	struct microcode_intel *mc;
> +	unsigned int size = get_totalsize(&patch->hdr);
> +	struct microcode_intel *mc = NULL;

No need to initialize the 'mc' to NULL as it's unconditionally
set by the following kmemdup().

>  
> -	mc = kmemdup(patch, get_totalsize(&patch->hdr), GFP_KERNEL);
> +	mc = kvmemdup(patch, size, GFP_KERNEL);
>  	if (mc)
>  		update_ucode_pointer(mc);
> +	else
> +		pr_err("Unable to allocate microcode memory size: %u\n", size);
>  }
>  
> ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ