From owner-p4-projects@FreeBSD.ORG Thu Jan 31 06:19:33 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7991116A468; Thu, 31 Jan 2008 06:19:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D6F316A417 for ; Thu, 31 Jan 2008 06:19:33 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 26C0213C45D for ; Thu, 31 Jan 2008 06:19:33 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0V6JXF8074592 for ; Thu, 31 Jan 2008 06:19:33 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0V6JXDE074589 for perforce@freebsd.org; Thu, 31 Jan 2008 06:19:33 GMT (envelope-from sam@freebsd.org) Date: Thu, 31 Jan 2008 06:19:33 GMT Message-Id: <200801310619.m0V6JXDE074589@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 134526 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2008 06:19:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=134526 Change 134526 by sam@sam_ebb on 2008/01/31 06:19:16 validate the country ie length to make sure we have at least the cc data that is blindly accessed in the scan module; should also allow code to safely parse the band list Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_input.c#25 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_input.c#25 (text+ko) ==== @@ -698,6 +698,17 @@ vap->iv_stats.is_rx_badbintval++; scan->status |= IEEE80211_BPARSE_BINTVAL_INVALID; } + if (scan->country != NULL) { + /* + * Validate we have at least enough data to extract + * the country code. Not sure if we should return an + * error instead of discarding the IE; consider this + * being lenient as we don't depend on the data for + * correct operation. + */ + IEEE80211_VERIFY_LENGTH(scan->country[1], 3 * sizeof(uint8_t), + scan->country = NULL); + } /* * Process HT ie's. This is complicated by our * accepting both the standard ie's and the pre-draft