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:   Sat, 16 Dec 2017 08:58:19 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Tomeu Vizoso <tomeu.vizoso@...labora.com>
Cc:     kbuild-all@...org, dri-devel@...ts.freedesktop.org,
        Tomeu Vizoso <tomeu.vizoso@...labora.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        David Airlie <airlied@...ux.ie>,
        Jason Wang <jasowang@...hat.com>, linux-kernel@...r.kernel.org,
        virtualization@...ts.linux-foundation.org,
        Gerd Hoffmann <kraxel@...hat.com>
Subject: Re: [PATCH] drm/virtio: Add window server support

Hi Tomeu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.15-rc3]
[cannot apply to drm/drm-next drm-exynos/exynos-drm/for-next next-20171215]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Tomeu-Vizoso/drm-virtio-Add-window-server-support/20171216-081939
config: i386-randconfig-x002-201750 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10:0,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from include/uapi/linux/aio_abi.h:31,
                    from include/linux/syscalls.h:72,
                    from drivers/gpu/drm/virtio/virtgpu_ioctl.c:29:
   drivers/gpu/drm/virtio/virtgpu_ioctl.c: In function 'winsrv_ioctl_rx':
   drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      if (copy_to_user((void *)cmd->data + read_count,
                       ^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:3: note: in expansion of macro 'if'
      if (copy_to_user((void *)cmd->data + read_count,
      ^~
   drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      if (copy_to_user((void *)cmd->data + read_count,
                       ^
   include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^~~~
>> drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:3: note: in expansion of macro 'if'
      if (copy_to_user((void *)cmd->data + read_count,
      ^~
   drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      if (copy_to_user((void *)cmd->data + read_count,
                       ^
   include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^~~~
>> drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:3: note: in expansion of macro 'if'
      if (copy_to_user((void *)cmd->data + read_count,
      ^~
   drivers/gpu/drm/virtio/virtgpu_ioctl.c: In function 'winsrv_ioctl':
   drivers/gpu/drm/virtio/virtgpu_ioctl.c:615:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
        (const char __user *) winsrv_cmd.data,
        ^

vim +/if +562 drivers/gpu/drm/virtio/virtgpu_ioctl.c

   547	
   548	static int winsrv_ioctl_rx(struct virtio_gpu_device *vgdev,
   549				   struct virtio_gpu_winsrv_conn *conn,
   550				   struct drm_virtgpu_winsrv *cmd)
   551	{
   552		struct virtio_gpu_winsrv_rx_qentry *qentry, *tmp;
   553		struct virtio_gpu_winsrv_rx *virtio_cmd;
   554		int available_len = cmd->len;
   555		int read_count = 0;
   556	
   557		list_for_each_entry_safe(qentry, tmp, &conn->cmdq, next) {
   558			virtio_cmd = qentry->cmd;
   559			if (virtio_cmd->len > available_len)
   560				return 0;
   561	
 > 562			if (copy_to_user((void *)cmd->data + read_count,
   563					 virtio_cmd->data,
   564					 virtio_cmd->len)) {
   565				/* return error unless we have some data to return */
   566				if (read_count == 0)
   567					return -EFAULT;
   568			}
   569	
   570			/*
   571			 * here we could export resource IDs to FDs, but no protocol
   572			 * as of today requires it
   573			 */
   574	
   575			available_len -= virtio_cmd->len;
   576			read_count += virtio_cmd->len;
   577	
   578			virtio_gpu_queue_winsrv_rx_in(vgdev, virtio_cmd);
   579	
   580			list_del(&qentry->next);
   581			kfree(qentry);
   582		}
   583	
   584		cmd->len = read_count;
   585	
   586		return 0;
   587	}
   588	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (27343 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