[DTrace-devel] [PATCH v3 13/19] alloca: support null pointers

Nick Alcock nick.alcock at oracle.com
Tue Mar 29 13:51:38 UTC 2022


On 29 Mar 2022, Nick Alcock via DTrace-devel stated:

> In conclusion: our error checking of copies lies somewhere between
> nonexistent and worse than that (in that errors lead to outright wrong
> results).

Honestly, when I wrote the alloca code I assumed this was *intentional*:
that we were trying to do all range checks ourselves and this is why we
were doing explicit notnull checks, etc: so we could raise appropriate
faults from the C codegen layer, rather than trying to do it in the
piles of asm which constitute things like the string handling.

But... if it isn't, I'm honestly not sure what the point of the notnull
checking even is. I guess it lets us explicitly satisfy language rules
that various inputs must not be NULL, while letting the BPF helpers do
checks that are harder like "not NULL but also not valid". Not that I
know why that distinction matters, given that both cases should yield
the same result, a BADADDR fault. (Not that they are right now, but
that's presumably a plain old bug which I should try to fix.)



More information about the DTrace-devel mailing list