Skip to contentSkip to conversation

a nice way to reboot :-)

DISCUSSION Bruno Cornec 7 participants 10 messages Jul 22, 2003 – Jul 24, 2003

lore
Share & tools
lore
#0 lore raw

Hello,

Intrigued by a problem reported by a customer (tar cf /dev/st0 /) and remembering another issue I had, I tried to investigate a bit and found the following.

On Linux/ia64 when you do cat /proc/kcore, the system just reboots in a couple of seconds (with RHAS 2.1 std kernel, updated kernel - 2.4.18-e.31) or even with a vanilla 2.4.21 + david's patches.
On Linux/i386, no such problem. As I have seen it on zx2000, rx4670, I think it's not an isolated case.

Could you confirm on other type of machines ? And more smarter people could even probably provide a patch.

Thanks in advance,
Bruno.

Signature · 4 lines
Linux Solution Consultant         Tél: +33 476 143 278 - Fax: +33 476 146 105
HP/Intel Solution Center http://hpintelco.net Hewlett-Packard Grenoble/France
Des infos sur Linux?  http://www.HyPer-Linux.org      http://www.hp.com/linux
La musique ancienne?  http://www.musique-ancienne.org http://www.medieval.org
#1 lore raw
Quoted 3 lines · Bruno Cornec

On Linux/ia64 when you do cat /proc/kcore, the system just reboots in a couple of seconds (with RHAS 2.1 std kernel, updated kernel - 2.4.18-e.31) or even with a vanilla 2.4.21 + david's patches.

Known behavior. David Mosberger tells me Tony Luck changed the support in 2.6 such that only valid regions are accessible. Don't expect it fixed in RHAS anytime soon. You might check if Bjorn Helgaas' ia64 patch on top of 2.4.21 fixes the same problem.

grant

#2 lore raw
In reply to Bruno Cornec
Quoted 6 lines · Grant Grundler
Quoted 3 lines · Bruno Cornec

On Linux/ia64 when you do cat /proc/kcore, the system just reboots in a couple of seconds (with RHAS 2.1 std kernel, updated kernel - 2.4.18-e.31) or even with a vanilla 2.4.21 + david's patches.

Known behavior.

Humm :-) I tend to find that hardly acceptable that people can crash so easily a system.

Quoted 2 lines

David Mosberger tells me Tony Luck changed the support in 2.6 such that only valid regions are accessible.

I didn't take time to test with a 2.6, but will now that you say it could be useful :-)

Quoted 3 lines

Don't expect it fixed in RHAS
anytime soon. You might check if Bjorn Helgaas' ia64 patch on top of 2.4.21 fixes the same problem.

Excuse-me I meant Bjorn's patch on top of 2.4.21. And yes it's crashing the same way with the latest I tried (linux-2.4.21-ia64-030702.diff.bz2).
Of course, being of no help to provide a valid one, I can't cry if you say it's not easy/possible on 2.4 ;-)

Thanks for your answer,
Bruno.

Signature · 4 lines
Linux Solution Consultant         Tél: +33 476 143 278 - Fax: +33 476 146 105
HP/Intel Solution Center http://hpintelco.net Hewlett-Packard Grenoble/France
Des infos sur Linux?  http://www.HyPer-Linux.org      http://www.hp.com/linux
La musique ancienne?  http://www.musique-ancienne.org http://www.medieval.org
#3 lore raw
In reply to Bruno Cornec
Quoted 11 lines · Bruno Cornec
Quoted 6 lines · Grant Grundler
Quoted 3 lines · Bruno Cornec

On Linux/ia64 when you do cat /proc/kcore, the system just reboots in a couple of seconds (with RHAS 2.1 std kernel, updated kernel - 2.4.18-e.31) or even with a vanilla 2.4.21 + david's patches.

Known behavior.

Humm :-) I tend to find that hardly acceptable that people can crash so easily a system.

Believe me, this has been on our list of really annoying things for a long time. The fact that this is just one of many ways that root can crash the box has meant that it hasn't made it to the top of the list (yet). It'll be there soon, though...

Bjorn

#4 lore raw
In reply to Bruno Cornec

Unfortunately I tried it on a DELL 3250 (Dual Itanium 2) running RH AS 2.1 updated to 2.4.18-e.31smp and also got a reboot!

-----Original Message-----
From: Bruno Cornec [mailto:[email protected]]
Sent: Tuesday, July 22, 2003 8:33 AM
To: ia64-list
Cc: [email protected]
Subject: a nice way to reboot :-)

Hello,

Intrigued by a problem reported by a customer (tar cf /dev/st0 /) and remembering
another issue I had, I tried to investigate a bit and found the following.

On Linux/ia64 when you do cat /proc/kcore, the system just reboots in a couple
of seconds (with RHAS 2.1 std kernel, updated kernel - 2.4.18-e.31) or even with a
vanilla 2.4.21 + david's patches.
On Linux/i386, no such problem. As I have seen it on zx2000, rx4670, I think it's
not an isolated case.

Could you confirm on other type of machines ? And more smarter people could even
probably provide a patch.

Thanks in advance,
Bruno.

