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]
Date:   Thu, 23 Jan 2020 13:07:27 +0800
From:   Zhenyu Wang <zhenyuw@...ux.intel.com>
To:     Igor Druzhinin <igor.druzhinin@...rix.com>
Cc:     intel-gvt-dev@...ts.freedesktop.org,
        intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org, zhenyuw@...ux.intel.com,
        zhi.a.wang@...el.com, jani.nikula@...ux.intel.com,
        joonas.lahtinen@...ux.intel.com, rodrigo.vivi@...el.com,
        airlied@...ux.ie, daniel@...ll.ch
Subject: Re: [PATCH] drm/i915/gvt: fix high-order allocation failure on late
 load

On 2020.01.22 20:10:24 +0000, Igor Druzhinin wrote:
> If the module happens to be loaded later at runtime there is a chance
> memory is already fragmented enough to fail allocation of firmware
> blob storage and consequently GVT init. Since it doesn't seem to be
> necessary to have the blob contiguous, use vmalloc() instead to avoid
> the issue.
> 
> Signed-off-by: Igor Druzhinin <igor.druzhinin@...rix.com>
> ---
>  drivers/gpu/drm/i915/gvt/firmware.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/firmware.c b/drivers/gpu/drm/i915/gvt/firmware.c
> index 049775e..b0c1fda 100644
> --- a/drivers/gpu/drm/i915/gvt/firmware.c
> +++ b/drivers/gpu/drm/i915/gvt/firmware.c
> @@ -146,7 +146,7 @@ void intel_gvt_free_firmware(struct intel_gvt *gvt)
>  		clean_firmware_sysfs(gvt);
>  
>  	kfree(gvt->firmware.cfg_space);
> -	kfree(gvt->firmware.mmio);
> +	vfree(gvt->firmware.mmio);
>  }
>  
>  static int verify_firmware(struct intel_gvt *gvt,
> @@ -229,7 +229,7 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt)
>  
>  	firmware->cfg_space = mem;
>  
> -	mem = kmalloc(info->mmio_size, GFP_KERNEL);
> +	mem = vmalloc(info->mmio_size);
>  	if (!mem) {
>  		kfree(path);
>  		kfree(firmware->cfg_space);
> -- 
> 2.7.4
>

Looks fine to me. Thanks!

Reviewed-by: Zhenyu Wang <zhenyuw@...ux.intel.com>

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