[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180905090925.474dugeix3ssykcz@mwanda>
Date: Wed, 5 Sep 2018 12:09:25 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Martijn Coenen <maco@...roid.com>
Cc: gregkh@...uxfoundation.org, tkjos@...gle.com, arve@...roid.com,
amit.pundir@...aro.org, devel@...verdev.osuosl.org,
smoreland@...gle.com, linux-kernel@...r.kernel.org,
robenea@...gle.com, maco@...gle.com, john.stultz@...aro.org,
peskal@...gle.com
Subject: Re: [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
Powered by blists - more mailing lists