[CRIU] [PATCH] compel: Do not loose sign of result in compat syscall

Cyrill Gorcunov gorcunov at gmail.com
Tue Oct 31 15:33:30 MSK 2017


On Tue, Oct 31, 2017 at 12:08:11PM +0000, Dmitry Safonov wrote:
> >
> > Not exactly. We could generate a mask from it but I think it's not that required,
> > at least by now.
> 
> Wait, I kind of don't get it:
> How map can be > 4 bytes if you get it from (user_regs_struct32::ax), which is
> 4 bytes (u32) for compat tasks?
> We may insert BUG_ON(map & 0xffffffff00000000) or something.

Because we convert uint -> int -> long, and the sing of int get
propagated to upper bits. The map can't be more than 4 bytes but
we use signed long to keep the result.


More information about the CRIU mailing list