News for hackers. Stuff that matters.
Re:Best of show – abuse of libc by saagarjha on Friday January 08, 2021 @07:51PM (#25693740)
Someone should inform The Open Group about this violation of POSIX ;)

Another fun fact: glibc does this too, if you compile with -D_FORTIFY_SOURCE=2. However, since Linux lacks the nice vm_region APIs the code opens up /proc/self/maps :/

Re:Best of show – abuse of libc by astrange on Friday January 08, 2021 @08:25PM (#25694593)
dyld on Darwin has an API to ask if any pointer is to a read-only section of a binary. It’s useful because you can e.g. skip strcpys and other allocations.
Re:Best of show – abuse of libc by saagarjha on Saturday January 09, 2021 @05:51AM (#25699315)
Hmm, can you tell me more? I can't think of any situation where skipping on a strcpy is legal, since you provide the second buffer and so the copy must occur. And I know that there is heavy uniquing going on for things like selectors and CFStrings at compile time, but where is the dyld API being used at runtime?
Re:Best of show – abuse of libc by astrange on Saturday January 09, 2021 @04:38PM (#25705054)
Oh, I meant strdup. Look for stdupIfMutable() calls in libobjc.
Re:Best of show – abuse of libc by pjmlp on Saturday January 09, 2021 @04:49AM (#25699011)
That is the beauty of POSIX, write once, debug everywhere, fix with plenty of spaghetti #ifdefs.