cfg80211: fix mic_failure tracing
authorEliad Peller <eliad@wizery.com>
Thu, 17 Jul 2014 12:00:56 +0000 (15:00 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 18 Jul 2014 07:53:56 +0000 (09:53 +0200)
tsc can be NULL (mac80211 currently always passes NULL),
resulting in NULL-dereference. check before copying it.

Cc: stable@vger.kernel.org
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/trace.h

index 560ed77084e92b52cae0f299ca383eef240a42e6..7cc887f9da11d74e3dd5ac5592ccb7f65b900771 100644 (file)
@@ -2094,7 +2094,8 @@ TRACE_EVENT(cfg80211_michael_mic_failure,
                MAC_ASSIGN(addr, addr);
                __entry->key_type = key_type;
                __entry->key_id = key_id;
-               memcpy(__entry->tsc, tsc, 6);
+               if (tsc)
+                       memcpy(__entry->tsc, tsc, 6);
        ),
        TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT ", key type: %d, key id: %d, tsc: %pm",
                  NETDEV_PR_ARG, MAC_PR_ARG(addr), __entry->key_type,