[kernel] r15770 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Wed May 26 03:43:55 UTC 2010


Author: benh
Date: Wed May 26 03:43:45 2010
New Revision: 15770

Log:
net: sysfs: Check for null ethtool_ops before getting speed/duplex

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/net-sysfs-ethtool_ops-can-be-NULL.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/14

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Wed May 26 02:01:41 2010	(r15769)
+++ dists/sid/linux-2.6/debian/changelog	Wed May 26 03:43:45 2010	(r15770)
@@ -20,6 +20,7 @@
     (Closes: #583162)
   * [amd64] ext4: Fix compat EXT4_IOC_ADD_GROUP (used by online resize)
   * Install debug kernel image in /usr/lib/debug/boot (Closes: #582810)
+  * net: sysfs: Check for null ethtool_ops before getting speed/duplex
 
   [ Bastian Blank ]
   * Update Xen patch.

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/net-sysfs-ethtool_ops-can-be-NULL.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/net-sysfs-ethtool_ops-can-be-NULL.patch	Wed May 26 03:43:45 2010	(r15770)
@@ -0,0 +1,51 @@
+From ac5e3af9996fb911d4fdff910a8ac3cb7fc63a94 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Mon, 26 Oct 2009 01:23:33 +0000
+Subject: [PATCH] net: sysfs: ethtool_ops can be NULL
+
+commit d519e17e2d01a0ee9abe083019532061b4438065
+(net: export device speed and duplex via sysfs)
+made the wrong assumption that netdev->ethtool_ops was always set.
+
+This makes possible to crash kernel and let rtnl in locked state.
+
+modprobe dummy
+ip link set dummy0 up
+(udev runs and crash)
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Acked-by: Andy Gospodarek <andy at greyhouse.net>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ net/core/net-sysfs.c |    8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
+index 753c420..89de182 100644
+--- a/net/core/net-sysfs.c
++++ b/net/core/net-sysfs.c
+@@ -139,7 +139,9 @@ static ssize_t show_speed(struct device *dev,
+ 	if (!rtnl_trylock())
+ 		return restart_syscall();
+ 
+-	if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
++	if (netif_running(netdev) &&
++	    netdev->ethtool_ops &&
++	    netdev->ethtool_ops->get_settings) {
+ 		struct ethtool_cmd cmd = { ETHTOOL_GSET };
+ 
+ 		if (!netdev->ethtool_ops->get_settings(netdev, &cmd))
+@@ -158,7 +160,9 @@ static ssize_t show_duplex(struct device *dev,
+ 	if (!rtnl_trylock())
+ 		return restart_syscall();
+ 
+-	if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
++	if (netif_running(netdev) &&
++	    netdev->ethtool_ops &&
++	    netdev->ethtool_ops->get_settings) {
+ 		struct ethtool_cmd cmd = { ETHTOOL_GSET };
+ 
+ 		if (!netdev->ethtool_ops->get_settings(netdev, &cmd))
+-- 
+1.7.1
+

Modified: dists/sid/linux-2.6/debian/patches/series/14
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/14	Wed May 26 02:01:41 2010	(r15769)
+++ dists/sid/linux-2.6/debian/patches/series/14	Wed May 26 03:43:45 2010	(r15770)
@@ -18,3 +18,4 @@
 + bugfix/all/drm-nouveau-Fix-fbcon-corruption-with-font-width-not.patch
 + bugfix/all/ext4-Conditionally-define-compat-ioctl-numbers.patch
 + bugfix/all/ext4-Fix-compat-EXT4_IOC_ADD_GROUP.patch
++ bugfix/all/net-sysfs-ethtool_ops-can-be-NULL.patch



More information about the Kernel-svn-changes mailing list