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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190619102520.GC17204@e110455-lin.cambridge.arm.com>
Date:   Wed, 19 Jun 2019 11:25:20 +0100
From:   Liviu Dudau <Liviu.Dudau@....com>
To:     "james qian wang (Arm Technology China)" <james.qian.wang@....com>
Cc:     "airlied@...ux.ie" <airlied@...ux.ie>,
        Brian Starkey <Brian.Starkey@....com>,
        "maarten.lankhorst@...ux.intel.com" 
        <maarten.lankhorst@...ux.intel.com>,
        "sean@...rly.run" <sean@...rly.run>,
        "arnd@...db.de" <arnd@...db.de>,
        "Jonathan Chai (Arm Technology China)" <Jonathan.Chai@....com>,
        "Julien Yin (Arm Technology China)" <Julien.Yin@....com>,
        "thomas Sun (Arm Technology China)" <thomas.Sun@....com>,
        "Lowry Li (Arm Technology China)" <Lowry.Li@....com>,
        Ayan Halder <Ayan.Halder@....com>,
        "Tiannan Zhu (Arm Technology China)" <Tiannan.Zhu@....com>,
        "Yiqi Kang (Arm Technology China)" <Yiqi.Kang@....com>,
        nd <nd@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        Ben Davis <Ben.Davis@....com>,
        "Oscar Zhang (Arm Technology China)" <Oscar.Zhang@....com>,
        "Channing Chen (Arm Technology China)" <Channing.Chen@....com>
Subject: Re: [PATCH] drm/komeda: Correct printk format specifier for "size_t"

On Wed, Jun 19, 2019 at 08:42:45AM +0100, james qian wang (Arm Technology China) wrote:
> Warnings popup when "make ARCH=i386"
> 
> In file included from include/drm/drm_mm.h:49,
>                  from include/drm/drm_vma_manager.h:26,
>                  from include/drm/drm_gem.h:40,
>                  from drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c:9:
> drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c: In function 'komeda_fb_afbc_size_check':
> drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c:96:17: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
>    DRM_DEBUG_KMS("afbc size check failed, obj_size: 0x%lx. min_size 0x%x.\n",
> 
> That leads by misuse "%lx" as format speicifier for size_t, correct it
> to "%zx"
> 
> Reported-by: kbuild test robot <lkp@...el.com>
> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@....com>

Reviewed-by: Liviu Dudau <liviu.dudau@....com>

Best regards,
Liviu

> ---
>  .../gpu/drm/arm/display/komeda/komeda_framebuffer.c   | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
> index abc8c0ccc053..3b0a70ed6aa0 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
> @@ -43,8 +43,8 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file,
>  	struct drm_framebuffer *fb = &kfb->base;
>  	const struct drm_format_info *info = fb->format;
>  	struct drm_gem_object *obj;
> -	u32 alignment_w = 0, alignment_h = 0, alignment_header;
> -	u32 n_blocks = 0, min_size = 0;
> +	u32 alignment_w = 0, alignment_h = 0, alignment_header, n_blocks;
> +	u64 min_size;
>  
>  	obj = drm_gem_object_lookup(file, mode_cmd->handles[0]);
>  	if (!obj) {
> @@ -93,7 +93,7 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file,
>  			       AFBC_SUPERBLK_ALIGNMENT);
>  	min_size = kfb->afbc_size + fb->offsets[0];
>  	if (min_size > obj->size) {
> -		DRM_DEBUG_KMS("afbc size check failed, obj_size: 0x%lx. min_size 0x%x.\n",
> +		DRM_DEBUG_KMS("afbc size check failed, obj_size: 0x%zx. min_size 0x%llx.\n",
>  			      obj->size, min_size);
>  		goto check_failed;
>  	}
> @@ -114,7 +114,8 @@ komeda_fb_none_afbc_size_check(struct komeda_dev *mdev, struct komeda_fb *kfb,
>  	struct drm_framebuffer *fb = &kfb->base;
>  	const struct drm_format_info *info = fb->format;
>  	struct drm_gem_object *obj;
> -	u32 i, min_size, block_h;
> +	u32 i, block_h;
> +	u64 min_size;
>  
>  	if (komeda_fb_check_src_coords(kfb, 0, 0, fb->width, fb->height))
>  		return -EINVAL;
> @@ -137,7 +138,7 @@ komeda_fb_none_afbc_size_check(struct komeda_dev *mdev, struct komeda_fb *kfb,
>  		min_size = komeda_fb_get_pixel_addr(kfb, 0, fb->height, i)
>  			 - to_drm_gem_cma_obj(obj)->paddr;
>  		if (obj->size < min_size) {
> -			DRM_DEBUG_KMS("The fb->obj[%d] size: %ld lower than the minimum requirement: %d.\n",
> +			DRM_DEBUG_KMS("The fb->obj[%d] size: 0x%zx lower than the minimum requirement: 0x%llx.\n",
>  				      i, obj->size, min_size);
>  			return -EINVAL;
>  		}
> -- 
> 2.17.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