Live data from Hacker News

I think I found a Mac kernel bug (2018)

jvns.ca

31–40 of 71 posts

Re: I think I found a Mac kernel bug (2018)

#31

It's surprisingly easy to stumble into crash bugs when playing around with processes. I remember a decade or two ago I ran into a linux bug where the kernel would panic if a process was killed with an open descriptor on its /proc entries. That is: open /proc/$pid/something; kill -9 $pid #kernel crash We unfortunately discovered this when using fuser in a runscript to kill stale versions of a process, eg: sudo fuser -…

It was also unsurprisingly easy to crash a kernel a decade or two ago.

Re: I think I found a Mac kernel bug (2018)

#33
post #30

Earlier quoted context omitted.

In 2017, I wrote: Over the years, I have found numerous four different bugs in Apple's Calculator app. Here is today's wtf. Switch calculator to Scientific mode (⌘-2). Type: 1, 0, ^, 2, 0, enter, command-c (to copy), command-v (to paste) Expected result: an amount in $$$ I wouldn't mind having. Actual result: smallest number to appear 6 times in Pascal's triangle I reported all four and they never acknowledged any of…

> smallest number to appear 6 times in Pascal's triangle You mean exacty 6 times or at least 6 times?

Exactly 6 times. What's happening is if the result is 1e, a roundtrip to the clipboard results in 1. I.e. 1e20 becomes 120.

Re: I think I found a Mac kernel bug (2018)

#34
post #27
post #15

In the long dark ago there was a program called 'crashme' which would generate and run random code from user space to see if it could cause kernel panics.

https://people.delphiforums.com/gjc/crashme.html

I presume there's a low yet non-zero chance this inadvertently messes up something on the FS?

Re: I think I found a Mac kernel bug (2018)

#36
post #6

Coincidentally, I also stumbled upon a way to make the kernel of Apple Silicon Macs panic and restart while developing the https://lowtechguys.com website. I distilled the problem in a repo so it can be reproduced with a single command: https://github.com/alin23/m1-panic I found it while on Monterey and reported it 2 times through Feedback Assistant, but it still happens on Ventura. NOTE: Don't try it without saving…

Might have been better to report it to the security people. This sort of thing can be exploitable.

They did report it to Apple, multiple times:

> I found it while on Monterey and reported it 2 times through Feedback Assistant, but it still happens on Ventura.

Re: I think I found a Mac kernel bug (2018)

#37

It's very easy to freeze a system as a non-root user; cause too many interrupts, consume too many resources, etc. Many kinds of infinite loop will lock a system hard. Hell, you can crash systems with too many packets . And it's very easy to cause ps to hang. Many different kernel syscalls hang / are blocking. Mostly you see this with kernel features dependent on a resource that doesn't resolve itself, like a stuck di…

While what you say is true, these are nonetheless kernel bugs.

The kernel should never let any user process consume so many resources as to cause a system freeze.

The kernel must not only be able to preempt any user process at any time, stopping it to consume all CPU time, but it must also prevent any user process to completely fill a SSD or HDD, because that can prevent many programs from starting.

Re: I think I found a Mac kernel bug (2018)

#38

Earlier quoted context omitted.

Might have been better to report it to the security people. This sort of thing can be exploitable.

They did report it to Apple, multiple times: > I found it while on Monterey and reported it 2 times through Feedback Assistant, but it still happens on Ventura.

[deleted]

Re: I think I found a Mac kernel bug (2018)

#39
post #6

Coincidentally, I also stumbled upon a way to make the kernel of Apple Silicon Macs panic and restart while developing the https://lowtechguys.com website. I distilled the problem in a repo so it can be reproduced with a single command: https://github.com/alin23/m1-panic I found it while on Monterey and reported it 2 times through Feedback Assistant, but it still happens on Ventura. NOTE: Don't try it without saving…

Might have been better to report it to the security people. This sort of thing can be exploitable.

It’s a null deref.

Re: I think I found a Mac kernel bug (2018)

#40
post #7
post #6

Coincidentally, I also stumbled upon a way to make the kernel of Apple Silicon Macs panic and restart while developing the https://lowtechguys.com website. I distilled the problem in a repo so it can be reproduced with a single command: https://github.com/alin23/m1-panic I found it while on Monterey and reported it 2 times through Feedback Assistant, but it still happens on Ventura. NOTE: Don't try it without saving…

Do you know what the underlying problematic instruction sequence is? Or the precise location where it halts?

ldr x9, [x8, #0x18]!
Post reply on HN