[PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-01 Thread Lee Jones
vhost_vsock_handle_tx_kick() already holds the mutex during its call to vhost_get_vq_desc(). All we have to do is take the same lock during virtqueue clean-up and we mitigate the reported issues. Link: https://syzkaller.appspot.com/bug?extid=279432d30d825e63ba00 Cc: Reported-by:

[PATCH v3 4/4] virtio-crypto: rename skcipher algs

2022-03-01 Thread zhenwei pi
Suggested by Gonglei, rename virtio_crypto_algs.c to virtio_crypto_skcipher_algs.c. Also minor changes for function name. Thus the function of source files get clear: skcipher services in virtio_crypto_skcipher_algs.c and akcipher services in virtio_crypto_akcipher_algs.c. Signed-off-by: zhenwei

[PATCH v3 3/4] virtio-crypto: implement RSA algorithm

2022-03-01 Thread zhenwei pi
Support rsa & pkcs1pad(rsa,sha1) with priority 150. Test with QEMU built-in backend, it works fine. 1, The self-test framework of crypto layer works fine in guest kernel 2, Test with Linux guest(with asym support), the following script test(note that pkey_XXX is supported only in a newer version

[PATCH v3 2/4] virtio-crypto: introduce akcipher service

2022-03-01 Thread zhenwei pi
Introduce asymmetric service definition, asymmetric operations and several well known algorithms. Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenwei pi --- include/uapi/linux/virtio_crypto.h | 81 +- 1 file changed, 80 insertions(+), 1 deletion(-)

[PATCH v3 1/4] virtio_crypto: Introduce VIRTIO_CRYPTO_NOSPC

2022-03-01 Thread zhenwei pi
Base on the lastest virtio crypto spec, define VIRTIO_CRYPTO_NOSPC. Reviewed-by: Gonglei Signed-off-by: zhenwei pi --- include/uapi/linux/virtio_crypto.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/virtio_crypto.h b/include/uapi/linux/virtio_crypto.h index

[PATCH v3 0/4] Introduce akcipher service for virtio-crypto

2022-03-01 Thread zhenwei pi
v2 -> v3: Rename virtio_crypto_algs.c to virtio_crypto_skcipher_algs.c, and minor changes of function name. Minor changes in virtio_crypto_akcipher_algs.c: no need to copy from buffer if opcode is verify. v1 -> v2: Fix 1 compiling warning reported by kernel test robot Put "__le32

Re: [PATCH] virtio-blk: Assign discard_granularity

2022-03-01 Thread Martin K. Petersen
Akihiko, > I'd like to leave this patch as is since I cannot deny the possibility > that the host has a different alignment offset for discarding and > other operations. That's correct. SCSI explicitly reports separate values for physical block alignment and "discard" alignment. The queue

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-01 Thread Michael S. Tsirkin
On Mon, Feb 28, 2022 at 02:57:20PM +0800, Xie Yongji wrote: > Currently we have a BUG_ON() to make sure the number of sg > list does not exceed queue_max_segments() in virtio_queue_rq(). > However, the block layer uses queue_max_discard_segments() > instead of queue_max_segments() to limit the sg

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-01 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

RE: PING: [PATCH v2 3/3] virtio-crypto: implement RSA algorithm

2022-03-01 Thread Gonglei (Arei) via Virtualization
> -Original Message- > From: zhenwei pi [mailto:pizhen...@bytedance.com] > Sent: Tuesday, March 1, 2022 6:26 PM > To: Gonglei (Arei) > Cc: jasow...@redhat.com; m...@redhat.com; > virtualization@lists.linux-foundation.org; linux-cry...@vger.kernel.org; > linux-ker...@vger.kernel.org;

PING: [PATCH v2 3/3] virtio-crypto: implement RSA algorithm

2022-03-01 Thread zhenwei pi
PING! Hi, Lei I also take a look at other crypto drivers qat/ccp/hisilicon, they separate akcipher/skcipher algo. If you consider that reusing virtio_crypto_algs_register/unregister seems better, I will try to merge them into a single function. On 2/23/22 6:17 PM, zhenwei pi wrote: On 2/18/22

Re: [PATCH] virtio-blk: Assign discard_granularity

2022-03-01 Thread Stefan Hajnoczi
On Tue, Mar 01, 2022 at 02:43:55PM +0900, Akihiko Odaki wrote: > On 2022/02/28 19:51, Stefan Hajnoczi wrote: > > On Thu, Feb 24, 2022 at 06:38:02PM +0900, Akihiko Odaki wrote: > > > Virtual I/O Device (VIRTIO) Version 1.1 > > >

Re: [PATCH] vdpa: fix use-after-free on vp_vdpa_remove

2022-03-01 Thread Stefano Garzarella
On Tue, Mar 1, 2022 at 2:26 AM Yi Wang wrote: > > From: Zhang Min > > When vp_vdpa driver is unbind, vp_vdpa is freed in vdpa_unregister_device > and then vp_vdpa->mdev.pci_dev is dereferenced in vp_modern_remove, > triggering use-after-free. > > Call Trace of unbinding driver free vp_vdpa : >