[bug report] vdpa/mlx5: Add RX counters to debugfs

2023-01-06 Thread Dan Carpenter
ucast: 1522 remove_steering_counters(ndev, node); 1523 out_free: 1524 kvfree(spec); 1525 return err; 1526 } regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v2] vduse: Validate vq_num in vduse_validate_config()

2022-11-28 Thread Dan Carpenter
onfig) > > if (config->config_size > PAGE_SIZE) > > return false; > > > > + if (config->vq_num > 0x) > > What about using U16_MAX here? Where is the ->vq_num stored in a u16? I looked for this but didn't see it. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] vduse: Fix a possible warning in vduse_create_dev()

2022-11-27 Thread Dan Carpenter
--info and reload for the changes to propagate. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH v2] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-19 Thread Dan Carpenter
lement context init: add virtio_gpu_fence_event") Signed-off-by: Dan Carpenter --- v2: Style change. Use BIT_ULL(). drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/vi

Re: [PATCH] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-15 Thread Dan Carpenter
On Thu, Sep 15, 2022 at 05:45:46PM -0700, Chia-I Wu wrote: > On Thu, Sep 15, 2022 at 4:14 AM Dan Carpenter > wrote: > > > > The ->ring_idx_mask variable is a u64 so static checkers, Smatch in > > this case, complain if the BIT() is not also a u64. > > > >

[PATCH] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-15 Thread Dan Carpenter
lement context init: add virtio_gpu_fence_event") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 3b1701607aae..

Re: [PATCH] vduse: prevent uninitialized memory accesses

2022-08-27 Thread Dan Carpenter
he driver to store the config value. > > Signed-off-by: Maxime Coquelin This sounds like it needs a Fixes tag? regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundat

Re: [PATCH v7 1/4] vdpa: Add suspend operation

2022-08-11 Thread Dan Carpenter
On Thu, Aug 11, 2022 at 07:23:44AM -0400, Michael S. Tsirkin wrote: > On Thu, Aug 11, 2022 at 01:15:08PM +0300, Dan Carpenter wrote: > > On Thu, Aug 11, 2022 at 04:27:32AM -0400, Michael S. Tsirkin wrote: > > > On Wed, Aug 10, 2022 at 07:15:09PM +0200, Eugenio Pérez wrote: >

[bug report] vdpa/mlx5: Support different address spaces for control and data

2022-08-11 Thread Dan Carpenter
is a false positive but I don't know the code well enough to be sure. 2673 2674 out: 2675 up_write(>reslock); --> 2676 return err; 2677 } regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.l

Re: [PATCH v7 1/4] vdpa: Add suspend operation

2022-08-11 Thread Dan Carpenter
t make it work 100%. Maintainers massage and reformat the patches too much before applying them. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [linux-next:master] BUILD REGRESSION 088b9c375534d905a4d337c78db3b3bfbb52c4a0

2022-07-08 Thread Dan Carpenter
: from is NULL but dereferenced. drivers/android/binder.c:2920:29-33: ERROR: target_thread is NULL but dereferenced. drivers/android/binder.c:353:25-35: ERROR: node -> proc is NULL but dereferenced. drivers/android/binder.c:4888:16-20: ERROR: t is NULL but dereferenced. regards, dan

[PATCH 2/2] vdpa/mlx5: clean up indenting in handle_ctrl_vlan()

2022-06-07 Thread Dan Carpenter
These lines were supposed to be indented. Signed-off-by: Dan Carpenter --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index c964f4161d7f..83607b7488f1 100644

[PATCH 1/2] vdpa/mlx5: fix error code for deleting vlan

2022-06-07 Thread Dan Carpenter
Return success if we were able to delete a vlan. The current code always returns failure. Fixes: baf2ad3f6a98 ("vdpa/mlx5: Add RX MAC VLAN filter support") Signed-off-by: Dan Carpenter --- >From review. (Not tested). drivers/vdpa/mlx5/net/mlx5_vnet.c | 1 + 1 file changed

Re: [PATCH v3 2/4] vhost-vdpa: introduce STOP backend feature bit

