netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* skge: reboot on sysfs resource0 access
@ 2005-09-09 17:34 Bernd Schubert
  0 siblings, 0 replies; 6+ messages in thread
From: Bernd Schubert @ 2005-09-09 17:34 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger

Hello,

today we tried 2.6.13 on our server and also tried to use the skge driver. 
Well, in principle it works fine, until I became curious about the sysfs 
values. Stupid me, I was using the midnight commander to read the values. 
When I opened "/sys/bus/pci/drivers/skge/0000:01:01.0/resource0", the system 
immediately rebooted. After the reboot we tested using cat to the resource0 
file, which gave an input/output error. Using again the mc, the system again 
immediately rebooted.
Well, I guess I better don't use the midnight commander in the future, but 
somehow I think it shouldn't cause the system to reboot, should it? Is the 
i/o error of cat supposed to happen?

Maybe it helps, here is a strace of mc's open for a normal file:

open("/home/bernd/notes", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=96, ...}) = 0
fcntl64(102, F_GETFL)                   = -1 EBADF (Bad file descriptor)
read(6, "http", 4)                      = 4
mmap2(NULL, 96, PROT_READ, MAP_SHARED, 6, 0) = 0x402fe000
select(5, [4], NULL, NULL, {0, 0})      = 0 (Timeout)
select(5, [4], NULL, NULL, {0, 0})      = 0 (Timeout)
write(1, "\33[1;1H\33[m\17\33[30m\33[46mFile: notes "..., 4019) = 4019


Thanks,
	Bernd


-- 
Bernd Schubert
Physikalisch Chemisches Institut / Theoretische Chemie
Universität Heidelberg
INF 229
69120 Heidelberg
e-mail: bernd.schubert@pci.uni-heidelberg.de

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

* skge: reboot on sysfs resource0 access
@ 2005-09-09 17:38 Bernd Schubert
  2005-09-09 18:01 ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: Bernd Schubert @ 2005-09-09 17:38 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger

Hello,

today we tried 2.6.13 on our server and also tried to use the skge driver. 
Well, in principle it works fine, until I became curious about the sysfs 
values. Stupid me, I was using the midnight commander to read the values. 
When I opened "/sys/bus/pci/drivers/skge/0000:01:01.0/resource0", the system 
immediately rebooted. After the reboot we tested using cat to the resource0 
file, which gave an input/output error. Using again the mc, the system again 
immediately rebooted.
Well, I guess I better don't use the midnight commander in the future, but 
somehow I think it shouldn't cause the system to reboot, should it? Is the 
i/o error of cat supposed to happen?

Maybe it helps, here is a strace of mc's open for a normal file:

open("/home/bernd/notes", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=96, ...}) = 0
fcntl64(102, F_GETFL)                   = -1 EBADF (Bad file descriptor)
read(6, "http", 4)                      = 4
mmap2(NULL, 96, PROT_READ, MAP_SHARED, 6, 0) = 0x402fe000
select(5, [4], NULL, NULL, {0, 0})      = 0 (Timeout)
select(5, [4], NULL, NULL, {0, 0})      = 0 (Timeout)
write(1, "\33[1;1H\33[m\17\33[30m\33[46mFile: notes "..., 4019) = 4019


Thanks,
	Bernd


-- 
Bernd Schubert
Physikalisch Chemisches Institut / Theoretische Chemie
Universität Heidelberg
INF 229
69120 Heidelberg
e-mail: bernd.schubert@pci.uni-heidelberg.de

-- 
Bernd Schubert
Physikalisch Chemisches Institut / Theoretische Chemie
Universität Heidelberg
INF 229
69120 Heidelberg
e-mail: bernd.schubert@pci.uni-heidelberg.de

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

* Re: skge: reboot on sysfs resource0 access
  2005-09-09 17:38 skge: reboot on sysfs resource0 access Bernd Schubert
@ 2005-09-09 18:01 ` Stephen Hemminger
  2005-09-09 18:09   ` Bernd Schubert
  2005-09-09 18:21   ` Ben Greear
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Hemminger @ 2005-09-09 18:01 UTC (permalink / raw)
  To: bernd-schubert; +Cc: bernd.schubert, netdev

On Fri, 9 Sep 2005 19:38:17 +0200
Bernd Schubert <bernd.schubert@pci.uni-heidelberg.de> wrote:

> Hello,
> 
> today we tried 2.6.13 on our server and also tried to use the skge driver. 
> Well, in principle it works fine, until I became curious about the sysfs 
> values. Stupid me, I was using the midnight commander to read the values. 
> When I opened "/sys/bus/pci/drivers/skge/0000:01:01.0/resource0", the system 
> immediately rebooted. After the reboot we tested using cat to the resource0 
> file, which gave an input/output error. Using again the mc, the system again 
> immediately rebooted.
> Well, I guess I better don't use the midnight commander in the future, but 
> somehow I think it shouldn't cause the system to reboot, should it? Is the 
> i/o error of cat supposed to happen?
>

Don't do that!  resource0 is the pci space for the card and
reading it directly accesses the memory mapped space. The
register is sparse, and some places are unaccessable. 
Accessing non-existent memory will cause system to hang and if you
are lucky a timeout and reboot.

Sorry, this is not a driver bug.

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

* Re: skge: reboot on sysfs resource0 access
  2005-09-09 18:01 ` Stephen Hemminger
