virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Connector: Set the CN_NETLINK_USERS correctly
@ 2011-05-17 22:25 K. Y. Srinivasan
  2011-05-17 22:25 ` [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks K. Y. Srinivasan
  0 siblings, 1 reply; 5+ messages in thread
From: K. Y. Srinivasan @ 2011-05-17 22:25 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization; +Cc: K. Y. Srinivasan

The CN_NETLINK_USERS must be set to the highest valid index +1.
Thanks to Evgeniy for pointing this out.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 include/linux/connector.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/connector.h b/include/linux/connector.h
index 7c60d09..f696bcc 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -44,7 +44,7 @@
 #define CN_VAL_DRBD			0x1
 #define CN_KVP_IDX			0x9	/* HyperV KVP */
 
-#define CN_NETLINK_USERS		9
+#define CN_NETLINK_USERS		10	/* Highest index + 1 */
 
 /*
  * Maximum connector's message size.
-- 
1.7.4.1

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

* [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks
  2011-05-17 22:25 [PATCH 1/2] Connector: Set the CN_NETLINK_USERS correctly K. Y. Srinivasan
@ 2011-05-17 22:25 ` K. Y. Srinivasan
  2011-05-17 22:31   ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: K. Y. Srinivasan @ 2011-05-17 22:25 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, virtualization; +Cc: K. Y. Srinivasan

The recent changes to the connector code introduced this bug where even
when a callback was invoked, we would return an error resulting in
double freeing of the skb. This patch fixes this bug.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/connector/connector.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index d770058..c36fbe1 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -139,6 +139,7 @@ static int cn_call_callback(struct sk_buff *skb)
 	spin_unlock_bh(&dev->cbdev->queue_lock);
 
 	if (cbq != NULL) {
+		err = 0;
 		cbq->callback(msg, nsp);
 		kfree_skb(skb);
 		cn_queue_release_callback(cbq);
-- 
1.7.4.1

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

* Re: [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks
  2011-05-17 22:25 ` [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks K. Y. Srinivasan
@ 2011-05-17 22:31   ` Greg KH
  2011-05-17 22:53     ` KY Srinivasan
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2011-05-17 22:31 UTC (permalink / raw)
  To: K. Y. Srinivasan; +Cc: gregkh, linux-kernel, devel, virtualization

On Tue, May 17, 2011 at 03:25:38PM -0700, K. Y. Srinivasan wrote:
> The recent changes to the connector code introduced this bug where even
> when a callback was invoked, we would return an error resulting in
> double freeing of the skb. This patch fixes this bug.

By "recent" what do you mean?  Is this something that is in the .39
kernel?  Do you have a git commit id that caused this?

Or is this due to changes that are queued up for the .40 merge window?

thanks,

greg k-h

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

* RE: [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks
  2011-05-17 22:31   ` Greg KH
@ 2011-05-17 22:53     ` KY Srinivasan
  2011-05-17 23:05       ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: KY Srinivasan @ 2011-05-17 22:53 UTC (permalink / raw)
  To: Greg KH
  Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, virtualization@lists.osdl.org



> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Tuesday, May 17, 2011 6:32 PM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org
> Subject: Re: [PATCH 2/2] Connector: Correctly set the error code in case of
> success when dispatching receive callbacks
> 
> On Tue, May 17, 2011 at 03:25:38PM -0700, K. Y. Srinivasan wrote:
> > The recent changes to the connector code introduced this bug where even
> > when a callback was invoked, we would return an error resulting in
> > double freeing of the skb. This patch fixes this bug.
> 
> By "recent" what do you mean?  Is this something that is in the .39
> kernel?  Do you have a git commit id that caused this?
> 
> Or is this due to changes that are queued up for the .40 merge window?

I just happened to test KVP functionality yesterday on latest bits from your tree (NEXT)
and discovered that whenever  something was sent to the kernel from userland on a 
connector channel, the system would hang. The following commit appears to be where
this bug was introduced:

commit 04f482faf50535229a5a5c8d629cf963899f857c
Author: Patrick McHardy <kaber@trash.net>
Date:   Mon Mar 28 08:39:36 2011 +0000

Since prior to this commit I don't see this problem. In any event the current code is clearly
broken.

Regards,

K. Y

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

* Re: [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks
  2011-05-17 22:53     ` KY Srinivasan
@ 2011-05-17 23:05       ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2011-05-17 23:05 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, virtualization@lists.osdl.org

On Tue, May 17, 2011 at 10:53:18PM +0000, KY Srinivasan wrote:
> 
> 
> > -----Original Message-----
> > From: Greg KH [mailto:greg@kroah.com]
> > Sent: Tuesday, May 17, 2011 6:32 PM
> > To: KY Srinivasan
> > Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> > devel@linuxdriverproject.org; virtualization@lists.osdl.org
> > Subject: Re: [PATCH 2/2] Connector: Correctly set the error code in case of
> > success when dispatching receive callbacks
> > 
> > On Tue, May 17, 2011 at 03:25:38PM -0700, K. Y. Srinivasan wrote:
> > > The recent changes to the connector code introduced this bug where even
> > > when a callback was invoked, we would return an error resulting in
> > > double freeing of the skb. This patch fixes this bug.
> > 
> > By "recent" what do you mean?  Is this something that is in the .39
> > kernel?  Do you have a git commit id that caused this?
> > 
> > Or is this due to changes that are queued up for the .40 merge window?
> 
> I just happened to test KVP functionality yesterday on latest bits from your tree (NEXT)
> and discovered that whenever  something was sent to the kernel from userland on a 
> connector channel, the system would hang. The following commit appears to be where
> this bug was introduced:
> 
> commit 04f482faf50535229a5a5c8d629cf963899f857c
> Author: Patrick McHardy <kaber@trash.net>
> Date:   Mon Mar 28 08:39:36 2011 +0000
> 
> Since prior to this commit I don't see this problem. In any event the current code is clearly
> broken.

Ok, since this was released in the 2.6.39-rc2 kernel, this needs to get
backported to the .39-stable kernel release as well, I'll mark it as
such when I apply it to the tree.

thanks,

greg k-h

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

end of thread, other threads:[~2011-05-17 23:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-17 22:25 [PATCH 1/2] Connector: Set the CN_NETLINK_USERS correctly K. Y. Srinivasan
2011-05-17 22:25 ` [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks K. Y. Srinivasan
2011-05-17 22:31   ` Greg KH
2011-05-17 22:53     ` KY Srinivasan
2011-05-17 23:05       ` Greg KH

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).