2022-05-30 Thread Dan Carpenter
On Mon, May 30, 2022 at 05:27:25PM +0300, Dan Carpenter wrote: > On Fri, May 27, 2022 at 10:36:55AM +0300, Dan Carpenter wrote: > > static void match_pointer(struct expression *ret_value) > > { > > struct symbol *type; > > char *name; > > > &

Re: [PATCH v3 2/4] vhost-vdpa: introduce STOP backend feature bit

2022-05-30 Thread Dan Carpenter
On Fri, May 27, 2022 at 10:36:55AM +0300, Dan Carpenter wrote: > static void match_pointer(struct expression *ret_value) > { > struct symbol *type; > char *name; > > type = cur_func_return_type(); > if (!type || sval_type

Re: [PATCH v3 2/4] vhost-vdpa: introduce STOP backend feature bit

2022-05-27 Thread Dan Carpenter
On Fri, May 27, 2022 at 08:50:16AM +0200, Eugenio Perez Martin wrote: > On Thu, May 26, 2022 at 9:07 PM Dan Carpenter > wrote: > > > > On Thu, May 26, 2022 at 07:00:06PM +0200, Eugenio Perez Martin wrote: > > > > It feels like returning any literal th

Re: [PATCH v3 2/4] vhost-vdpa: introduce STOP backend feature bit

2022-05-26 Thread Dan Carpenter
Smatch interesting, especially when switching between projects > frequently. Does it support changing the code like clang-format? To > offload cognitive load to tools is usually good :). No. Coccinelle does that really well though. regards, dan carpenter ___

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
On Thu, May 26, 2022 at 03:28:25PM +0100, Matthew Wilcox wrote: > On Thu, May 26, 2022 at 11:48:32AM +0300, Dan Carpenter wrote: > > On Thu, May 26, 2022 at 02:16:34AM +0100, Matthew Wilcox wrote: > > > Bizarre this started showing up now. The recent patch was: > > >

Re: [PATCH v3 2/4] vhost-vdpa: introduce STOP backend feature bit

2022-05-26 Thread Dan Carpenter
like because they're likely the person who cares the most. ;) I don't think there are any static analysis tools which will complain about this. Smatch will complain if you return a negative literal. It feels like returning any literal that isn't 1 or 0 should trigger a warning... I've written that an

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
der() and folio_order() are 0-255. I guess because of the "unsigned char compound_order;" in the struct page. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
nsigned long type. Being able to generate > the cpp output would be helpful. That requires the .config. The heuristic is that "inode->i_blocks" is a u64 but this .config must be for a 32bit CPU. I'm just going to turn off all these warnings until I can figure out a better heuristic. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH] vhost-vdpa: return -EFAULT on copy_to_user() failure

2022-05-23 Thread Dan Carpenter
introduce uAPI to get the number of address spaces") Signed-off-by: Dan Carpenter --- drivers/vhost/vdpa.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 3e86080041fc..935a1d0ddb97 100644 --- a/drivers/vhost/vdpa.c

[PATCH] vdpasim: Off by one in vdpasim_set_group_asid()

2022-05-23 Thread Dan Carpenter
The > comparison needs to be >= to prevent an out of bounds access of the vdpasim->iommu[] array. The vdpasim->iommu[] is allocated in vdpasim_create() and it has vdpasim->dev_attr.nas elements. Fixes: 87e5afeac247 ("vdpasim: control virtqueue support") Signed-off-by: Da

Re: [PATCH v4 2/5] virtio-crypto: use private buffer for control request

2022-04-25 Thread Dan Carpenter
/20220424/202204242344.jepumdzp-...@intel.com/config) compiler: gcc-11 (Debian 11.2.0-20) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/crypto/virtio/virtio_crypto_akcipher_algs.c:165

Re: [PATCH AUTOSEL 5.15 13/16] vdpa: clean up get_config_size ret value handling

2022-04-01 Thread Dan Carpenter
to apply commit 3ed21c1451a1 ("vdpa: check that offsets are within bounds"). https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3ed21c1451a14d139e1ceb18f2fa70865ce3195a I don't know if this affects anyone, but it seemed worth mentioning. regards, dan carpenter O

Re: [bug report] vDPA/ifcvf: implement shared IRQ feature

2022-03-15 Thread Dan Carpenter
/ifcvf/ifcvf_main.c:291:6: warning: ‘config_vector’ may be used uninitialized in this function [-Wmaybe-uninitialized] int config_vector, ret; ^ regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux

Re: [bug report] vDPA/ifcvf: implement shared IRQ feature

2022-03-15 Thread Dan Carpenter
On Tue, Mar 15, 2022 at 10:27:35AM +0800, Zhu, Lingshan wrote: > > > On 3/14/2022 6:37 PM, Dan Carpenter wrote: > > On Mon, Mar 14, 2022 at 10:22:03AM +0800, Zhu, Lingshan wrote: > > > Hello Dan, > > > > > > Thanks for your suggestions and this auto-tes

Re: [bug report] vDPA/ifcvf: implement shared IRQ feature

2022-03-14 Thread Dan Carpenter
we can catch them earlier instead of relying on the kbuild-bot. regards, dan carpenter > > Thanks for your efforts! > Zhu Lingshan > > On 3/11/2022 5:00 PM, Dan Carpenter wrote: > > Hello Zhu Lingshan, > > > > The patch 79333575b8bd: "vDPA/ifcvf: implement s

[bug report] vDPA/ifcvf: implement shared IRQ feature

2022-03-11 Thread Dan Carpenter
cvf_free_irq(adapter); 324 325 return -EFAULT; 326 } regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[bug report] virtio_net: support rx/tx queue reset

