Subject: [alpine-devel] Re: openrc crashes

From: Phil Hofer <[email-masked]>
Date: Sun, 30 Dec 2018 01:46:28 +0000

Steffen,

I ran into some crashes in openrc recently as well.
(Once I ran my reproducer in gdb, I saw that openrc was tripping
the stack-smashing protector.)

I went through the source and made some reliability fixes,
which have now been committed upstream:

846e46 -- fix 4 out-of-bounds reads
084877 -- fix stack buffer overrun (my issue)
a9fc26 -- fix NULL dereference

Try building the latest version of openrc and see
if your issues persist. (You'll have to take some patches
from aports in order for it to build cleanly, or you
can build from my aports tree:
https://github.com/philhofer/aports/tree/master/main/openrc)

If you're able to reproduce a crash locally, run the
reproducer under gdb and see if you can at least grab
a stack trace. Building with some hardening options turned
on will help crash the program closer to the memory corruption.

- Phil

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Mon, 31 Dec 2018 19:11:15 +0100

Hello Phil.

Phil Hofer wrote in <F9zS9AxnlZczhqhPenmGcQsk5Kbp-FOF-1hFiyUW2Phwc4FbTe-\
mtNPr9KVaC8LBT2AochKodG2j5RxEO14BJAmrjxe6jR5nNcQ6FkMc__U=@sunfi.sh>:
 |I ran into some crashes in openrc recently as well.
 |(Once I ran my reproducer in gdb, I saw that openrc was tripping
 |the stack-smashing protector.)
 |
 |I went through the source and made some reliability fixes,
 |which have now been committed upstream:
 |
 |846e46 -- fix 4 out-of-bounds reads
 |084877 -- fix stack buffer overrun (my issue)
 |a9fc26 -- fix NULL dereference

I see.  Good to know someone cared for crashes there!

 |Try building the latest version of openrc and see
 |if your issues persist. (You'll have to take some patches
 |from aports in order for it to build cleanly, or you
 |can build from my aports tree:
 |https://github.com/philhofer/aports/tree/master/main/openrc)
 |
 |If you're able to reproduce a crash locally, run the
 |reproducer under gdb and see if you can at least grab
 |a stack trace. Building with some hardening options turned
 |on will help crash the program closer to the memory corruption.

Oh! Oh!  Here i have to disappoint you, i am afraid: i will wait
for binary updates to sail in.  The pain is not large enough
(especially now that i have a workaround for next time), and
i truly hate debuggers from the deepest corner of my heart!  I do
not have one, and i do not know how to use them.  (That is, maybe
a dozen times, but not that much more in my life, break+stepi?
Insufficient knowledge!)
But i will be happy once it comes in!

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Thu, 03 Jan 2019 21:38:14 +0100

Steffen Nurpmeso wrote in <[email-masked]>:
 |Phil Hofer wrote in <F9zS9AxnlZczhqhPenmGcQsk5Kbp-FOF-1hFiyUW2Phwc4FbTe-\
 |mtNPr9KVaC8LBT2AochKodG2j5RxEO14BJAmrjxe6jR5nNcQ6FkMc__U=@sunfi.sh>:
 ||I ran into some crashes in openrc recently as well.
 ||(Once I ran my reproducer in gdb, I saw that openrc was tripping
 ||the stack-smashing protector.)
 ||
 ||I went through the source and made some reliability fixes,
 ||which have now been committed upstream:
 ||
 ||846e46 -- fix 4 out-of-bounds reads
 ||084877 -- fix stack buffer overrun (my issue)
 ||a9fc26 -- fix NULL dereference
 |
 |I see.  Good to know someone cared for crashes there!
 |
 ||Try building the latest version of openrc and see
 ||if your issues persist. (You'll have to take some patches

I have not done that, but as it happened again today after
i manually have changed the runlevel, i saw that OpenRC seems to
falsely unroll the hierarchy, at least from looking at the
messages!

I have default->net->wlan->wlan-up, the latter only with ntp
running, and once i switched from wlan-up->default, all services
from wlan where shut down before the ntp of wlan-up.
I do not know how this could cause the problems, but the
behaviour seems very wrong to me.
What do you think, should i open an AlpineLinux bug??
(I have not github account, which is why i am asking.)

Ciao, Phil,

--steffen
|

---