potential security issue on 64bit systems with socket calls?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While running SCTP tests on 2.6.13-rc5 with x86_64 and ppc64 based platforms, I have noticed a problem that may be a potential security issue. The SCTP test suite attempt to test invalid flag by sending down a -1 in the flag field for calls such as sendmsg() and recvmsg(). With the CONFIG_COMPAT flag turned on, MSG_CMSG_COMPAT is set at 0x80000000 for socket flags. Even though the test app is compiled as 64bit, the invalid flag -1 becomes f's and thus MSG_CMSG_COMPAT flag is passed through to the kernel and all paths that MSG_CMSG_COMPAT are checked are invoked. In this case in sendmsg() verify_compat_iovec() was called instead of verify_iovec and the 64bit user addr has its top 32bits chopped off and sent to the copy_from_user() call and at times triggers -EFAULT due to invalid user addr, or copy junk probably if the user addr happens to be valid..... Is there any chance malicious code can cause problems by exploiting this?

Should the kernel intercept the flags field at the point where it knows whether it's invoking a 32bit call or 64bit and strip the flag if it shouldn't be there to prevent something like this?

Please cc me on replies. Thx!

--
Dave

------------------------------------------------------
Dave Jiang
Software Engineer          Phone: (480) 517-0372
MontaVista Software, Inc.    Fax: (480) 517-0262
2141 E Broadway Rd, St 108   Web: www.mvista.com
Tempe, AZ  85282          mailto:djiang@xxxxxxxxxx
------------------------------------------------------

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux