Re: [PATCH v1 9/9] staging: android: binder: Add binder compatlayer

From: One Thousand Gnomes
Date: Wed Dec 04 2013 - 19:36:21 EST


> None of this (the patch series or the original code) is mine. My

Sorry mistraced the attribution sequence

> question was more of a general one on designing ioctls, as well as
> concerns with changing the existing 32-bit api.

I think in general my advice would be:

If its already been screwed up
- sort the structures out for the 64bit version
- make the 32bit version and compat ones clean copies of what they are now
- don't try and pull stunts with alignof and other such tricks because
- some poor bugger will have to debug it one day (and it might be
you some years after you forget how it worked)
- most of our security holes show up in complex data parsing paths
- figure out whether its better to do compat fixups or just have 64bit use
new structures and new ioctl numbers with the 32bit ones working but
with 32bit offsets regardless of 32/64bit CPU mode.


and for new stuff
- design for 64bit safety in advance
- watch the padding rules and user alignment
- consider leaving some spare zero space on the end of the structs

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/