2022-03-10 Thread Dan Carpenter
847err = virtio_reset_vq(sq->vq); 1848if (err) { 1849netif_start_subqueue(vi->dev, qindex); 1850goto err; 1851 } regards, dan carpenter ___ Virtualization

Re: [syzbot] INFO: task hung in vhost_work_dev_flush

2022-02-22 Thread Dan Carpenter
gt; https://lore.kernel.org/lkml/20220221072852.31820-1-m...@anirudhrb.com/ I wasted so much time trying to figure out what this patch fixes. :P (It doesn't fix anything). regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundati

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-21 Thread Dan Carpenter
://download.01.org/0day-ci/archive/20220222/202202220707.am3rkucp-...@intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/vhost/vsock.c:655

[bug report] new kvmalloc() WARN() triggered by DRM ioctls tracking

2021-12-16 Thread Dan Carpenter
deally if this could be fixed in a central way, but if not then hopefully I've added the relevant lists to the CC. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH] vduse: check that offset is within bounds in get_config()

2021-12-08 Thread Dan Carpenter
6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Signed-off-by: Dan Carpenter --- drivers/vdpa/vdpa_user/vduse_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index c9204c62f339..

[PATCH 2/2 v4] vdpa: check that offsets are within bounds

2021-12-08 Thread Dan Carpenter
h positive u32 value and basically any "c->len" is accepted. Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Reported-by: Xie Yongji Signed-off-by: Dan Carpenter --- v4: split into a separate patch drivers/vhost/vdpa.c | 2 +- 1 file changed, 1 insertion

[PATCH 1/2 v4] vduse: fix memory corruption in vduse_dev_ioctl()

2021-12-08 Thread Dan Carpenter
; subtraction results in a very high u32 value. The out of bounds offset can result in memory corruption. Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Signed-off-by: Dan Carpenter --- v2: fix reversed if statement v3: fix vhost_vdpa_c

[PATCH v3] vduse: vduse: check that offsets are within bounds

2021-12-07 Thread Dan Carpenter
roduce VDUSE - vDPA Device in Userspace") Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Signed-off-by: Dan Carpenter --- v2: the first version had a reversed if statement v3: fix vhost_vdpa_config_validate() as pointed out by Yongji Xie. drivers/vdpa/vdpa_user/vduse_

Re: [PATCH v2] vduse: vduse: fix memory corruption in vduse_dev_ioctl()

2021-12-07 Thread Dan Carpenter
On Tue, Dec 07, 2021 at 02:21:46PM +0300, Dan Carpenter wrote: > The "config.offset" comes from the user. There needs to a check to > prevent it being out of bounds. The "config.offset" and > "dev->config_size" variables are both type u32. So if t

Re: [PATCH] vduse: fix memory corruption in vduse_dev_ioctl()

2021-12-07 Thread Dan Carpenter
On Tue, Dec 07, 2021 at 07:19:35PM +0800, Yongji Xie wrote: > On Tue, Dec 7, 2021 at 6:46 PM Dan Carpenter wrote: > > > > The "config.offset" comes from the user. There needs to a check to > > prevent it being out of bounds. The "config.offset" and >

