CAN-2005-2490: When we copy 32bit ->msg_control contents to kernel, we walk the same userland data twice without sanity checks on the second pass. Moreover, if original looks small enough, we end up copying to on-stack array. Moreover, if original looks small enough, we end up copying to on-stack array. With a blocking kmalloc() in between and copying from userland all along. Take two threads, have one do sendmsg() and another - to tweak memory under it. So therefore could lead to privilege escalation.
Created attachment 67332 [details, diff] can-2005-2490-2.4.patch
Created attachment 67333 [details, diff] can-2005-2490-2.6.patch
Created attachment 67666 [details, diff] can-2005-2490-fixed-2.4.patch RH reports: portmap broke on ppc64. This turned out to be an issue on 64bit arches running 32bit-compat-mode exes doing sendmsg() syscalls with unaligned CMSG data areas).
Created attachment 67667 [details, diff] can-2005-2490-fixed-2.6.patch
Created attachment 67688 [details, diff] can-2005-2490-e-2.4.patch Updated again.
Fixed in 2.6.13.1
All fixed, closing bug.