lkml.org 
[lkml]   [2018]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ANDROID: binder: Add BINDER_GET_NODE_INFO_FOR_REF ioctl.
On Wed, Sep 05, 2018 at 09:33:46AM +0200, Martijn Coenen wrote:
> diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h
> index bfaec6903b8bc..a54a680ff2936 100644
> --- a/include/uapi/linux/android/binder.h
> +++ b/include/uapi/linux/android/binder.h
> @@ -200,6 +200,13 @@ struct binder_node_debug_info {
> __u32 has_weak_ref;
> };
>
> +struct binder_node_info_for_ref {
> + __u32 handle;
> + __u32 strong_count;
> + __u32 weak_count;
> + __u64 reserved;
> +};

What's the reserved for? On 64 bit systems there is a 4 byte struct
hole between weak_count and reserved. Why not just make reserved a
__u32 and get rid of the hole? (Not rhetorical, I have no idea).

Btw, people sometimes complain about that we don't check that user input
is zeroed in ioctls. Like for example maybe they're passing random data
in the the strong_count field and then later we decide that actually
that field should mean something but we can't make it mean anything
because we've been letting the user put whatever they want there. These
are just random thoughts in my head, not necessarily important.

regards,
dan carpenter

\
 
 \ /
  Last update: 2018-09-05 11:10    [W:0.062 / U:4.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site