[PATCH v2] vduse: vduse: fix memory corruption in vduse_dev_ioctl()

2021-12-07 Thread Dan Carpenter
; subtraction results in a very high u32 value. Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Signed-off-by: Dan Carpenter --- v2: version 1 had a reversed if statement drivers/vdpa/vdpa_user/vduse_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletio

Re: [PATCH] vduse: fix memory corruption in vduse_dev_ioctl()

2021-12-07 Thread Dan Carpenter
On Tue, Dec 07, 2021 at 01:46:14PM +0300, Dan Carpenter wrote: > The "config.offset" comes from the user. There needs to a check to > prevent it being out of bounds. The "config.offset" and > "dev->config_size" variables are both type u32. So if t

[PATCH] vduse: fix memory corruption in vduse_dev_ioctl()

2021-12-07 Thread Dan Carpenter
; subtraction results in a very high u32 value. Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Signed-off-by: Dan Carpenter --- drivers/vdpa/vdpa_user/vduse_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_user

Re: [PATCH] drm: Return error codes from struct drm_driver.gem_create_object

2021-12-07 Thread Dan Carpenter
the drivers. But somehow the vc4 chunk from your patch was dropped. It was *NOT* dropped by Stephen Rothwell. It got dropped earlier. I am including the `git format-patch -1 ` output from the commit. regards, dan carpenter >From 4ff22f487f8c26b99cbe1678344595734c001a39 Mon Sep 17 00:00:00 2

Re: [PATCH] drm: Return error codes from struct drm_driver.gem_create_object

2021-12-06 Thread Dan Carpenter
On Mon, Dec 06, 2021 at 12:16:24PM +0100, Thomas Zimmermann wrote: > Hi > > Am 06.12.21 um 11:42 schrieb Dan Carpenter: > > On Tue, Nov 30, 2021 at 10:52:55AM +0100, Thomas Zimmermann wrote: > > > GEM helper libraries use struct drm_driver.gem_create_object to let &g

Re: [PATCH] drm: Return error codes from struct drm_driver.gem_create_object

2021-12-06 Thread Dan Carpenter
d but it will break at runtime. For now, it's only vc4_create_object() which is broken. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] vdpa: Consider device id larger than 31

2021-11-28 Thread Dan Carpenter
; > assignment. > > > > > > Fixes: 33b347503f01 ("vdpa: Define vdpa mgmt device, ops and a netlink > > > interface") > > > Reported-by: kernel test robot > > > Reported-by: Dan Carpenter > > > Signed-off-by: Parav Pandit > > >

[PATCH v2] drm/virtio: Fix an NULL vs IS_ERR() bug in virtio_gpu_object_shmem_init()

2021-11-18 Thread Dan Carpenter
The drm_gem_shmem_get_sg_table() function never returns NULL. It returns error pointers on error. Fixes: c66df701e783 ("drm/virtio: switch from ttm to gem shmem helpers") Signed-off-by: Dan Carpenter --- v2: I originally sent this patch on 19 Jun 2020 but it was somehow not appl

Re: [bug report] vdpa_sim_blk: implement ramdisk behaviour

2021-09-29 Thread Dan Carpenter
On Wed, Sep 29, 2021 at 02:07:12PM +0200, Stefano Garzarella wrote: > On Wed, Sep 29, 2021 at 02:46:52PM +0300, Dan Carpenter wrote: > > On Wed, Sep 29, 2021 at 02:37:42PM +0300, Dan Carpenter wrote: > > > 89 /* The last byte is the status and we checked if the l

Re: [bug report] vdpa_sim_blk: implement ramdisk behaviour

2021-09-29 Thread Dan Carpenter
On Wed, Sep 29, 2021 at 02:37:42PM +0300, Dan Carpenter wrote: > 89 /* The last byte is the status and we checked if the last iov > has > 90 * enough room for it. > 91 */ > 92 to_push = vringh_kiov_length(>in_iov) - 1; >

[bug report] vdpa_sim_blk: implement ramdisk behaviour

2021-09-29 Thread Dan Carpenter
185 return false; 186 187 pushed += bytes; 188 189 /* Make sure data is wrote before advancing index */ 190 smp_wmb(); 191 192 vringh_complete_iotlb(>vring, vq->head, pushed); 193 194 return true; 195 } regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map()