Signature · 12 lines
Linux Solution Consultant         Tél: +33 476 143 278 - Fax: +33 476 146
105
HP/Intel Solution Center http://hpintelco.net Hewlett-Packard
Grenoble/France
Des infos sur Linux?  http://www.HyPer-Linux.org
http://www.hp.com/linux
La musique ancienne?  http://www.musique-ancienne.org
http://www.medieval.org
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw
In reply to Bruno Cornec
Quoted 2 lines · Bruno Cornec

Humm :-) I tend to find that hardly acceptable that people can crash so easily a system.

it's true on other architectures too, not just ia64. root can crash the system any way they want. stupid user syndrome; they should be using -xdev to not tar up /proc.

Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
#6 lore raw
In reply to Bruno Cornec
Quoted 1 line · Matthew Wilcox

it's true on other architectures too, not just ia64.

Well in general yes, but at least on i386 (I can't test on something else) doing cat /proc/kcore doesn't crash the system. And BTW why should it ? There is nothing wrong with it (for ex. I used it a lot of times to try to find a BIOS revision on i386).

I just wonder if this could be used as a DOS from outside the system. In which case, it would be a Bad Thing (tm :-)

Quoted 2 lines

root can crash
the system any way they want.

Yes, that's true. But it just more surprising when you think you just pass a normal command ;-)

Quoted 2 lines

stupid user syndrome; they should be
using -xdev to not tar up /proc.

Yes, of course, I again agree with you.
But even if I don't do that myself, I tried on a rx5670 the cat /proc/kcore in the past, with the same result, for valid (IMHO) reasons and was really surprised to see the system rebooting. BTW, it also underline the inability for Oracle 9iRAC to fail over properly, which was also a surprise :-)

Every time I see a program doing "core dumped" even if I pass to it crazy args, I tend to believe it's not good enough, and can hide other problems. It's a bug for me, not a feature.
And again in that precise case, I'm far from being able to provide patch. Just grumbling ;-)

Bruno.

Signature · 4 lines
Linux Solution Consultant         Tél: +33 476 143 278 - Fax: +33 476 146 105
HP/Intel Solution Center http://hpintelco.net Hewlett-Packard Grenoble/France
Des infos sur Linux?  http://www.HyPer-Linux.org      http://www.hp.com/linux
La musique ancienne?  http://www.musique-ancienne.org http://www.medieval.org
#7 lore raw
In reply to Bruno Cornec

Bruno Cornec <[email protected]> writes:

|> I just wonder if this could be used as a DOS from outside the system. In
|> which case, it would be a Bad Thing (tm :-)
|> 
|> > root can crash
|> > the system any way they want.  
|> 
|> Yes, that's true. But it just more surprising when you think you just
|> pass a normal command ;-)

If you are already root then shutdown -h is just as effective.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#8 lore raw
In reply to Bruno Cornec
Quoted 4 lines · Bruno Cornec

Well in general yes, but at least on i386 (I can't test on something else) doing cat /proc/kcore doesn't crash the system. And BTW why should it ? There is nothing wrong with it (for ex. I used it a lot of times to try to find a BIOS revision on i386).

you should be using gdb on /proc/kcore; nothing else.

Quoted 2 lines

I just wonder if this could be used as a DOS from outside the system. In which case, it would be a Bad Thing (tm :-)

$ ls -l /proc/kcore 
-r--------    1 root     root     167776256 2003-07-24 08:46 /proc/kcore

and if they're root, you're already fucked.

Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
#9 lore raw
In reply to Bruno Cornec

I think we've beaten this to death: yes, it is an annoying bug, and deserves to be fixed.

Just to clarify: I think you want to use tar with --exclude=/proc or -l; tar doesn't have an -xdev option (that is for find, used with cpio). I've also used --exclude-from=/nodump where /nodump lists the directories to skip: /tmp, /proc, /dev, etc. I actually started doing that because my IA64 Linux system rebooted when using tar to backup (several filesystems at once) to tape :-(
Also note that those are GNU tar extension, and are not available on SysV (but then, I've never seen a SVR4 machine reboot reading /proc).

Andreas, I don't think your analogy is even close: tar is documented create an archive; shutdown is documented to reboot the system:
what Bruno was saying is that running tar (even on /proc) is no more expected to reboot the system than doing an "ls" on /proc. The UnitedLinux man page for tar makes no indication that root can reboot the system with it... Even worse, this behavior does not occur on other Linux/BSD systems, so people don't have a "reasonable expectation" for it to kill the system, especially when "properly" invoked. (Now, trying to extract an old /proc from a tarfile is different -- I'll believe that attempting to replace /proc could reasonably be expected to cause problems, but not reading /proc).

Kevin

-----Original Message-----
From: Andreas Schwab [mailto:[email protected]]
Sent: Thursday, July 24, 2003 6:52 AM
To: Bruno Cornec
Cc: Matthew Wilcox; ia64-list; [email protected]
Subject: Re: a nice way to reboot :-)

Bruno Cornec <[email protected]> writes:

|> I just wonder if this could be used as a DOS from outside the system. In
|> which case, it would be a Bad Thing (tm :-)
|> 
|> > root can crash
|> > the system any way they want.  
|> 
|> Yes, that's true. But it just more surprising when you think you just
|> pass a normal command ;-)

If you are already root then shutdown -h is just as effective.

Andreas.

Signature · 8 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html