Message ID | 20220107210655.1358969-1-marcelo.cerri@canonical.com |
---|---|
State | New |
Headers | show |
Series | [focal:azure-cvm] UBUNTU: SAUCE: Drivers: hv: vmbus: Initialize request offers message for Isolation VM | expand |
Acked-by: Tim Gardner <tim.gardner@canonical.com> On 1/7/22 2:06 PM, Marcelo Henrique Cerri wrote: > From: Juan Vazquez <juvazq@linux.microsoft.com> > > BugLink: https://bugs.launchpad.net/bugs/1956793 > > Initialize memory of request offers message to be sent to the host so > padding or uninitialized fields do not leak guest memory contents. > > Signed-off-by: Juan Vazquez <juvazq@linux.microsoft.com> > Link: https://lore.kernel.org/r/20220105192746.23046-1-juvazq@linux.microsoft.com > Signed-off-by: Wei Liu <wei.liu@kernel.org> > (cherry picked from commit 6a27e396ebb149fc47baccc1957a7a9dd70049a7 > from git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git) > Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> > --- > drivers/hv/channel_mgmt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > index 454244385424..3bb86d9e1dff 100644 > --- a/drivers/hv/channel_mgmt.c > +++ b/drivers/hv/channel_mgmt.c > @@ -1525,7 +1525,7 @@ int vmbus_request_offers(void) > struct vmbus_channel_msginfo *msginfo; > int ret; > > - msginfo = kmalloc(sizeof(*msginfo) + > + msginfo = kzalloc(sizeof(*msginfo) + > sizeof(struct vmbus_channel_message_header), > GFP_KERNEL); > if (!msginfo) >
Acked-by: Joseph Salisbury <joseph.salisbury@canonical.com> On 1/7/22 16:06, Marcelo Henrique Cerri wrote: > From: Juan Vazquez <juvazq@linux.microsoft.com> > > BugLink: https://bugs.launchpad.net/bugs/1956793 > > Initialize memory of request offers message to be sent to the host so > padding or uninitialized fields do not leak guest memory contents. > > Signed-off-by: Juan Vazquez <juvazq@linux.microsoft.com> > Link: https://lore.kernel.org/r/20220105192746.23046-1-juvazq@linux.microsoft.com > Signed-off-by: Wei Liu <wei.liu@kernel.org> > (cherry picked from commit 6a27e396ebb149fc47baccc1957a7a9dd70049a7 > from git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git) > Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> > --- > drivers/hv/channel_mgmt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > index 454244385424..3bb86d9e1dff 100644 > --- a/drivers/hv/channel_mgmt.c > +++ b/drivers/hv/channel_mgmt.c > @@ -1525,7 +1525,7 @@ int vmbus_request_offers(void) > struct vmbus_channel_msginfo *msginfo; > int ret; > > - msginfo = kmalloc(sizeof(*msginfo) + > + msginfo = kzalloc(sizeof(*msginfo) + > sizeof(struct vmbus_channel_message_header), > GFP_KERNEL); > if (!msginfo)
Applied. Thanks! On Fri, Jan 07, 2022 at 06:06:55PM -0300, Marcelo Henrique Cerri wrote: > From: Juan Vazquez <juvazq@linux.microsoft.com> > > BugLink: https://bugs.launchpad.net/bugs/1956793 > > Initialize memory of request offers message to be sent to the host so > padding or uninitialized fields do not leak guest memory contents. > > Signed-off-by: Juan Vazquez <juvazq@linux.microsoft.com> > Link: https://lore.kernel.org/r/20220105192746.23046-1-juvazq@linux.microsoft.com > Signed-off-by: Wei Liu <wei.liu@kernel.org> > (cherry picked from commit 6a27e396ebb149fc47baccc1957a7a9dd70049a7 > from git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git) > Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> > --- > drivers/hv/channel_mgmt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > index 454244385424..3bb86d9e1dff 100644 > --- a/drivers/hv/channel_mgmt.c > +++ b/drivers/hv/channel_mgmt.c > @@ -1525,7 +1525,7 @@ int vmbus_request_offers(void) > struct vmbus_channel_msginfo *msginfo; > int ret; > > - msginfo = kmalloc(sizeof(*msginfo) + > + msginfo = kzalloc(sizeof(*msginfo) + > sizeof(struct vmbus_channel_message_header), > GFP_KERNEL); > if (!msginfo) > -- > 2.25.1 >
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 454244385424..3bb86d9e1dff 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -1525,7 +1525,7 @@ int vmbus_request_offers(void) struct vmbus_channel_msginfo *msginfo; int ret; - msginfo = kmalloc(sizeof(*msginfo) + + msginfo = kzalloc(sizeof(*msginfo) + sizeof(struct vmbus_channel_message_header), GFP_KERNEL); if (!msginfo)