2021-09-07 Thread Dan Carpenter
The concern here is that "ret" can be uninitialized if we hit the "goto next" condition on every iteration through the loop. Fixes: 41ba1b5f9d4b ("vdpa: Support transferring virtual addressing during DMA mapping") Signed-off-by: Dan Carpenter --- drivers/vhost/vd

[PATCH] vduse: missing error code in vduse_init()

2021-09-07 Thread Dan Carpenter
This should return -ENOMEM if alloc_workqueue() fails. Currently it returns success. Fixes: b66219796563 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Signed-off-by: Dan Carpenter --- drivers/vdpa/vdpa_user/vduse_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletio

[bug report] virtio-mem: use page_offline_(start|end) when setting PageOffline()

2021-08-25 Thread Dan Carpenter
d) { 1078SetPageDirty(page); 1079/* FIXME: remove after cleanups */ 1080ClearPageReserved(page); 1081} 1082} 1083page_offline_end(); 1084 } regards,

Re: [bug report] vhost_net: basic polling support

2021-08-11 Thread Dan Carpenter
On Wed, Aug 11, 2021 at 08:51:22PM +0800, Jason Wang wrote: > Hi Dan: > > On Wed, Aug 11, 2021 at 8:14 PM Dan Carpenter > wrote: > > > > Hello Jason Wang, > > > > The patch 030881372460: "vhost_net: basic polling support" from Mar > > 4, 20

[bug report] vhost_net: basic polling support

2021-08-11 Thread Dan Carpenter
549 550 preempt_enable(); 551 552 if (poll_rx || sock_has_rx_data(sock)) 553 vhost_net_busy_poll_try_queue(net, vq); regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundati

Re: [PATCH v9 13/17] vdpa: factor out vhost_vdpa_pa_map() and vhost_vdpa_pa_unmap()

2021-07-14 Thread Dan Carpenter
On Wed, Jul 14, 2021 at 05:41:54PM +0800, Jason Wang wrote: > > 在 2021/7/14 下午4:05, Dan Carpenter 写道: > > On Wed, Jul 14, 2021 at 10:14:32AM +0800, Jason Wang wrote: > > > 在 2021/7/13 下午7:31, Dan Carpenter 写道: > > > > On Tue, Jul 13, 2021 at 0

Re: [PATCH v9 13/17] vdpa: factor out vhost_vdpa_pa_map() and vhost_vdpa_pa_unmap()

2021-07-14 Thread Dan Carpenter
On Wed, Jul 14, 2021 at 10:14:32AM +0800, Jason Wang wrote: > > 在 2021/7/13 下午7:31, Dan Carpenter 写道: > > On Tue, Jul 13, 2021 at 04:46:52PM +0800, Xie Yongji wrote: > > > @@ -613,37 +618,28 @@ static void vhost_vdpa_unmap(struct vhost_vdpa *v, >

Re: [PATCH v9 16/17] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-07-13 Thread Dan Carpenter
mplicated but I'm not sure what. It calls container_of() and that looks buggy until you spot the BUILD_BUG_ON_ZERO() compile time assert which ensures that the container_of() is a no-op. Only one of the callers checks for error pointers correctly so maybe it's too complicated or maybe there sho

Re: [PATCH v9 13/17] vdpa: factor out vhost_vdpa_pa_map() and vhost_vdpa_pa_unmap()

2021-07-13 Thread Dan Carpenter
g->iova + msg->size - 1 > v->range.last) But writing integer overflow check correctly is notoriously difficult. Do you think you could send a fix for that which is separate from the patcheset? We'd want to backport it to stable. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v9 07/17] virtio: Don't set FAILED status bit on device index allocation failure

2021-07-13 Thread Dan Carpenter
bugfix? Will it have any effect on runtime at all? To me, hearing your thoughts on this is valuable even if you have to guess. "I noticed this mistake during review and I don't think it will affect runtime." regards, dan carpenter ___ Virtualizat

[PATCH] vdpa: fix error code in vp_vdpa_probe()

2021-06-05 Thread Dan Carpenter
Return -ENOMEM if vp_modern_map_vq_notify() fails. Currently it returns success. Fixes: 11d8ffed00b2 ("vp_vdpa: switch to use vp_modern_map_vq_notify()") Signed-off-by: Dan Carpenter --- drivers/vdpa/virtio_pci/vp_vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dr

