Date: Fri, 4 Mar 2016 21:22:12 +0000 (UTC) From: Andriy Voskoboinyk <avos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296393 - head/sys/net80211 Message-ID: <201603042122.u24LMCvv031386@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avos Date: Fri Mar 4 21:22:11 2016 New Revision: 296393 URL: https://svnweb.freebsd.org/changeset/base/296393 Log: net80211: fix possible overflow in IEEE80211_TU_TO_TICKS() For hz=1000 any number, greater than 4194 causes integer overflow; this change casts the number to uint64_t before operating with it. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5268 Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Fri Mar 4 19:57:11 2016 (r296392) +++ head/sys/net80211/ieee80211_var.h Fri Mar 4 21:22:11 2016 (r296393) @@ -85,7 +85,7 @@ #define IEEE80211_MS_TO_TU(x) (((x) * 1000) / 1024) #define IEEE80211_TU_TO_MS(x) (((x) * 1024) / 1000) /* XXX TODO: cap this at 1, in case hz is not 1000 */ -#define IEEE80211_TU_TO_TICKS(x)(((x) * 1024 * hz) / (1000 * 1000)) +#define IEEE80211_TU_TO_TICKS(x)(((uint64_t)(x) * 1024 * hz) / (1000 * 1000)) /* * 802.11 control state is split into a common portion that maps
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603042122.u24LMCvv031386>