Thread (16 messages) 16 messages, 4 authors, 2020-06-30

Re: [PATCH v2 1/3] Drivers: hv: vmbus: Add vmbus_requestor data structure for VMBus hardening

From: Andres Beltran <hidden>
Date: 2020-06-29 22:09:19
Also in: lkml

On Mon, Jun 29, 2020 at 5:56 PM Michael Kelley [off-list ref] wrote:
I'm not understanding the problem here.  Any VMbus driver that uses
this requestID allocation mechanism must set newchannel->rqstor_size
to a non-zero value.  But if a VMbus driver doesn't use the mechanism,
then newchannel->rqstor_size will default to zero, and the mechanism
will not be initialized for the channels used by that driver.  I think the
cleanup of the mechanism handles the case where it wasn't ever
initialized.  Or am I missing something?

Michael
Yes, that is correct. I think the validation is necessary if there
exists an instance
where a driver call vmbus_next_request_id or vmbus_request_addr() with a rqstor
that has not been previously initialized. Currently, the rqstor
pointer is not being
validated in these 2 functions, because we assume that the driver has
initialized the
array with a non-zero value before calling next_id() or request_addr().

Andres.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help