Re: [PATCH v7 04/12] virtio-blk: Add validation for block size in config space

2021-05-19 Thread Dan Carpenter
ct virtio_blk_config, blk_size, > >_size); > > - if (!err) > > + if (!err && blk_size > 0 && blk_size <= max_size) > > The check here is incorrect. I will use PAGE_SIZE as the maximum > boundary in the new ve

Re: [PATCH v6 01/10] file: Export receive_fd() to modules

2021-03-31 Thread Dan Carpenter
binder_debug(BINDER_DEBUG_TRANSACTION, > "failed fd fixup txn %d fd %d\n", regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[bug report] vdpa: set the virtqueue num during register

2021-02-25 Thread Dan Carpenter
turn -ENOMEM; 438 } 439 440 pci_set_master(pdev); 441 pci_set_drvdata(pdev, adapter); 442 regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfo

[bug report] vdpa: introduce virtio pci driver

2021-02-24 Thread Dan Carpenter
indented too far 169 } 170 vp_modern_config_vector(mdev, queues); 171 vp_vdpa->config_irq = irq; 172 173 return 0; 174 err: 175 vp_vdpa_free_irq(vp_vdpa); 176

[PATCH] vhost_vdpa: return -EFAULT if copy_to_user() fails

2020-12-01 Thread Dan Carpenter
The copy_to_user() function returns the number of bytes remaining to be copied but this should return -EFAULT to the user. Fixes: 1b48dc03e575 ("vhost: vdpa: report iova range") Signed-off-by: Dan Carpenter --- drivers/vhost/vdpa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletio

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Dan Carpenter
ing. > > FWIW, this series has found at least one bug so far: > https://lore.kernel.org/lkml/CAFCwf11izHF=g1mGry1fE5kvFFFrxzhPSM6qKAO8gxSp=kr...@mail.gmail.com/ This is a fallthrough to a return and not to a break. That should trigger a warning. The fallthrough to a break should not generate a warning. The bug we're trying to fix is "missing break statement" but if the result of the bug is "we hit a break statement" then now we're just talking about style. GCC should limit itself to warning about potentially buggy code. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Dan Carpenter
t; case 0: > ++x; > default: > ; > } Don't warn for this. If adding a break statement changes the flow of the code then warn about potentially missing break statements, but if it doesn't change anything then don't warn about it. regards, dan carpenter

Re: [PATCH 04/17] vhost: prep vhost_dev_init users to handle failures

2020-11-03 Thread Dan Carpenter
(Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/vhost/vsock.c:648 vhost_vsock_dev_open() error: uninitialized symbol 'ret'. vim +/ret +648 drivers/vhost/vsock.c 433fc58e6bf2c8b

[PATCH] drm/virtio: Fix a double free in virtio_gpu_cmd_map()

2020-10-30 Thread Dan Carpenter
This is freed both here and in the caller (virtio_gpu_vram_map()) so it's a double free. The correct place is only in the caller. Fixes: 16845c5d5409 ("drm/virtio: implement blob resources: implement vram object") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/virtio/virtgp

[PATCH net] vhost_vdpa: Return -EFUALT if copy_from_user() fails

2020-10-23 Thread Dan Carpenter
The copy_to/from_user() functions return the number of bytes which we weren't able to copy but the ioctl should return -EFAULT if they fail. Fixes: a127c5bbb6a8 ("vhost-vdpa: fix backend feature ioctls") Signed-off-by: Dan Carpenter --- drivers/vhost/vdpa.c | 10 +- 1 file

Re: [PATCH 04/16] vhost: prep vhost_dev_init users to handle failures

2020-10-09 Thread Dan Carpenter
9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/vhost/vdpa.c:844 vhost_vdpa_open() error: uninitialized symbol 'r'. Old smatch warnings: drivers/vhost/vdpa.c:436

Re: [PATCH 3/8] vhost scsi: alloc cmds per vq instead of session

2020-09-23 Thread Dan Carpenter
) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/vhost/scsi.c:606 vhost_scsi_get_cmd() error: uninitialized symbol 'cpu'. # https://github.com/0day-ci/linux/commit

