lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a122ca3c-6b1b-3d03-08e3-ac1906ab7389@gmail.com>
Date:   Tue, 1 Dec 2020 18:15:11 +0530
From:   Anant Thazhemadam <anant.thazhemadam@...il.com>
To:     Johannes Berg <johannes@...solutions.net>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        syzbot+49d4cab497c2142ee170@...kaller.appspotmail.com
Subject: Re: [PATCH] net: mac80211: cfg: enforce sanity checks for key_index
 in ieee80211_del_key()


On 01/12/20 5:36 pm, Johannes Berg wrote:
> On Tue, 2020-12-01 at 17:26 +0530, Anant Thazhemadam wrote:
>> On 01/12/20 3:30 pm, Johannes Berg wrote:
>>> On Tue, 2020-12-01 at 15:26 +0530, Anant Thazhemadam wrote:
>>>> Currently, it is assumed that key_idx values that are passed to
>>>> ieee80211_del_key() are all valid indexes as is, and no sanity checks
>>>> are performed for it.
>>>> However, syzbot was able to trigger an array-index-out-of-bounds bug
>>>> by passing a key_idx value of 5, when the maximum permissible index
>>>> value is (NUM_DEFAULT_KEYS - 1).
>>>> Enforcing sanity checks helps in preventing this bug, or a similar
>>>> instance in the context of ieee80211_del_key() from occurring.
>>> I think we should do this more generally in cfg80211, like in
>>> nl80211_new_key() we do it via cfg80211_validate_key_settings().
>>>
>>> I suppose we cannot use the same function, but still, would be good to
>>> address this generally in nl80211 for all drivers.
>> Hello,
>>
>> This gave me the idea of trying to use cfg80211_validate_key_settings()
>> directly in ieee80211_del_key(). I did try that out, tested it, and this bug
>> doesn't seem to be getting triggered anymore.
>> If this is okay, then I can send in a v2 soon. :)
>>
>> If there is any reason that I'm missing as to why cfg80211_validate_key_settings()
>> cannot be used in this context, please let me know.
> If it works then I guess that's OK. I thought we didn't have all the
> right information, e.g. whether a key is pairwise or not?
>
> johannes
>
Well,
cfg80211_supported_cipher_suite(&rdev->wiphy, params->cipher) returned
false, and thus it worked for the syzbot reproducer.
Would it be a safer idea to enforce the conditions that I initially put (in
ieee80211_del_key()) directly in cfg80211_validate_key_settings() itself - by
updating max_key_index, and checking accordingly?

Thanks,
Anant

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