Skip to contentSkip to conversation

Connector: Set the CN_NETLINK_USERS correctly

PATCH In review K. Y. Srinivasan 2 participants 5 messages May 17, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Connector: Set the CN_NETLINK_USERS correctly

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

---
 include/linux/connector.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/connector.h +1 -1
index 7c60d09..f696bcc 100644
@@ -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.
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 2/2 Connector: Correctly set the error code in case of success when dispatching receive callbacks

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.

---
 drivers/connector/connector.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/connector/connector.c +1 -0
index d770058..c36fbe1 100644
@@ -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);
Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks

Quoted 3 lines · 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.

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

#3 lore raw

RE: [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks

Quoted 12 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, May 17, 2011 6:32 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
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:

Quoted 8 lines
Quoted 3 lines

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 <[email protected]>
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

#4 lore raw

Re: [PATCH 2/2] Connector: Correctly set the error code in case of success when dispatching receive callbacks

Quoted 26 lines · KY Srinivasan
Quoted 12 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, May 17, 2011 6:32 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
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:

Quoted 8 lines
Quoted 3 lines

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:

Quoted 6 lines

commit 04f482faf50535229a5a5c8d629cf963899f857c

Author: Patrick McHardy <[email protected]>
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