Re: [PATCH v3 1/4] PCI: Clean up pci_scan_slot()

2022-04-21 Thread Bjorn Helgaas
On Thu, Apr 21, 2022 at 11:27:42AM +0200, Niklas Schnelle wrote: > On Wed, 2022-04-20 at 21:14 -0500, Bjorn Helgaas wrote: > > On Tue, Apr 19, 2022 at 12:28:00PM +0200, Niklas Schnelle wrote: > > > While determining the next PCI function is factored out of > > > pci_scan_slot() into next_fn() the

Re: [PATCH 3/5] hv_sock: Add validation for untrusted Hyper-V values

2022-04-21 Thread Stefano Garzarella
On Thu, Apr 21, 2022 at 5:30 PM Andrea Parri wrote: > > > > @@ -577,12 +577,19 @@ static bool hvs_dgram_allow(u32 cid, u32 port) > > > static int hvs_update_recv_data(struct hvsock *hvs) > > > { > > > struct hvs_recv_buf *recv_buf; > > > - u32 payload_len; > > > + u32 pkt_len,

Re: [PATCH net-next] net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO

2022-04-21 Thread Willem de Bruijn
On Wed, Apr 20, 2022 at 10:32 PM Hangbin Liu wrote: > > On Wed, Apr 20, 2022 at 09:45:15AM -0400, Willem de Bruijn wrote: > > On Wed, Apr 20, 2022 at 4:28 AM Hangbin Liu wrote: > > > > > > Currently, the kernel drops GSO VLAN tagged packet if it's created with > > > socket(AF_PACKET, SOCK_RAW,

Re: [PATCH 3/5] hv_sock: Add validation for untrusted Hyper-V values

2022-04-21 Thread Stefano Garzarella
On Wed, Apr 20, 2022 at 10:07:18PM +0200, Andrea Parri (Microsoft) wrote: For additional robustness in the face of Hyper-V errors or malicious behavior, validate all values that originate from packets that Hyper-V has sent to the guest in the host-to-guest ring buffer. Ensure that invalid

Re: [PATCH 2/5] hv_sock: Copy packets sent by Hyper-V out of the ring buffer

2022-04-21 Thread Stefano Garzarella
On Wed, Apr 20, 2022 at 10:07:17PM +0200, Andrea Parri (Microsoft) wrote: Pointers to VMbus packets sent by Hyper-V are used by the hv_sock driver within the guest VM. Hyper-V can send packets with erroneous values or modify packet fields after they are processed by the guest. To defend

Re: [PATCH 1/5] hv_sock: Check hv_pkt_iter_first_raw()'s return value

2022-04-21 Thread Stefano Garzarella
On Wed, Apr 20, 2022 at 10:07:16PM +0200, Andrea Parri (Microsoft) wrote: The function returns NULL if the ring buffer doesn't contain enough readable bytes to constitute a packet descriptor. The ring buffer's write_index is in memory which is shared with the Hyper-V host, an erroneous or

RE: [PATCH v3 4/5] virtio-crypto: adjust dst_len at ops callback

2022-04-21 Thread Gonglei (Arei) via Virtualization
> -Original Message- > From: zhenwei pi [mailto:pizhen...@bytedance.com] > Sent: Thursday, April 21, 2022 6:40 PM > To: Gonglei (Arei) ; m...@redhat.com > Cc: jasow...@redhat.com; herb...@gondor.apana.org.au; > linux-ker...@vger.kernel.org; virtualization@lists.linux-foundation.org; >

[PATCH v3 5/5] virtio-crypto: enable retry for virtio-crypto-dev

2022-04-21 Thread zhenwei pi
From: lei he Enable retry for virtio-crypto-dev, so that crypto-engine can process cipher-requests parallelly. Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Gonglei Signed-off-by: lei he Signed-off-by: zhenwei pi --- drivers/crypto/virtio/virtio_crypto_core.c | 3 ++- 1 file changed, 2

[PATCH v3 4/5] virtio-crypto: adjust dst_len at ops callback

2022-04-21 Thread zhenwei pi
From: lei he For some akcipher operations(eg, decryption of pkcs1pad(rsa)), the length of returned result maybe less than akcipher_req->dst_len, we need to recalculate the actual dst_len through the virt-queue protocol. Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Gonglei Signed-off-by: lei he

[PATCH v3 3/5] virtio-crypto: move helpers into virtio_crypto_common.c

2022-04-21 Thread zhenwei pi
Move virtcrypto_clear_request and virtcrypto_dataq_callback into virtio_crypto_common.c to make code clear. Then the xx_core.c supports: - probe/remove/irq affinity seting for a virtio device - basic virtio related operations xx_common.c supports: - common helpers/functions for algos Cc:

[PATCH v3 2/5] virtio-crypto: wait ctrl queue instead of busy polling

2022-04-21 Thread zhenwei pi
Originally, after submitting request into virtio crypto control queue, the guest side polls the result from the virt queue. This works like following: CPU0 CPU1 ... CPUx CPUy | | | | \ \

[PATCH v3 1/5] virtio-crypto: use private buffer for control request

2022-04-21 Thread zhenwei pi
Originally, all of the control requests share a single buffer( ctrl & input & ctrl_status fields in struct virtio_crypto), this allows queue depth 1 only, the performance of control queue gets limited by this design. In this patch, each request allocates request buffer dynamically, and free

[PATCH v3 0/5] virtio-crypto: Improve performance

2022-04-21 Thread zhenwei pi
v2 -> v3: - Jason suggested that spliting the first patch into two part: 1, using private buffer 2, remove the busy polling Rework as Jason's suggestion, this makes the smaller change in each one and clear. v1 -> v2: - Use kfree instead of kfree_sensitive for insensitive buffer.

Re: [PATCH] arm64: paravirt: Disable IRQs during stolen_time_cpu_down_prepare

2022-04-21 Thread Will Deacon
On Thu, Apr 21, 2022 at 09:44:28AM +0200, Juergen Gross wrote: > On 20.04.22 22:44, Elliot Berman wrote: > > From: Prakruthi Deepak Heragu > > > > During hotplug, the stolen time data structure is unmapped and memset. > > There is a possibility of the timer IRQ being triggered before memset > >

Re: PING: [PATCH v4 0/8] Introduce akcipher service for virtio-crypto

2022-04-21 Thread Daniel P . Berrangé
On Thu, Apr 21, 2022 at 09:41:40AM +0800, zhenwei pi wrote: > Hi Daniel, > Could you please review this series? Yes, its on my to do. I've been on holiday for 2 weeks, so still catching up on the backlog of reviews. > On 4/11/22 18:43, zhenwei pi wrote: > > v3 -> v4: > > - Coding style fix:

Re: [PATCH] arm64: paravirt: Disable IRQs during stolen_time_cpu_down_prepare

2022-04-21 Thread Juergen Gross via Virtualization
On 20.04.22 22:44, Elliot Berman wrote: From: Prakruthi Deepak Heragu During hotplug, the stolen time data structure is unmapped and memset. There is a possibility of the timer IRQ being triggered before memset and stolen time is getting updated as part of this timer IRQ handler. This causes

Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-21 Thread Peter Zijlstra
On Wed, Apr 20, 2022 at 11:45:05AM -0700, Kees Cook wrote: > > -Wno-array-bounds > > Please no; we just spent two years fixing all the old non-flexible array > definitions and so many other things fixed for this to be enable because > it finds actual flaws (but we turned it off when it was