Re: [PATCH v2] i2c: virtio: add a virtio i2c frontend driver

2020-09-14 Thread Dan Carpenter
On Mon, Sep 14, 2020 at 06:24:55PM +0300, Andy Shevchenko wrote: > On Mon, Sep 14, 2020 at 05:48:07PM +0300, Dan Carpenter wrote: > > Hi Jie, > > > > url: > > https://github.com/0day-ci/linux/commits/Jie-Deng/i2c-virtio-add-a-virtio-i2c-frontend-driver/20200911-115

Re: [PATCH v2] i2c: virtio: add a virtio i2c frontend driver

2020-09-14 Thread Dan Carpenter
(GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/i2c/busses/i2c-virtio.c:160 virtio_i2c_xfer() error: we previously assumed 'vmsg' could be null (see line 137) # https://github.com

Re: [PATCH] vhost: new vhost_vdpa SET/GET_BACKEND_FEATURES handlers

2020-09-09 Thread Dan Carpenter
: hppa-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/vhost/vdpa.c:356 vhost_vdpa_get_backend_features() warn: maybe return -EFAULT instead of the bytes remaining? # https

Re: [PATCH] vdpa/mlx5: Fix pointer math in mlx5_vdpa_get_config()

2020-08-10 Thread Dan Carpenter
On Sun, Aug 09, 2020 at 06:34:04AM +, Eli Cohen wrote: > Acked-by: Eli Cohen > > BTW, vdpa_sim has the same bug. > I sent a patch for that on April 6. [PATCH 2/2] vdpa: Fix pointer math bug in vdpasim_get_config() Jason acked the patch but it wasn't applied. regards, d

[PATCH] vdpa/mlx5: Fix pointer math in mlx5_vdpa_get_config()

2020-08-08 Thread Dan Carpenter
There is a pointer math bug here so if "offset" is non-zero then this will copy memory from beyond the end of the array. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Dan Carpenter --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +

[PATCH] vdpa/mlx5: Missing error code on allocation failure

2020-08-08 Thread Dan Carpenter
This should return -ENOMEM if the allocation fails. Currently it either returns success or an uninitialized value. Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") Signed-off-by: Dan Carpenter --- drivers/vdpa/mlx5/core/mr.c | 4 +++- 1 file changed, 3 insert

[PATCH] drm/virtio: Fix an IS_ERR() vs NULL check in virtio_gpu_object_shmem_init()

2020-06-19 Thread Dan Carpenter
The drm_gem_shmem_get_pages_sgt() function returns error pointers on error, it never returns NULL. Fixes: d323bb44e4d2 ("drm/virtio: Call the right shmem helpers") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/virtio/virtgpu_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH v4 2/3] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-16 Thread Dan Carpenter
a "#define kzfree kfree_sensitive" so that things continue to compile and we can remove it in the next kernel release? regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoun

Re: [PATCH v4 1/3] mm/slab: Use memzero_explicit() in kzfree()

