From: Rajkumar Manoharan <rmanoharan@atheros.com>
To: <mcgrof@kernel.org>
Cc: <linux-wireless@vger.kernel.org>,
<linux-bluetooth@vger.kernel.org>,
Rajkumar Manoharan <rmanoharan@atheros.com>
Subject: [PATCH] compat: Fix panic caused by NULL pointer derefence in rtnl_fill_ifinfo
Date: Tue, 29 Jun 2010 12:08:07 +0530 [thread overview]
Message-ID: <1277793487-9071-1-git-send-email-rmanoharan@atheros.com> (raw)
get stats netdev ops is blindy called for older kernels (< 2.6.29) and
so assigning a NULL pointer from netdev_attach_ops causes a NULL pointer
dereference.
By default, netdev alloc provides an internal stats reference. So fill
this only if ndo_get_stats is defined.
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
---
compat/compat-2.6.29.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/compat/compat-2.6.29.c b/compat/compat-2.6.29.c
index f94aed8..2e7e623 100644
--- a/compat/compat-2.6.29.c
+++ b/compat/compat-2.6.29.c
@@ -35,7 +35,8 @@ void netdev_attach_ops(struct net_device *dev,
dev->change_mtu = ops->ndo_change_mtu;
dev->set_mac_address = ops->ndo_set_mac_address;
dev->tx_timeout = ops->ndo_tx_timeout;
- dev->get_stats = ops->ndo_get_stats;
+ if (ops->ndo_get_stats)
+ dev->get_stats = ops->ndo_get_stats;
dev->vlan_rx_register = ops->ndo_vlan_rx_register;
dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid;
dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid;
--
1.7.0.4
next reply other threads:[~2010-06-29 6:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-29 6:38 Rajkumar Manoharan [this message]
2010-06-29 15:21 ` [PATCH] compat: Fix panic caused by NULL pointer derefence in rtnl_fill_ifinfo Luis R. Rodriguez
-- strict thread matches above, loose matches on Subject: below --
2010-06-29 16:26 Rajkumar Manoharan
2010-07-07 21:10 ` Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1277793487-9071-1-git-send-email-rmanoharan@atheros.com \
--to=rmanoharan@atheros.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox