• Miaoqing Pan's avatar
    ath9k: fix tx99 use after free · b87fd1eb
    Miaoqing Pan authored
    [ Upstream commit cf8ce1ea ]
    
    One scenario that could lead to UAF is two threads writing
    simultaneously to the "tx99" debug file. One of them would
    set the "start" value to true and follow to ath9k_tx99_init().
    Inside the function it would set the sc->tx99_state to true
    after allocating sc->tx99skb. Then, the other thread would
    execute write_file_tx99() and call ath9k_tx99_deinit().
    sc->tx99_state would be freed. After that, the first thread
    would continue inside ath9k_tx99_init() and call
    r = ath9k_tx99_send(sc, sc->tx99_skb, &txctl);
    that would make use of the freed sc->tx99_skb memory.
    
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarMiaoqing Pan <miaoqing@codeaurora.org>
    Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
    Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
    b87fd1eb
tx99.c 6.84 KB