Exploit databaseDownload repository ZIP
GH-9a497cc26994d431b276e9e3b7a8f75c
satheesh575555/linux-4.19.72_cve-2023-0386
Sources for CVE-2023-0386
20 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files54
satheesh575555/linux-4.19.72_cve-2023-0386Revision ef9a4a9fbf2b
- ↑..Parent directory
- mt76x0/
- Kconfig
- Makefile
- agg-rx.c
- debugfs.c
- dma.c
- dma.h
- eeprom.c
- mac80211.c
- mmio.c
- mt76.h
- mt76x2.h
- mt76x2_common.c
- mt76x2_core.c
- mt76x2_debugfs.c
- mt76x2_dfs.c
- mt76x2_dfs.h
- mt76x2_dma.c
- mt76x2_dma.h
- mt76x2_eeprom.c
- mt76x2_eeprom.h
- mt76x2_init.c
- mt76x2_init_common.c
- mt76x2_mac.c
- mt76x2_mac.h
- mt76x2_mac_common.c
- mt76x2_main.c
- mt76x2_mcu.c
- mt76x2_mcu.h
- mt76x2_pci.c
- mt76x2_phy.c
- mt76x2_phy_common.c
- mt76x2_regs.h
- mt76x2_trace.c
- mt76x2_trace.h
- mt76x2_tx.c
- mt76x2_tx_common.c
- mt76x2_usb.c
- mt76x2u.h
- mt76x2u_core.c
- mt76x2u_init.c
- mt76x2u_mac.c
- mt76x2u_main.c
- mt76x2u_mcu.c
- mt76x2u_phy.c
- trace.c
- trace.h
- tx.c
- usb.c
- usb_mcu.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
drivers/net/wireless/mediatek/mt76/util.c
C · 1,812 bytes/*
* Copyright (C) 2016 Felix Fietkau <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <linux/module.h>
#include "mt76.h"
bool __mt76_poll(struct mt76_dev *dev, u32 offset, u32 mask, u32 val,
int timeout)
{
u32 cur;
timeout /= 10;
do {
cur = dev->bus->rr(dev, offset) & mask;
if (cur == val)
return true;
udelay(10);
} while (timeout-- > 0);
return false;
}
EXPORT_SYMBOL_GPL(__mt76_poll);
bool __mt76_poll_msec(struct mt76_dev *dev, u32 offset, u32 mask, u32 val,
int timeout)
{
u32 cur;
timeout /= 10;
do {
cur = dev->bus->rr(dev, offset) & mask;
if (cur == val)
return true;
usleep_range(10000, 20000);
} while (timeout-- > 0);
return false;
}
EXPORT_SYMBOL_GPL(__mt76_poll_msec);
int mt76_wcid_alloc(unsigned long *mask, int size)
{
int i, idx = 0, cur;
for (i = 0; i < size / BITS_PER_LONG; i++) {
idx = ffs(~mask[i]);
if (!idx)
continue;
idx--;
cur = i * BITS_PER_LONG + idx;
if (cur >= size)
break;
mask[i] |= BIT(idx);
return cur;
}
return -1;
}
EXPORT_SYMBOL_GPL(mt76_wcid_alloc);
MODULE_LICENSE("Dual BSD/GPL");