@ 2005-09-09 18:09   ` Bernd Schubert
  2005-09-09 18:21   ` Ben Greear
  1 sibling, 0 replies; 6+ messages in thread
From: Bernd Schubert @ 2005-09-09 18:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Friday 09 September 2005 20:01, you wrote:
> On Fri, 9 Sep 2005 19:38:17 +0200
>
> Bernd Schubert <bernd.schubert@pci.uni-heidelberg.de> wrote:
> > Hello,
> >
> > today we tried 2.6.13 on our server and also tried to use the skge
> > driver. Well, in principle it works fine, until I became curious about
> > the sysfs values. Stupid me, I was using the midnight commander to read
> > the values. When I opened
> > "/sys/bus/pci/drivers/skge/0000:01:01.0/resource0", the system
> > immediately rebooted. After the reboot we tested using cat to the
> > resource0 file, which gave an input/output error. Using again the mc, the
> > system again immediately rebooted.
> > Well, I guess I better don't use the midnight commander in the future,
> > but somehow I think it shouldn't cause the system to reboot, should it?
> > Is the i/o error of cat supposed to happen?
>
> Don't do that!  resource0 is the pci space for the card and
> reading it directly accesses the memory mapped space. The
> register is sparse, and some places are unaccessable.
> Accessing non-existent memory will cause system to hang and if you
> are lucky a timeout and reboot.
>
> Sorry, this is not a driver bug.

Thanks, I better also won't read the resource values of the other pci-devices. 
And I think I will search for some documentation of sysfs to know in the 
future which values one should read and which not.

Thanks again,
	Bernd

-- 
Bernd Schubert
Physikalisch Chemisches Institut / Theoretische Chemie
Universität Heidelberg
INF 229
69120 Heidelberg
e-mail: bernd.schubert@pci.uni-heidelberg.de

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

* Re: skge: reboot on sysfs resource0 access
  2005-09-09 18:01 ` Stephen Hemminger
  2005-09-09 18:09   ` Bernd Schubert
@ 2005-09-09 18:21   ` Ben Greear
  2005-09-12 11:01     ` Bernd Schubert
  1 sibling, 1 reply; 6+ messages in thread
From: Ben Greear @ 2005-09-09 18:21 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: bernd-schubert, bernd.schubert, netdev

Stephen Hemminger wrote:
> On Fri, 9 Sep 2005 19:38:17 +0200
> Bernd Schubert <bernd.schubert@pci.uni-heidelberg.de> wrote:
> 
> 
>>Hello,
>>
>>today we tried 2.6.13 on our server and also tried to use the skge driver. 
>>Well, in principle it works fine, until I became curious about the sysfs 
>>values. Stupid me, I was using the midnight commander to read the values. 
>>When I opened "/sys/bus/pci/drivers/skge/0000:01:01.0/resource0", the system 
>>immediately rebooted. After the reboot we tested using cat to the resource0 
>>file, which gave an input/output error. Using again the mc, the system again 
>>immediately rebooted.
>>Well, I guess I better don't use the midnight commander in the future, but 
>>somehow I think it shouldn't cause the system to reboot, should it? Is the 
>>i/o error of cat supposed to happen?
>>
> 
> 
> Don't do that!  resource0 is the pci space for the card and
> reading it directly accesses the memory mapped space. The
> register is sparse, and some places are unaccessable. 
> Accessing non-existent memory will cause system to hang and if you
> are lucky a timeout and reboot.
> 
> Sorry, this is not a driver bug.

Does that mean if you do this:

find /sys -name "*" -print|xargs grep foo

that the system will crash?

I certainly would consider that a bug, and even if that somehow works, I'd
think that at the least you should be able to read every file in the file
system without crashing the system!

Do you at least have to be root to cause this crash?

Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

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

* Re: skge: reboot on sysfs resource0 access
  2005-09-09 18:21   ` Ben Greear
@ 2005-09-12 11:01     ` Bernd Schubert
  0 siblings, 0 replies; 6+ messages in thread
From: Bernd Schubert @ 2005-09-12 11:01 UTC (permalink / raw)
  To: Ben Greear; +Cc: Stephen Hemminger, netdev

> > Sorry, this is not a driver bug.
>
> Does that mean if you do this:
>
> find /sys -name "*" -print|xargs grep foo
>
> that the system will crash?

I would also guess it would happen, though I won't try that now.

>
> I certainly would consider that a bug, and even if that somehow works, I'd
> think that at the least you should be able to read every file in the file
> system without crashing the system!
>
> Do you at least have to be root to cause this crash?

Yes, the resource0 file has rw access to root only.


Cheers,
	Bernd

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

end of thread, other threads:[~2005-09-12 11:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-09 17:38 skge: reboot on sysfs resource0 access Bernd Schubert
2005-09-09 18:01 ` Stephen Hemminger
2005-09-09 18:09   ` Bernd Schubert
2005-09-09 18:21   ` Ben Greear
2005-09-12 11:01     ` Bernd Schubert
  -- strict thread matches above, loose matches on Subject: below --
2005-09-09 17:34 Bernd Schubert

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