Skip to contentSkip to conversation

tg3: Restrict phy ioctl access

PATCH Applied Matt Carlson 3 participants 11 messages Feb 15, 2011 – Feb 17, 2011

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

PATCH 1/1 tg3: Restrict phy ioctl access

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

---
 drivers/net/tg3.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/tg3.c +6 -2
index 93b32d3..06c0e503 100644
@@ -11158,7 +11158,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 		if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
 			break;			/* We have no PHY */
 
-		if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+		if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
+		    ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
+		     !netif_running(dev)))
 			return -EAGAIN;
 
 		spin_lock_bh(&tp->lock);
@@ -11174,7 +11176,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 		if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
 			break;			/* We have no PHY */
 
-		if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+		if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
+		    ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
+		     !netif_running(dev)))
 			return -EAGAIN;
 
 		spin_lock_bh(&tp->lock);
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 7 lines · Matt Carlson

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

There is no such upstream git commit id in Linus's tree. What am I doing wrong here?

confused,

greg k-h

#2 lore raw
Quoted 11 lines · Greg KH
Quoted 7 lines · Matt Carlson

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

There is no such upstream git commit id in Linus's tree. What am I doing wrong here?

The commit is in Dave Miller's net-next-2.6 tree.

maintainer
#3 lore raw

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 15:06:13 -0800

Quoted 8 lines · Greg KH
Quoted 7 lines · Matt Carlson
Quoted 6 lines

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

There is no such upstream git commit id in Linus's tree. What am I doing wrong here?

The commit is in Dave Miller's net-next-2.6 tree.

If it wasn't appropriate for net-2.6, it absolutely it not appropriate for -stable.

#4 lore raw
Quoted 13 lines · David Miller

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 15:06:13 -0800

Quoted 10 lines · Greg KH
Quoted 9 lines · Matt Carlson
Quoted 7 lines

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

There is no such upstream git commit id in Linus's tree. What am I doing wrong here?

The commit is in Dave Miller's net-next-2.6 tree.

If it wasn't appropriate for net-2.6, it absolutely it not appropriate for -stable.

net-2.6 was the target tree for the patch. The stable_kernel_rules.txt seemed to suggest that I could just CC [email protected] with the commit ID, and Greg would pull it in as the process dictates. If that isn't correct, what is the preferred way to expedite the integration of a patch?

#5 lore raw
Quoted 20 lines · Matt Carlson
Quoted 19 lines · David Miller

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 15:06:13 -0800

Quoted 15 lines · Greg KH
Quoted 11 lines · Matt Carlson
Quoted 7 lines

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

There is no such upstream git commit id in Linus's tree. What am I doing wrong here?

The commit is in Dave Miller's net-next-2.6 tree.

Quoted 8 lines
Quoted 2 lines

If it wasn't appropriate for net-2.6, it absolutely it not appropriate for -stable.

net-2.6 was the target tree for the patch. The stable_kernel_rules.txt seemed to suggest that I could just CC [email protected] with the commit ID, and Greg would pull it in as the process dictates. If that isn't correct, what is the preferred way to expedite the integration of a patch?

Keep reading that file, it says to put the Cc: in the signed-off-by area of the original patch.

Also, that file says the patch has to be in Linus's tree, otherwise sending me a git commit id of some other tree isn't going to help at all.

thanks,

greg k-h

maintainer
#7 lore raw
In reply to Matt Carlson

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 15:52:48 -0800

Quoted 20 lines · David Miller
Quoted 19 lines

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 15:06:13 -0800

Quoted 15 lines · Greg KH
Quoted 11 lines · Matt Carlson
Quoted 7 lines

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

There is no such upstream git commit id in Linus's tree. What am I doing wrong here?

The commit is in Dave Miller's net-next-2.6 tree.

Quoted 8 lines
Quoted 2 lines

If it wasn't appropriate for net-2.6, it absolutely it not appropriate for -stable.

net-2.6 was the target tree for the patch. The stable_kernel_rules.txt seemed to suggest that I could just CC [email protected] with the commit ID, and Greg would pull it in as the process dictates. If that isn't correct, what is the preferred way to expedite the integration of a patch?

