Messages in this thread | | | Date | Tue, 19 May 2015 10:18:51 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: [PATCH 15/19] x86, mpx: do 32-bit-only cmpxchg for 32-bit apps |
| |
On Mon, 18 May 2015, Dave Hansen wrote: > From: Dave Hansen <dave.hansen@linux.intel.com> > > user_atomic_cmpxchg_inatomic() actually looks at sizeof(*ptr) to > figure out how many bytes to copy. If we run it on a 64-bit > kernel with a 64-bit pointer, it will copy a 64-bit bounds > directory entry. That's fine, except when we have 32-bit > programs with 32-bit bounds directory entries and we only *want* > 32-bits. > > This patch breaks the cmpxchg operation out in to its own > function and performs the 32-bit type swizzling in there. > > Note, the "64-bit" version of this code _would_ work on a > 32-bit-only kernel. The issue this patch addresses is only for > when the kernel's 'long' is mismatched from the size of the > bounds directory entry of the process we are working on. > > The new helper modifies 'actual_old_val' or returns an error. > But gcc doesn't know this, so it warns about 'actual_old_val' > being unused. Shut it up with an uninitialized_var(). > > Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
| |