2020-06-16 Thread Dan Carpenter
is a stable material. Is there any > known instance where the memset was optimized out from kzfree? I told him to add the stable. Otherwise it will just get reported to me again. It's a just safer to backport it before we forget. regards, dan carpenter _

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-15 Thread Dan Carpenter
le kernels. > kfree(mem); > } > -EXPORT_SYMBOL(kzfree); > +EXPORT_SYMBOL(kfree_sensitive); > > /** > * ksize - get the actual amount of memory allocated for a given object regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH] vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()

2020-06-10 Thread Dan Carpenter
The "vma->vm_pgoff" variable is an unsigned long so if it's larger than INT_MAX then "index" can be negative leading to an underflow. Fix this by changing the type of "index" to "unsigned long". Fixes: ddd89d0a059d ("vhost_vdpa: support doorbell

[PATCH] virtio-mem: silence a static checker warning

2020-06-10 Thread Dan Carpenter
Smatch complains that "rc" can be uninitialized if we hit the "break;" statement on the first iteration through the loop. I suspect that this can't happen in real life, but returning a zero literal is cleaner and silence the static checker warning. Signed-off-by: Dan Car

Re: [PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick

2020-06-02 Thread Dan Carpenter
(Debian 9.3.0-13) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot Reported-by: Dan Carpenter smatch warnings: drivers/vhost/vdpa.c:348 vhost_vdpa_set_vring_kick() error: uninitialized symbol 'r'. # https://github.com/0day-ci/linux/commit

[PATCH 2/2] vdpa: Fix pointer math bug in vdpasim_get_config()

2020-04-06 Thread Dan Carpenter
If "offset" is non-zero then we end up copying from beyond the end of the config because of pointer math. We can fix this by casting the struct to a u8 pointer. Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator") Signed-off-by: Dan Carpenter --- Is it really worth le

[PATCH 1/2] vdpa: Signedness bugs in vdpasim_work()

2020-04-06 Thread Dan Carpenter
The "read" and "write" variables need to be signed for the error handling to work. Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator") Signed-off-by: Dan Carpenter --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

Re: [PATCH 5/5] vdpasim: vDPA device simulator

2020-01-27 Thread Dan Carpenter
Hi Jason, url: https://github.com/0day-ci/linux/commits/Jason-Wang/vDPA-support/20200117-170243 base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next If you fix the issue, kindly add following tag Reported-by: kbuild test robot Reported-by: Dan Carpenter smatch

[bug report] x86/paravirt: Use a single ops structure

2019-09-10 Thread Dan Carpenter
ret = 0; 131 regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH RFC 1/4] include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR

2019-01-10 Thread Dan Carpenter
after all. > It doesn't hurt to put things in linux-next for a week and then 5.0 and -stable. Not a lot of testing happens on linux-next, but some does. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH net-next] vhost_net: add a missing error return

2018-09-20 Thread Dan Carpenter
We accidentally left out this error return so it leads to some use after free bugs later on. Fixes: 0a0be13b8fe2 ("vhost_net: batch submitting XDP buffers to underlayer sockets") Signed-off-by: Dan Carpenter diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index dd

[PATCH] x86/paravirt: fix some warning messages

2018-09-19 Thread Dan Carpenter
The first argument to WARN_ONCE() is a condition. Fixes: 5800dc5c19f3 ("x86/paravirt: Fix spectre-v2 mitigations for paravirt guests") Signed-off-by: Dan Carpenter diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index bbf006fe78d7..e4d4df37922a 100644 --- a/arch/

[PATCH] drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset()

2018-07-04 Thread Dan Carpenter
ement beyond the end of the vgdev->capsets[] array. Fixes: 62fb7a5e1096 ("virtio-gpu: add 3d/virgl support") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 020070d483d3..4735bd1c7321 100644 --- a/drivers/gpu/drm/vi

Re: [PATCH net-next v8 2/4] net: Introduce generic failover module

2018-04-28 Thread Dan Carpenter
Hi Sridhar, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Sridhar-Samudrala/Enable-virtio_net-to-act-as-a-standby-for-a-passthru-device/20180427-183842 smatch warnings:

Re: [PATCH] drm: qxl: ratelimit pr_info message, reduce log spamming

2017-09-12 Thread Dan Carpenter
On Tue, Sep 12, 2017 at 03:02:04PM +0100, Emil Velikov wrote: > That said, I'm not sure how useful the information is - perhaps it's > better to drop it all together? Or a WARN_ONCE(). regards, dan carpenter ___ Virtualization mailin

Re: [PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions

2017-05-22 Thread Dan Carpenter
ion. See slab_out_of_memory(). regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH] ringtest: fix an assert statement

2017-04-15 Thread Dan Carpenter
There is an || vs && typo so the assert can never be triggered. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/tools/virtio/ringtest/main.c b/tools/virtio/ringtest/main.c index 022ae95a06bd..453ca3c21193 100644 --- a/tools/virtio/ringtest/main.c +++ b/tools/v

[PATCH] virtio_net: tidy a couple debug statements

2017-04-06 Thread Dan Carpenter
We are printing a decimal value for truesize so we shouldn't use an "0x" prefix. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 0e6e3acf6ff1..2b5e8069d9e5 100644 --- a/drivers/net/virtio_net.c +

[bug report] virtio_net: rework mergeable buffer handling

2017-04-05 Thread Dan Carpenter
(buf = virtqueue_get_buf(rq->vq, )) != NULL) { 1048 bytes += receive_buf(vi, rq, buf, len, NULL); 1049 received++; 1050 } 1051 } 1052 regards, dan carpenter __

  1   2   >