From owner-svn-src-head@freebsd.org Sun Feb 14 16:16:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E932AAA8B21; Sun, 14 Feb 2016 16:16:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3F08176A; Sun, 14 Feb 2016 16:16:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C1EB41FE023; Sun, 14 Feb 2016 17:16:39 +0100 (CET) Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan To: Andriy Voskoboinyk References: <201602140716.u1E7Gaot040504@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56C0A8F6.1090105@selasky.org> Date: Sun, 14 Feb 2016 17:19:02 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2016 16:16:43 -0000 On 02/14/16 16:13, Andriy Voskoboinyk wrote: > Sun, 14 Feb 2016 09:16:36 +0200 було написано Hans Petter Selasky > : > >> Author: hselasky >> Date: Sun Feb 14 07:16:36 2016 >> New Revision: 295607 >> URL: https://svnweb.freebsd.org/changeset/base/295607 >> >> Log: >> Reduce the number of supported WLAN keys in the rum driver, else we >> risk bit shifting overflows. Found by D5245 / PVS. >> MFC after: 1 week > > Hardware crypto support was never merged (so, there is nothing to MFC). OK. >> Modified: head/sys/dev/usb/wlan/if_rumreg.h >> ============================================================================== >> >> --- head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 02:28:59 2016 >> (r295606) >> +++ head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 07:16:36 2016 >> (r295607) >> @@ -47,7 +47,7 @@ >> * H/w encryption/decryption support >> */ >> #define KEY_SIZE (IEEE80211_KEYBUF_SIZE + IEEE80211_MICBUF_SIZE) >> -#define RT2573_ADDR_MAX 64 >> +#define RT2573_ADDR_MAX (32 / RT2573_SKEY_MAX) >> #define RT2573_SKEY_MAX 4 >> #define RT2573_SKEY(vap, kidx) (0x1000 + ((vap) * RT2573_SKEY_MAX + \ >> > > Reason of this change? (device table has 64 entries, not 8). > I have not seen any overflows, caused by it: You're right. > > 1) > vap->iv_key_set = rum_key_set; > vap->iv_key_delete = rum_key_delete; > vap->iv_update_beacon = rum_update_beacon; > vap->iv_max_aid = RT2573_ADDR_MAX; // not > the case > > usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0); > TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp); > > 2) > k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) { > if (!(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { > RUM_LOCK(sc); > for (i = 0; i < RT2573_ADDR_MAX; i++) { // can hold > [0;63] without any overflows; > // keys_bmap is 64-bit, so there > is no overflow too > if ((sc->keys_bmap & (1ULL << i)) == 0) { > sc->keys_bmap |= 1ULL << i; > *keyix = i; > > 3) > } I'll revert the header file change shortly. Then we're up to date. --HPS