Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd - PID 1 is killed it seems

2019-05-25 Thread arne
> > # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
> >
> > I found out PID 1 is killed when I tried to reboot:
> > # reboot
> > Failed to open /dev/initctl: No such device or address
> > Failed to talk to init daemon.
> >
> > So I will have to use SysReq keys
> >  
> 
> Can somebody, please link me to the Documentation Files on those
> SysReq keys?  Thanks!
> 
> Kenneth Parker
> 
> >
> >  
https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html



Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd - PID 1 is killed it seems

2019-05-25 Thread tomas
On Sat, May 25, 2019 at 08:35:45AM -0400, Kenneth Parker wrote:

[...]

> Can somebody, please link me to the Documentation Files on those SysReq
> keys?  Thanks!

https://en.wikipedia.org/wiki/Magic_SysRq_key

Cheers
-- t


signature.asc
Description: Digital signature


Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd - PID 1 is killed it seems

2019-05-25 Thread Kenneth Parker
On Sat, May 25, 2019, 5:45 AM arne  wrote:

> On Sat, 25 May 2019 00:21:07 +0200
> arne  wrote:
>
> > On Fri, 24 May 2019 23:43:49 +0200
> > arne  wrote:
> >
> > > On Fri, 24 May 2019 14:01:35 -0700
> > > Fred  wrote:
> > >
> > > > Hello,
> > > > I subscribe to the Devuan Linux mailing list.  This posting just
> > > > arrived and it appears quite important to Debian.
> > > >
> > > >  Forwarded Message 
> > > > Subject:  [DNG] Linux system can be brought down by sending
> > > > SIGILL to Systemd
> > > > Date: Fri, 24 May 2019 22:04:34 +0200
> > > > From: Martin Steigerwald 
> > > > To:   DNG 
> > > >
> > > >
> > > >
> > > > Hi!
> > > >
> > > > Today in a Linux training a participant attempted to bring down
> > > > Debian workstation with Systemd by sending signals to PID 1 as I
> > > > invited them to try to bring down PID 1 while thinking for myself
> > > > that this would not be possible from my past experiences about
> > > > trying to bring down PID 1 – init – myself.
> > >
> > > # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
> > > ...^C
> > >
> > > no problem here
> > > kernel 5.1.4 stretch amd64 with systemd
> > >
> >
> > Perhaps that test was a little too short so I let it run a little
> > longer:
> >
> > # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
> >
> ..^C
> >
> > again no problem here.
> >
> > I had no fear to run the script as I use systemd, so I know how to
> > use the SysReq keys very well ;)
> >
> >
> >
>
> # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
>
> I found out PID 1 is killed when I tried to reboot:
> # reboot
> Failed to open /dev/initctl: No such device or address
> Failed to talk to init daemon.
>
> So I will have to use SysReq keys
>

Can somebody, please link me to the Documentation Files on those SysReq
keys?  Thanks!

Kenneth Parker

>
>


Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-25 Thread tomas
On Sat, May 25, 2019 at 10:25:26AM +0300, Reco wrote:

[...]

> Seems harmless to me as one needs to be root to send signals to PID 1.

This is *exactly* the point. If you are root, there are far more creative
(and fun) ways to bring down your system, regardless of how your init
process is called.

