[flagged]
Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
21–30 of 47 posts
Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#22- int new_value = *(int *)oidp->oid_arg1; + int new_value = *(uint16_t *)oidp->oid_arg1; Why not just have `uint16_t new_value = ...`? Ahh, because `new_value` is being given to `sysctl_handle_int(..., &new_value, ...);` which of course expects an `int`. So then it begs the question: if the value is really a `uint16_t`, then why is it being handled through a plain `int`? It smells like there could easily be tons of o…
Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#23Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#24- int new_value = *(int *)oidp->oid_arg1; + int new_value = *(uint16_t *)oidp->oid_arg1; Why not just have `uint16_t new_value = ...`? Ahh, because `new_value` is being given to `sysctl_handle_int(..., &new_value, ...);` which of course expects an `int`. So then it begs the question: if the value is really a `uint16_t`, then why is it being handled through a plain `int`? It smells like there could easily be tons of o…
Well there's the so-called usual arithmetic conversions that will basically convert every uint16_t to an unsigned int. The C and C++ languages do a silent conversion on your back anyways so you might as well make it explicit.
Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#25Earlier quoted context omitted.
Well there's the so-called usual arithmetic conversions that will basically convert every uint16_t to an unsigned int. The C and C++ languages do a silent conversion on your back anyways so you might as well make it explicit.
A well-configured C++ compiler will error-out on such a silent conversion.
Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#26Did you get a bounty payout for this? I got the impression that Apple wasn't particularly on the ball with those.
Is it even exploitable in the real world? Correct me if I'm wrong but you get 2 bytes of kernel data (potentially blank padding) and the same two bytes each time?
Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#27- int new_value = *(int *)oidp->oid_arg1; + int new_value = *(uint16_t *)oidp->oid_arg1; Why not just have `uint16_t new_value = ...`? Ahh, because `new_value` is being given to `sysctl_handle_int(..., &new_value, ...);` which of course expects an `int`. So then it begs the question: if the value is really a `uint16_t`, then why is it being handled through a plain `int`? It smells like there could easily be tons of o…
> So then it begs the question: if the value is really a `uint16_t`, then why is it being handled through a plain `int`? I don't think it begs the question, but it does raise one!
The phrase can be confusing because of its overloaded definitions, so it's best to avoid it. But if you understood what someone meant when they used it, then... you understood it's meaning.
Remember to treat the study of language descriptively rather than prescriptively!
Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#28Seems like something to be integration tested in the future. Honestly surprised this slipped through.
Another problem is writing good automated tests is hard and often skipped. Lots of software engineering teams talk about the wonders of automated tests. Unfortunately, many automated tests are not very good and either do not ensure the major functionality works or just do not test some of the code. There are also limits to how much time a software engineer has to test. No one can test everything.
Basically, I am not surprised developers make mistakes and I am not surprised the tests either did not catch this mistake or even did not exist. Software is very hard and software engineers are far from perfect.
Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#29Leaking two random bytes and in some cases just padding bytes to user space is not the end of the world and I don't get why there are so many negative comments blaming Apple for not handing out a handsome bounty for this bug.
Re: Susctl CVE-2024-54507: A particularly 'sus' sysctl in the XNU kernel
#30- int new_value = *(int *)oidp->oid_arg1; + int new_value = *(uint16_t *)oidp->oid_arg1; Why not just have `uint16_t new_value = ...`? Ahh, because `new_value` is being given to `sysctl_handle_int(..., &new_value, ...);` which of course expects an `int`. So then it begs the question: if the value is really a `uint16_t`, then why is it being handled through a plain `int`? It smells like there could easily be tons of o…
Well there's the so-called usual arithmetic conversions that will basically convert every uint16_t to an unsigned int. The C and C++ languages do a silent conversion on your back anyways so you might as well make it explicit.