Skip to content

Commit 77c0ef9

Browse files
f0rm2l1ngregkh
authored andcommitted
nfc: nci: fix the UAF of rf_conn_info object
commit 1b1499a upstream. The nci_core_conn_close_rsp_packet() function will release the conn_info with given conn_id. However, it needs to set the rf_conn_info to NULL to prevent other routines like nci_rf_intf_activated_ntf_packet() to trigger the UAF. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Lin Ma <linma@zju.edu.cn> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8f04231 commit 77c0ef9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/nfc/nci/rsp.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ static void nci_core_conn_close_rsp_packet(struct nci_dev *ndev,
277277
ndev->cur_conn_id);
278278
if (conn_info) {
279279
list_del(&conn_info->list);
280+
if (conn_info == ndev->rf_conn_info)
281+
ndev->rf_conn_info = NULL;
280282
devm_kfree(&ndev->nfc_dev->dev, conn_info);
281283
}
282284
}

0 commit comments

Comments
 (0)