binder.h ioctls

Dmitry V. Levin ldv at altlinux.org
Thu Mar 5 18:19:42 UTC 2015


On Wed, Mar 04, 2015 at 08:31:13AM +0100, Gabriel Laskar wrote:
> On Wed, 4 Mar 2015 02:44:19 +0300, Dmitry V. Levin wrote:
> > On Tue, Mar 03, 2015 at 07:23:28PM +0100, Gabriel Laskar wrote:
> > > There is still an issue with ioctl request names when using strace
> > > on Binder calls. Some binder calls have 2 possible sizes, depending
> > > of being with the 32-bit api or the 64-bit one.
> > > 
> > > In <linux/android/binder.h>, there is a #ifdef BINDER_IPC_32BIT that
> > > control the size of pointer values in the structures.
> > > 
> > > In 64bit mode, we have only :
> > > 
> > > ioctl(-1, BC_REQUEST_DEATH_NOTIFICATION, 0);
> > > ioctl(-1, BC_CLEAR_DEATH_NOTIFICATION, 0);
> > > 
> > > that respond :
> > > 
> > > ioctl(-1, _IOC(_IOC_WRITE, 0x63, 0x0e, 0x10), 0) = -1 EBADF (Bad
> > > file descriptor) ioctl(-1, _IOC(_IOC_WRITE, 0x63, 0x0f, 0x10), 0) =
> > > -1 EBADF (Bad file descriptor)
> > > 
> > > and when asking for 32bit binder (BINDER_IPC_32BIT), lots of ioctls
> > > are failing :
> > 
> > Unfortunately, <linux/android/binder.h> doesn't say which of binder
> > ioctls are BINDER_IPC_32BIT.  How could one automatically distinguish
> > them?
> 
> For BC_REQUEST_DEATH_NOTIFICATION and BC_CLEAR_DEATH_NOTIFICATION, it
> is just that the ioctl is defined on 2 lines.
> 
> As for which binder ioctl are configured by BINDER_IPC_32BIT, it is all
> the ioctl that take an argument that depend on it, so:

Looks like the kernel module can be compiled either with or without
BINDER_IPC_32BIT defined, and the only way to tell what is the case is to
actually issue an ioctl command.  This means that both sets of binder
ioctl commands (with and without BINDER_IPC_32BIT defined) are equally
valid, but strace currently includes only one of them (without
BINDER_IPC_32BIT defined).

If this is the case, then we have two problems with binder ioctls:
- how to generate both sets automatically;
- how to give them distinguishable names.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20150305/bf4b6d09/attachment.bin>


More information about the Strace-devel mailing list