[PATCH 1/3] util: change type of struct xlat.val to uint64_t

Dmitry V. Levin ldv at altlinux.org
Thu Mar 31 02:54:47 UTC 2016


On Wed, Mar 30, 2016 at 10:47:49PM -0400, Jeff Mahoney wrote:
> On 3/30/16 9:48 PM, Dmitry V. Levin wrote:
> > On Wed, Mar 30, 2016 at 09:19:25PM -0400, Jeff Mahoney wrote:
> >> Some ioctls have flags fields that are 64-bit.  A 32-bit val means
> >> these flags will never be matched or printed.
[...]
> > There is a potential sign extension bug in every place where a signed int
> > is passed to any function "upgraded" from int/unsigned int to uint64_t.
> 
> > Have you checked all these places?
> 
> No, I didn't. You're right, this could be a problem.  How about instead:
> 
> struct xlat.val is uint64_t.
> Introduce *64 routines to handle those cases.
> Change the signed int argument to unsigned for the existing prototypes.
> Turn those routines into wrappers for the *64 versions so that no
> unexpected signed extension happens.

Yes, this should be OK.


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


More information about the Strace-devel mailing list