mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BKPATCH] Fix for "Badness in kobject_get" (affected ieee1394)
@ 2004-02-12 14:57 Ben Collins
  2004-02-13 20:50 ` Torrey Hoffman
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Collins @ 2004-02-12 14:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linus Torvalds, greg, linux-kernel

This seems to have only affected ieee1394 because it uses
bus_for_each_dev in a particular (although correct) way.

Linux/Andrew/Greg, if you want to pull this from my repo, I can email
you the bk url privately.

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


ChangeSet@1.1634, 2004-02-12 09:51:06-05:00, bcollins@debian.org
  [DRV/BASE]: Put checks in bus_for_each_{dev,drv} to make sure we don't go past the end of the list.


 bus.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)


diff -Nru a/drivers/base/bus.c b/drivers/base/bus.c
--- a/drivers/base/bus.c	Thu Feb 12 09:54:43 2004
+++ b/drivers/base/bus.c	Thu Feb 12 09:54:43 2004
@@ -168,7 +168,13 @@
 
 	down_read(&bus->subsys.rwsem);
 	list_for_each(entry,head) {
-		struct device * dev = get_device(to_dev(entry));
+		struct device *dev;
+
+		/* End of list */
+		if (entry == &bus->devices.list)
+			break;
+
+		dev = get_device(to_dev(entry));
 		error = fn(dev,data);
 		put_device(dev);
 		if (error)
@@ -212,7 +218,13 @@
 
 	down_read(&bus->subsys.rwsem);
 	list_for_each(entry,head) {
-		struct device_driver * drv = get_driver(to_drv(entry));
+		struct device_driver *drv;
+
+		/* End of list */
+		if (entry == &bus->drivers.list)
+			break;
+
+		drv = get_driver(to_drv(entry));
 		error = fn(drv,data);
 		put_driver(drv);
 		if(error)

===================================================================


This BitKeeper patch contains the following changesets:
1.1634
## Wrapped with gzip_uu ##


M'XL( +.3*T   [64;6O;,!#'7UN?XJ"PK=UB2Y9DQRXI?4C9Q@8+*=V;;03%
M5N(0QRJ2G+;,^^Z38YJN-!MTM'Y \OGOXW=W?[P'ET;JU)MFJBP7E4%[\$$9
MFWJYG"Y$Y2L]=Z&Q4BX4U$8'1F?!4NI*EH'3US>]T(^0DXR$S0I82VU2C_AT
M&[&W5S+UQN?O+S^?C!$:#."L$-5<7D@+@P&R2J]%F9MC88M25;[5HC(K:86?
MJ56SE38AQJ$[.8DIYE%#(LSB)B,Y(8(1F>.0]2-VGZU0*^DKDY=M 0_3,!P2
M3!*2T*2A<<(C- 3BDX@RP"S 84!"P$G*28JC'N8IQG#7G./[IL!; CV,3N%Y
M"SA#&7P;CK\&IR<7YS]2&-46LD)F2P.+"J:UF<R4GDB1%9.?N5R_R_7ZET. 
ME5A*,+66<"TA5]5K"W,%5\)8L(4$6>6@9IMMN3#61Y^ ]BF+T>A^&JCWQ ,A
M+# Z@I5RA.7Q7,I*^%?Y3=?WRM6<ZT5KB& JC P<O)]U;> A"XF[>1/Q,.8-
MS?*$4R[Z2<SE+":[&OZ79.TT0\)81&A#,8WZ&XL]UK9>>W[0NY1;I^U.1'%"
M,>$\H=P].@=L+,?I \.Q*"7TGX9CT M?Q'$OZ++-2+Y 3U]O+N>:T8[I_(?W
MAL3YA*"/[1(CSS-6UYD%A[O()!RX]1!]=_'@ ,X[KI8)#@(76\S@C:RLOG6N
M@%>.H'?4?6?\5K3O)-Y42['L4KAW,("YM)-.]<:J=M>EV-\_1,.0\):E71ZQ
L3+IR'9)^(E+7IMU(>HNT46V0]!](V_]O-]=Z->"",=$G&/T&#+NI(_,%    
 

-- 
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
WatchGuard - http://www.watchguard.com/

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

* Re: [BKPATCH] Fix for "Badness in kobject_get" (affected ieee1394)
  2004-02-13 20:50 ` Torrey Hoffman
@ 2004-02-13 20:41   ` Ben Collins
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Collins @ 2004-02-13 20:41 UTC (permalink / raw)
  To: Torrey Hoffman; +Cc: Andrew Morton, Linus Torvalds, greg, Linux-Kernel List

On Fri, Feb 13, 2004 at 12:50:41PM -0800, Torrey Hoffman wrote:
> On Thu, 2004-02-12 at 06:57, Ben Collins wrote:
> > This seems to have only affected ieee1394 because it uses
> > bus_for_each_dev in a particular (although correct) way.
> [...]
> > ChangeSet@1.1634, 2004-02-12 09:51:06-05:00, bcollins@debian.org
> >   [DRV/BASE]: Put checks in bus_for_each_{dev,drv} to make sure we don't go past the end of the list.
> 
> 
> Thanks, I applied this on top of 2.6.3-rc2-mm1 and it fixed my crash at
> boot problem.  I'll do more extensive testing of the 1394 subsystem
> later today.

After much discussion, Linus put together a cleaner more correct patch
which is in the latest bk.

-- 
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
WatchGuard - http://www.watchguard.com/

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

* Re: [BKPATCH] Fix for "Badness in kobject_get" (affected ieee1394)
  2004-02-12 14:57 [BKPATCH] Fix for "Badness in kobject_get" (affected ieee1394) Ben Collins
@ 2004-02-13 20:50 ` Torrey Hoffman
  2004-02-13 20:41   ` Ben Collins
  0 siblings, 1 reply; 3+ messages in thread
From: Torrey Hoffman @ 2004-02-13 20:50 UTC (permalink / raw)
  To: Ben Collins; +Cc: Andrew Morton, Linus Torvalds, greg, Linux-Kernel List

On Thu, 2004-02-12 at 06:57, Ben Collins wrote:
> This seems to have only affected ieee1394 because it uses
> bus_for_each_dev in a particular (although correct) way.
[...]
> ChangeSet@1.1634, 2004-02-12 09:51:06-05:00, bcollins@debian.org
>   [DRV/BASE]: Put checks in bus_for_each_{dev,drv} to make sure we don't go past the end of the list.


Thanks, I applied this on top of 2.6.3-rc2-mm1 and it fixed my crash at
boot problem.  I'll do more extensive testing of the 1394 subsystem
later today.

-- 
Torrey Hoffman <thoffman@arnor.net>


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

end of thread, other threads:[~2004-02-13 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-12 14:57 [BKPATCH] Fix for "Badness in kobject_get" (affected ieee1394) Ben Collins
2004-02-13 20:50 ` Torrey Hoffman
2004-02-13 20:41   ` Ben Collins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®