svn commit: r283364 - head/sys/sys

Alexander V. Chernikov melifaro at FreeBSD.org
Sun May 24 11:24:15 UTC 2015


Author: melifaro
Date: Sun May 24 11:24:14 2015
New Revision: 283364
URL: https://svnweb.freebsd.org/changeset/base/283364

Log:
  Fix SIOCGI2C structure requirement.
  
  In reality, SIOCGI2C ioctl requires struct ifreq as many other
  ioctls. Doing copyin() on (significantly) larger struct ifstat sometimes
  triggered EFAULT.
  
  Reported by:	Olivier Cochard-Labbé <olivier at cochard.me>
  MFC after:	1 week

Modified:
  head/sys/sys/sockio.h

Modified: head/sys/sys/sockio.h
==============================================================================
--- head/sys/sys/sockio.h	Sun May 24 11:08:06 2015	(r283363)
+++ head/sys/sys/sockio.h	Sun May 24 11:24:14 2015	(r283364)
@@ -96,7 +96,7 @@
 
 #define	SIOCGIFSTATUS	_IOWR('i', 59, struct ifstat)	/* get IF status */
 #define	SIOCSIFLLADDR	 _IOW('i', 60, struct ifreq)	/* set linklevel addr */
-#define	SIOCGI2C	_IOWR('i', 61, struct ifstat)	/* get I2C data  */
+#define	SIOCGI2C	_IOWR('i', 61, struct ifreq)	/* get I2C data  */
 
 #define	SIOCSIFPHYADDR	 _IOW('i', 70, struct ifaliasreq) /* set gif addres */
 #define	SIOCGIFPSRCADDR	_IOWR('i', 71, struct ifreq)	/* get gif psrc addr */


More information about the svn-src-all mailing list