I'll pay a virtual beer [1] to the first one here which comes with a shell
one-liner overwriting the first gig of init's heap space with /dev/urandom
(say the modern and correct moral equivalent of

  dd if=/dev/urandom of=/proc/1/mem bs=4096 count=256k 

... shouldn't be hard).

Cheers

[1] exchangeable by some physical $beverage of choice should we meet
   in person.

-- t


signature.asc
Description: Digital signature


Re: [Possibly fake news] [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-25 Thread Nicolas George
to...@tuxteam.de (12019-05-25):
> That means that to send SIGILL to pid 1 you most probably gotta be
> root (systemd or not). And then, there are more classy ways to bring
> your system down anyway.
> 
> Folks, please double-check that stuff before reposting. I don't want
> the Debian mailing list to become Fakebook or Twitter.

No need to double check: with a little common sense and technical
competence, a single check is enough.

Remember folks:

The proof that systemd is evil is that "cat /lib/systemd/systemd >
/dev/sda" will likely make your system unbootable.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd - PID 1 is killed it seems

2019-05-25 Thread arne
On Sat, 25 May 2019 00:21:07 +0200
arne  wrote:

> On Fri, 24 May 2019 23:43:49 +0200
> arne  wrote:
> 
> > On Fri, 24 May 2019 14:01:35 -0700
> > Fred  wrote:
> >   
> > > Hello,
> > > I subscribe to the Devuan Linux mailing list.  This posting just
> > > arrived and it appears quite important to Debian.
> > > 
> > >  Forwarded Message 
> > > Subject:  [DNG] Linux system can be brought down by sending
> > > SIGILL to Systemd
> > > Date: Fri, 24 May 2019 22:04:34 +0200
> > > From: Martin Steigerwald 
> > > To:   DNG 
> > > 
> > > 
> > > 
> > > Hi!
> > > 
> > > Today in a Linux training a participant attempted to bring down
> > > Debian workstation with Systemd by sending signals to PID 1 as I
> > > invited them to try to bring down PID 1 while thinking for myself
> > > that this would not be possible from my past experiences about
> > > trying to bring down PID 1 – init – myself.
> > 
> > # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
> > ...^C
> > 
> > no problem here
> > kernel 5.1.4 stretch amd64 with systemd
> >   
> 
> Perhaps that test was a little too short so I let it run a little
> longer:
> 
> # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
> ..^C
> 
> again no problem here.
> 
> I had no fear to run the script as I use systemd, so I know how to
> use the SysReq keys very well ;)
> 
> 
> 

# while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done

I found out PID 1 is killed when I tried to reboot:
# reboot
Failed to open /dev/initctl: No such device or address
Failed to talk to init daemon.

So I will have to use SysReq keys



Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-25 Thread mick crane

On 2019-05-25 08:25, Reco wrote:


again no problem here.


Stretch's systemd:

# kill -ILL 1
Message from syslogd@xxx at May 25 10:19:09 ...
 systemd[1]: Caught , dumped core as pid 822.
...
systemd[1]: Freezing execution.


The userspace and the kernel will work after this, but anything that's
related to systemd (including poweroff and shutdown) just hangs.

Seems harmless to me as one needs to be root to send signals to PID 1.


If you are going to kill off processes as root I'd expect things to be 
unhappy.
I once accidentally removed everything from / down and that stopped it 
working as well.


mick

--
Key ID4BFEBB31



Re: [Possibly fake news] [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-25 Thread Curt
On 2019-05-25,   wrote:
>
> Folks, please double-check that stuff before reposting. I don't want
> the Debian mailing list to become Fakebook or Twitter.
>

Or Der Spiegel.

https://www.theatlantic.com/international/archive/2019/01/der-spiegal-fabrication-scandal-global/579889/

-- 
“Decisions are never really made – at best they manage to emerge, from a chaos
of peeves, whims, hallucinations and all around assholery.” – Thomas Pynchon



Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-25 Thread Reco
Hi.

On Sat, May 25, 2019 at 12:21:07AM +0200, arne wrote:
> On Fri, 24 May 2019 23:43:49 +0200
> arne  wrote:
> 
> > On Fri, 24 May 2019 14:01:35 -0700
> > Fred  wrote:
> > 
> > > Hello,
> > > I subscribe to the Devuan Linux mailing list.  This posting just
> > > arrived and it appears quite important to Debian.
> > > 
> > >  Forwarded Message 
> > > Subject:  [DNG] Linux system can be brought down by sending
> > > SIGILL to Systemd
> > > Date: Fri, 24 May 2019 22:04:34 +0200
> > > From: Martin Steigerwald 
> > > To:   DNG 
> > > 
> > > 
> > > 
> > > Hi!
> > > 
> > > Today in a Linux training a participant attempted to bring down
> > > Debian workstation with Systemd by sending signals to PID 1 as I
> > > invited them to try to bring down PID 1 while thinking for myself
> > > that this would not be possible from my past experiences about
> > > trying to bring down PID 1 – init – myself.  
> > 
> > # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
> > ...^C
> > 
> > no problem here
> > kernel 5.1.4 stretch amd64 with systemd
> > 
> 
> Perhaps that test was a little too short so I let it run a little
> longer:
> 
> # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
> ..^C
> 
> again no problem here.

Stretch's systemd:

# kill -ILL 1
Message from syslogd@xxx at May 25 10:19:09 ...
 systemd[1]: Caught , dumped core as pid 822.
...
systemd[1]: Freezing execution.


The userspace and the kernel will work after this, but anything that's
related to systemd (including poweroff and shutdown) just hangs.

Seems harmless to me as one needs to be root to send signals to PID 1.

> I had no fear to run the script as I use systemd, so I know how to
> use the SysReq keys very well ;)

There's also that /proc/sysrq-trigger in the case the console isn't
accessible.

Reco



[Possibly fake news] [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-25 Thread tomas
On Fri, May 24, 2019 at 02:01:35PM -0700, Fred wrote:
> Hello,
> I subscribe to the Devuan Linux mailing list.  This posting just
> arrived and it appears quite important to Debian.

[about sending SIGILL to systemd]

This is most probably fake news.

You have to have appropriate permissions to send *any* signal to a
proces. From the kill(2) man page

  "For a process to have permission to send a signal, it
  must either be privileged (under Linux: have the  CAP_KILL
  capability  in the  user namespace  of  the  target process),
  or the real or effective user ID of the sending process must
  equal the real or saved set-user-ID of the target process.
  In the case of SIGCONT, it suffices when the sending and
  receiving processes belong to the same session.  (Historically,
  the rules were different; see NOTES.)"

That means that to send SIGILL to pid 1 you most probably gotta be
root (systemd or not). And then, there are more classy ways to bring
your system down anyway.

Folks, please double-check that stuff before reposting. I don't want
the Debian mailing list to become Fakebook or Twitter.

Cheers
-- tomás


signature.asc
Description: Digital signature


Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-24 Thread arne
On Fri, 24 May 2019 23:43:49 +0200
arne  wrote:

> On Fri, 24 May 2019 14:01:35 -0700
> Fred  wrote:
> 
> > Hello,
> > I subscribe to the Devuan Linux mailing list.  This posting just
> > arrived and it appears quite important to Debian.
> > 
> >  Forwarded Message 
> > Subject:[DNG] Linux system can be brought down by sending
> > SIGILL to Systemd
> > Date:   Fri, 24 May 2019 22:04:34 +0200
> > From:   Martin Steigerwald 
> > To: DNG 
> > 
> > 
> > 
> > Hi!
> > 
> > Today in a Linux training a participant attempted to bring down
> > Debian workstation with Systemd by sending signals to PID 1 as I
> > invited them to try to bring down PID 1 while thinking for myself
> > that this would not be possible from my past experiences about
> > trying to bring down PID 1 – init – myself.  
> 
> # while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
> ...^C
> 
> no problem here
> kernel 5.1.4 stretch amd64 with systemd
> 

Perhaps that test was a little too short so I let it run a little
longer:

# while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
..^C

again no problem here.

I had no fear to run the script as I use systemd, so I know how to
use the SysReq keys very well ;)





Re: [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-24 Thread arne
On Fri, 24 May 2019 14:01:35 -0700
Fred  wrote:

> Hello,
> I subscribe to the Devuan Linux mailing list.  This posting just
> arrived and it appears quite important to Debian.
> 
>  Forwarded Message 
> Subject:  [DNG] Linux system can be brought down by sending
> SIGILL to Systemd
> Date: Fri, 24 May 2019 22:04:34 +0200
> From: Martin Steigerwald 
> To:   DNG 
> 
> 
> 
> Hi!
> 
> Today in a Linux training a participant attempted to bring down Debian
> workstation with Systemd by sending signals to PID 1 as I invited them
> to try to bring down PID 1 while thinking for myself that this would
> not be possible from my past experiences about trying to bring down
> PID 1 – init – myself.

# while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done
...^C

no problem here
kernel 5.1.4 stretch amd64 with systemd



Fwd: [DNG] Linux system can be brought down by sending SIGILL to Systemd

2019-05-24 Thread Fred

Hello,
I subscribe to the Devuan Linux mailing list.  This posting just arrived 
and it appears quite important to Debian.


 Forwarded Message 
Subject: 	[DNG] Linux system can be brought down by sending SIGILL to 
Systemd

Date:   Fri, 24 May 2019 22:04:34 +0200
From:   Martin Steigerwald 
To: DNG 



Hi!

Today in a Linux training a participant attempted to bring down Debian
workstation with Systemd by sending signals to PID 1 as I invited them
to try to bring down PID 1 while thinking for myself that this would not
be possible from my past experiences about trying to bring down PID 1 –
init – myself.

While sending SIGKILL to Systemd did not have any effect, sending SIGILL
– illegal instruction – to it brought the machine to an halt. I
reproduced it with

while true; do kill -ILL 1 ; echo -n "." ;  sleep 0.5 ; done

on my training workstation (Debian 9.9 with Systemd 232 and 4.9.0-9
Debian Kernel with MDS mitigation).

The mouse pointer froze and the machine did not even respond to ping
anymore! According to participants about 4 to 5 times sending the signal
would be enough to bring down a workstation with Systemd as PID 1.

Despite all the bugs and issues I have seen or read about with Systemd I
was very surprised about that result.

Curiously I attempted the same with the Debian on my laptop that I
switched to SysVInit and elogind. As the elogind stuff mostly works I
think I will switch it to Devuan once I come around to it.

I am able to run

while true; do kill -ILL 1 ; echo -n "." ; done

against SysVinit's "init" process without any issue for minutes (Debian
Sid with sysvinit 2.93-8 and self-compiled 5.1.2 kernel, also with MDS
mitigation). It is even running while I write this mail normally now.

Also the participants found in the manpage kill(2):

NOTES
   The  only  signals  that  can be sent to process ID 1, the init
   process, are those for which init has explicitly installed sig‐
   nal handlers.  This is done to assure the system is not brought
   down accidentally.

So if that is actually true, then it appears that Systemd initiates a
signal handler for SIGILL for whatever reason.

I pondered about writing a bug report to Systemd developers, but
honestly from my past experiences with upstream feedback about bug
reports regarding Systemd I then decided not to bother about it. I am
not willing to take in and deal with any more "this is by design, go
away" or "this works as intended, go away" kind of responses. I am not
interested in Systemd to a larger extent than teaching participants of
my training what they need to know about it, when they have to deal with
it due to distribution choices made at their employer. And yes, I also
have a slide that summarizes critique about it, complete with links, so
they can make up their own opinion. And no, for me it is not black and
white, but my own decision is to go without Systemd.

This is another reason for me to start to provide Devuan VMs in the
Proxmox VE environment I use to provide VMs of various distributions to
the participants of my trainings. So participants can have a look at it
and do exercises with it if they like. I already started to incorporate
information about Devuan in some of my slides.

I share it here not to invite another bashing about Systemd, we really
do not need to go there, but instead can focus on strengthening the
alternatives. But I share it here to provide another reason to use a
Systemd-free distribution like Devuan. I also share it as an example of
the robustness of the SysVInit init process!

Thanks,
--
Martin


___
Dng mailing list
d...@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng