[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAB0TPYGfs0g0eDPS7+BY+waK7XoAWi-cYCBVfXfV+w_8TSApgw@mail.gmail.com>
Date: Wed, 5 Sep 2018 13:30:01 +0200
From: Martijn Coenen <maco@...roid.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Greg KH <gregkh@...uxfoundation.org>, Todd Kjos <tkjos@...gle.com>,
Arve Hjønnevåg <arve@...roid.com>,
Amit Pundir <amit.pundir@...aro.org>,
"open list:ANDROID DRIVERS" <devel@...verdev.osuosl.org>,
Steven Moreland <smoreland@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
Robert Benea <robenea@...gle.com>,
Martijn Coenen <maco@...gle.com>,
John Stultz <john.stultz@...aro.org>, peskal@...gle.com
Subject: Re: [PATCH] ANDROID: binder: Add BINDER_GET_NODE_INFO_FOR_REF ioctl.
On Wed, Sep 5, 2018 at 11:09 AM, Dan Carpenter <dan.carpenter@...cle.com> wrote:
> What's the reserved for? On 64 bit systems there is a 4 byte struct
> hole between weak_count and reserved.
There's many more pieces of information that we hold for a node. While
we don't have a use for most of that now, we may want some of it in
the future, and so I thought it would be wise to reserve some space
here so we don't need a new ioctl when that happens. I'm actually not
sure it's common to do things this way.
> Why not just make reserved a
> __u32 and get rid of the hole? (Not rhetorical, I have no idea).
Because I thought 8 bytes of reserved space would be nice :-) But you
have a good point re:alignment, I should make it two __u32's then.
>
> 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.
That's a good point, I will change the code to check for that.
Thanks,
Martijn
>
> regards,
> dan carpenter
>
Powered by blists - more mailing lists