[patch] xen/privcmd: fix condition in privcmd_close()

2012-11-04 Thread Dan Carpenter
The parenthesis are in the wrong place so the original code is equivalent to: if (!xen_feature(XENFEAT_writable_descriptor_tables)) { ... Which obviously was not intended. Signed-off-by: Dan Carpenter diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index b9d0898..6011f3b

[patch] virtio_balloon: unlock on error in fill_balloon()

2012-11-12 Thread Dan Carpenter
We recently added locking in fill_balloon() but there was one error path which was missed. Signed-off-by: Dan Carpenter --- Only needed in linux-next. diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index f70151b..1c50e98 100644 --- a/drivers/virtio

re: xen/blkback: Persistent grant maps for xen blk drivers

2012-12-03 Thread Dan Carpenter
f you have poisoning enabled it will have an easy to debug crash. 811 } regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

re: xen-blkback: move free persistent grants code

2012-12-03 Thread Dan Carpenter
ret = gnttab_unmap_refs(unmap, NULL, pages, 240 segs_to_unmap); regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: xen-blkback: move free persistent grants code

2012-12-03 Thread Dan Carpenter
On Tue, Dec 04, 2012 at 12:11:48AM +0300, Dan Carpenter wrote: > Hello Roger Pau Monne, > > The patch 4d4f270f1880: "xen-blkback: move free persistent grants > code" from Nov 16, 2012, leads to the following warning: > drivers/block/xen-blkback/blkback.c:238 free_persis

re: xen/acpi: ACPI memory hotplug

