[PATCH] libio: use PTR_MANGLE/PTR_DEMANGLE for FILE vtables

Mike Frysinger vapier@gentoo.org
Thu Aug 13 03:34:00 GMT 2015


On 12 Aug 2015 17:56, Kees Cook wrote:
> This is a resend (from 2011!) of my PTR_MANGLE series for the FILE vtable.
> It was previously discussed here: http://sourceware-org.1504.n7.nabble.com/PATCH-libio-use-PTR-MANGLE-PTR-DEMANGLE-for-FILE-vtables-td12300.html

nabble sucks ;)
https://sourceware.org/ml/libc-alpha/2011-12/msg00073.html

> +static inline void
> +__mangle_vtable(const struct _IO_jump_t **vtable, const struct _IO_jump_t *table)
> +{
> +    struct _IO_jump_t *ptr;
> +    ptr = (struct _IO_jump_t *)table;
> +    PTR_MANGLE(ptr);
> +    *vtable = ptr;
> +}

this doesn't match GNU style -- there should be spaces before the (

also you can merge the first two statements

> +  __mangle_vtable(&_IO_JUMPS_RAW(THIS), (TABLE))

some more code where there should be a space before the ( ... i'll stop checking 
for that now ;)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150813/b90be01a/attachment.sig>


More information about the Libc-alpha mailing list