You are posting a commit ID for the net-next-2.6 tree, that's what triggered my response.

Unless it also went into the net-2.6 tree (in which case you should give Greg the net-2.6 commit ID, which is also what the commit ID must be in Linus's tree right now), the change is not appropriate for -stable submission.

#6 lore raw
In reply to Greg KH
Quoted 24 lines · Greg KH
Quoted 23 lines · Matt Carlson
Quoted 21 lines · David Miller

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 15:06:13 -0800

Quoted 8 lines · Greg KH
Quoted 7 lines · Matt Carlson
Quoted 6 lines

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

There is no such upstream git commit id in Linus's tree. What am I doing wrong here?

The commit is in Dave Miller's net-next-2.6 tree.

If it wasn't appropriate for net-2.6, it absolutely it not appropriate for -stable.

Quoted 8 lines
Quoted 5 lines

net-2.6 was the target tree for the patch. The stable_kernel_rules.txt seemed to suggest that I could just CC [email protected] with the commit ID, and Greg would pull it in as the process dictates. If that isn't correct, what is the preferred way to expedite the integration of a patch?

Keep reading that file, it says to put the Cc: in the signed-off-by area of the original patch.

Ah. Yes. I see that now.

Quoted 3 lines

Also, that file says the patch has to be in Linus's tree, otherwise sending me a git commit id of some other tree isn't going to help at all.

I see. Thanks for the tips.

#8 lore raw
In reply to David Miller
Quoted 32 lines · David Miller

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 15:52:48 -0800

Quoted 20 lines · David Miller
Quoted 19 lines

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 15:06:13 -0800

Quoted 15 lines · Greg KH
Quoted 11 lines · Matt Carlson
Quoted 7 lines

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Upstream commit ID f746a3136a61ae535c5d0b49a9418fa21edc61b5

There is no such upstream git commit id in Linus's tree. What am I doing wrong here?

The commit is in Dave Miller's net-next-2.6 tree.

Quoted 8 lines
Quoted 2 lines

If it wasn't appropriate for net-2.6, it absolutely it not appropriate for -stable.

net-2.6 was the target tree for the patch. The stable_kernel_rules.txt seemed to suggest that I could just CC [email protected] with the commit ID, and Greg would pull it in as the process dictates. If that isn't correct, what is the preferred way to expedite the integration of a patch?

Quoted 7 lines

You are posting a commit ID for the net-next-2.6 tree, that's what triggered my response.

Unless it also went into the net-2.6 tree (in which case you should give Greg the net-2.6 commit ID, which is also what the commit ID must be in Linus's tree right now), the change is not appropriate for -stable submission.

So the proper thing to do here is recall the patch, submit a new patch to net-2.6 with a CC: [email protected] in the signed-off-by section.

Would I do the exact same thing if I were posting to net-next-2.6? (i.e. the CC line tells you I want this patch to go to net-next-2.6, net-2.6, then Linus's tree, then stable?) Or would you rather I posted a completely different patchset against net-2.6?

maintainer
#9 lore raw

From: "Matt Carlson" <[email protected]>
Date: Wed, 16 Feb 2011 16:39:47 -0800

Quoted 2 lines

So the proper thing to do here is recall the patch, submit a new patch to net-2.6 with a CC: [email protected] in the signed-off-by section.

No.

I have not applied your patch yet, but when I do and I also get my tree pulled next time into Linus's tree, you can ask stable to apply it.

Because only at that point will it exist as a commit in Linus's tree.

Before that happens you cannot ask Greg to apply it to his tree.

maintainer Applied
#10 lore raw
In reply to Matt Carlson

From: "Matt Carlson" <[email protected]>
Date: Tue, 15 Feb 2011 14:51:10 -0800

Quoted 9 lines

If management firmware is present and the device is down, the firmware will assume control of the phy. If a phy access were allowed from the host, it will collide with firmware phy accesses, resulting in unpredictable behavior. This patch fixes the problem by disallowing phy accesses during the problematic condition.

Applied.