2013-02-15 Thread Dan Carpenter
pr_warn(PREFIX "Cannot add acpi bus\n"); 194 return -EINVAL; 195 } 196 197 end: 198 *mem_device = acpi_driver_data(device); ^^ Dereference. 199 if (!(*mem_d

[patch -resend] xen/privcmd: fix condition in privcmd_close()

2013-05-14 Thread Dan Carpenter
The parenthesis are in the wrong place so the original code is equivalent to: if (!xen_feature(0x1)) { ... Or: if (!xen_feature(XENFEAT_writable_descriptor_tables)) { ... Which obviously was not intended. Signed-off-by: Dan Carpenter --- I sent this last November but it was

[patch] virtio: console: fix error handling for debugfs_create_dir()

2013-07-18 Thread Dan Carpenter
debugfs_create_dir() returns ERR_PTR(-ENODEV) if debugfs is disabled. Also my static checker doesn't like it when we print the error code, but it's always just NULL. Signed-off-by: Dan Carpenter diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 1b456f

Re: [patch] virtio: console: fix error handling for debugfs_create_dir()

2013-07-20 Thread Dan Carpenter
On Fri, Jul 19, 2013 at 12:28:41PM +0200, Arnd Bergmann wrote: > On Friday 19 July 2013, Dan Carpenter wrote: > > debugfs_create_dir() returns ERR_PTR(-ENODEV) if debugfs is disabled. > > Also my static checker doesn't like it when we print the error code, but >

Re: [patch] virtio: console: fix error handling for debugfs_create_dir()

2013-07-21 Thread Dan Carpenter
eems intentional > and correct to me. Ah. Ok. You're right. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[patch v2] virtio: console: cleanup an error message

2013-07-22 Thread Dan Carpenter
The PTR_ERR(NULL) here is not useful. Signed-off-by: Dan Carpenter --- v2: completely different diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 1b456fe..4cf46d8 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -2215,10 +2215,8

Re: [patch v2] virtio: console: cleanup an error message

2013-07-29 Thread Dan Carpenter
On Mon, Jul 29, 2013 at 06:12:31AM -0700, Greg Kroah-Hartman wrote: > On Mon, Jul 29, 2013 at 12:41:31PM +0530, Amit Shah wrote: > > On (Mon) 22 Jul 2013 [23:41:00], Dan Carpenter wrote: > > > The PTR_ERR(NULL) here is not useful. > > > > > > Signed-off-b

[bug report] vdpa_sim_blk: implement ramdisk behaviour

2021-09-29 Thread Dan Carpenter
ext whether this code is safe. 180 vringh_kiov_advance(&vq->in_iov, to_push - pushed); 181 182 /* Last byte is the status */ 183 bytes = vringh_iov_push_iotlb(&vq->vring, &vq->in_iov, &status, 1); 184 if (

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(&vq->in_iov) - 1;

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

[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: [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 > > >

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

2021-12-06 Thread Dan Carpenter
e and build 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] 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-07 Thread Dan Carpenter
pdated all 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

[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] 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 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 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 >

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

[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_

[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_confi

[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] vduse: check that offset is within bounds in get_config()

2021-12-08 Thread Dan Carpenter
9 ("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..

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

2021-12-16 Thread Dan Carpenter
ideally 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

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

Re: [syzbot] INFO: task hung in vhost_work_dev_flush

2022-02-22 Thread Dan Carpenter
re: > 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.linu

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

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

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

2022-03-11 Thread Dan Carpenter
urn 0; 322 err: 323 ifcvf_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

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

2022-03-14 Thread Dan Carpenter
d it's better if 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: &quo

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-15 Thread Dan Carpenter
/vdpa/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.

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

2022-04-01 Thread Dan Carpenter
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 carpent

[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

[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/v

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 433fc

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

2020-12-01 Thread Dan Carpenter
h (x) { > 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, d

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

2020-12-01 Thread Dan Carpenter
of a warning. > > 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

[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

[PATCH] drm/virtio: fix an error code in virtio_gpu_init()

2021-02-03 Thread Dan Carpenter
If devm_request_mem_region() fails this code currently returns success but it should return -EBUSY. Fixes: 6076a9711dc5 ("drm/virtio: implement blob resources: probe for host visible region") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + 1 file

[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); 17

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

2021-02-25 Thread Dan Carpenter
e"); 437 return -ENOMEM; 438 } 439 440 pci_set_master(pdev); 441 pci_set_drvdata(pdev, adapter); 442 regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundati

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

2021-03-31 Thread Dan Carpenter
t; 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

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

2021-05-19 Thread Dan Carpenter
in the new version. What does this bug look like to the user? A minimum block size of 1 seems pretty crazy. Surely the minimum should be higher? regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[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 v9 07/17] virtio: Don't set FAILED status bit on device index allocation failure

2021-07-13 Thread Dan Carpenter
a 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

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

2021-07-13 Thread Dan Carpenter
e || msg->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 16/17] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-07-13 Thread Dan Carpenter
ng very complicated 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 m

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 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

[bug report] vhost_net: basic polling support

2021-08-11 Thread Dan Carpenter
cpu_relax(); 548 } 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 _

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] 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,

[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

[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

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

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

2022-11-28 Thread Dan Carpenter
_config *config) > > 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

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

2023-01-06 Thread Dan Carpenter
es(node->ucast_rule); 1521 err_ucast: 1522 remove_steering_counters(ndev, node); 1523 out_free: 1524 kvfree(spec); 1525 return err; 1526 } regards, dan carpenter ___ Virtualization mailing list Virtua

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

[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

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

2022-05-23 Thread Dan Carpenter
troduce 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

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

2022-05-26 Thread Dan Carpenter
> > so the RHS here should have unsigned 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

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

2022-05-26 Thread Dan Carpenter
() 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: [PATCH v3 2/4] vhost-vdpa: introduce STOP backend feature bit

2022-05-26 Thread Dan Carpenter
esponded feels 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 wa

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
to write that code... :/ > > I find 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 c

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 that

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-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; > > > &

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

2022-06-06 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

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

2022-06-06 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

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

2022-07-08 Thread Dan Carpenter
OR: 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,

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

2022-08-11 Thread Dan Carpenter
t they can'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

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

2022-08-11 Thread Dan Carpenter
as to be true and this is a false positive but I don't know the code well enough to be sure. 2673 2674 out: 2675 up_write(&ndev->reslock); --> 2676 return err; 2677 } regards, dan carpenter ___ Virtua

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: >

Re: [PATCH] vduse: prevent uninitialized memory accesses

2022-08-26 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

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

2022-09-15 Thread Dan Carpenter
irtio: implement 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 3b17

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 v2] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-18 Thread Dan Carpenter
irtio: implement 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

[patch] vhost/scsi: potential memory corruption

2015-02-04 Thread Dan Carpenter
et into the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so anything higher than 255 then it is invalid. I have made that the limit now. In vhost_scsi_send_evt() we mask away values higher than 255, but now that the limit has changed, we don't need the mask. Signed-off-by: Dan

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

2019-01-10 Thread Dan Carpenter
a bugfix > 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

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: net/core/net_failover.c

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

2018-07-04 Thread Dan Carpenter
ne element 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/d

[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 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] virtio_console: use snprintf() for safety

2015-05-07 Thread Dan Carpenter
alues are. Anyway, it's simple enough to make the buffer larger and I changed it to snprintf() as well. Signed-off-by: Dan Carpenter diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 50754d20..8283989 100644 --- a/drivers/char/virtio_console.c +++ b/driver

[patch v2] virtio_console: silence a static checker warning

2015-05-08 Thread Dan Carpenter
My static checker complains that this sprintf() can overflow but really it can't. Just silence the warning by using snprintf(). Signed-off-by: Dan Carpenter --- v2: the overflow is not possible so just leave the buffer size alone and silence the warning with snprintf(). diff --

Re: [patch v2] virtio_console: silence a static checker warning

2015-05-08 Thread Dan Carpenter
On Fri, May 08, 2015 at 11:30:09AM +0200, walter harms wrote: > > > Am 08.05.2015 11:16, schrieb Dan Carpenter: > > My static checker complains that this sprintf() can overflow but really > > it can't. Just silence the warning by using snprintf(). > >

Re: [patch v2] virtio_console: silence a static checker warning

2015-05-08 Thread Dan Carpenter
space. How are you calculating the %3? The max for "id" is currently 31. To be honest, I'm not certain the max for ->index. It's something in qemu but I'm not sure what. Who is going to keep it updated? The %3 is sort of meaningless. The lower levels of th

[patch] drm/virtio: checking for NULL instead of IS_ERR

2015-06-10 Thread Dan Carpenter
virtio_gpu_alloc_object() returns an error pointer, it never returns NULL. Fixes: dc5698e80cf7 ('Add virtio gpu driver.') Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c b/drivers/gpu/drm/virtio/virtgpu_fb.c index 25bf333..df198d9 100644 --- a/drive

[patch] drm/virtio: remove some dead code

2015-06-10 Thread Dan Carpenter
The goto is correct, and we never reach the return statement so just delete the dead code. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c index e0e74c6..b092d7b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c +++ b

[patch] vhost: NULL vs ERR_PTR bug

2015-07-15 Thread Dan Carpenter
There is only one caller for vhost_kvzalloc() and it expects NULL on allocation failure. Most people would probably expect that so let's change ERR_PTR(-ENOMEM) to NULL. Fixes: 4de7255f7d2b ('vhost: extend memory regions allocation to vmalloc') Signed-off-by: Dan Carpenter diff

Re: [patch] vhost: NULL vs ERR_PTR bug

2015-07-15 Thread Dan Carpenter
On Wed, Jul 15, 2015 at 01:35:16PM +0200, walter harms wrote: > Is this function needed at all ? > It tries to kmalloc() memory and if it can't then it tries to vmalloc() it. There are a bunch of these functions. Eventually someone should put one in a common header. regards, da

Re: [patch] vhost: NULL vs ERR_PTR bug

2015-07-15 Thread Dan Carpenter
on and we will delete this one. regards, dan carpenter ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[patch] virtio: silence uninitialized variable warnings

2016-04-01 Thread Dan Carpenter
Most ->get() functions seem to call BUG_ON() if offset + len is out of range, but rproc_virtio_get() returns early without initializing ret. Presumably it can't actually happen but it leads to a static checker warning. Let's just initialize "ret". Signed-off-by: Dan C

  1   2   >