linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Drivers: hv: vmbus: Release cpu lock in error case
@ 2022-06-09 17:16 Saurabh Sengar
  2022-06-09 17:39 ` Michael Kelley (LINUX)
  0 siblings, 1 reply; 3+ messages in thread
From: Saurabh Sengar @ 2022-06-09 17:16 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, wei.liu, decui, linux-hyperv,
	linux-kernel, ssengar, mikelley

In case of invalid sub channel, release cpu lock before returning.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
---
 drivers/hv/channel_mgmt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 280b529..5b12040 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -639,6 +639,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
 		 */
 		if (newchannel->offermsg.offer.sub_channel_index == 0) {
 			mutex_unlock(&vmbus_connection.channel_mutex);
+			cpus_read_unlock();
 			/*
 			 * Don't call free_channel(), because newchannel->kobj
 			 * is not initialized yet.
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] Drivers: hv: vmbus: Release cpu lock in error case
  2022-06-09 17:16 [PATCH] Drivers: hv: vmbus: Release cpu lock in error case Saurabh Sengar
@ 2022-06-09 17:39 ` Michael Kelley (LINUX)
  2022-06-10  8:40   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kelley (LINUX) @ 2022-06-09 17:39 UTC (permalink / raw)
  To: Saurabh Sengar, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
	wei.liu, Dexuan Cui, linux-hyperv, linux-kernel,
	Saurabh Singh Sengar

From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Thursday, June 9, 2022 10:17 AM
> 
> In case of invalid sub channel, release cpu lock before returning.
> 
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> ---
>  drivers/hv/channel_mgmt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> index 280b529..5b12040 100644
> --- a/drivers/hv/channel_mgmt.c
> +++ b/drivers/hv/channel_mgmt.c
> @@ -639,6 +639,7 @@ static void vmbus_process_offer(struct vmbus_channel
> *newchannel)
>  		 */
>  		if (newchannel->offermsg.offer.sub_channel_index == 0) {
>  			mutex_unlock(&vmbus_connection.channel_mutex);
> +			cpus_read_unlock();
>  			/*
>  			 * Don't call free_channel(), because newchannel->kobj
>  			 * is not initialized yet.
> --
> 1.8.3.1

Reviewed-by: Michael Kelley <mikelley@microsoft.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Drivers: hv: vmbus: Release cpu lock in error case
  2022-06-09 17:39 ` Michael Kelley (LINUX)
@ 2022-06-10  8:40   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2022-06-10  8:40 UTC (permalink / raw)
  To: Michael Kelley (LINUX)
  Cc: Saurabh Sengar, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
	wei.liu, Dexuan Cui, linux-hyperv, linux-kernel,
	Saurabh Singh Sengar

On Thu, Jun 09, 2022 at 05:39:06PM +0000, Michael Kelley (LINUX) wrote:
> From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Thursday, June 9, 2022 10:17 AM
> > 
> > In case of invalid sub channel, release cpu lock before returning.
> > 
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> >  drivers/hv/channel_mgmt.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> > index 280b529..5b12040 100644
> > --- a/drivers/hv/channel_mgmt.c
> > +++ b/drivers/hv/channel_mgmt.c
> > @@ -639,6 +639,7 @@ static void vmbus_process_offer(struct vmbus_channel
> > *newchannel)
> >  		 */
> >  		if (newchannel->offermsg.offer.sub_channel_index == 0) {
> >  			mutex_unlock(&vmbus_connection.channel_mutex);
> > +			cpus_read_unlock();
> >  			/*
> >  			 * Don't call free_channel(), because newchannel->kobj
> >  			 * is not initialized yet.
> > --
> > 1.8.3.1
> 
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> 

The bug comes from a949e86c0d780.

Added a Fixes tag and applied to hyperv-fixes. Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-10  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 17:16 [PATCH] Drivers: hv: vmbus: Release cpu lock in error case Saurabh Sengar
2022-06-09 17:39 ` Michael Kelley (LINUX)
2022-06-10  8:40   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).