• Suren Baghdasaryan's avatar
    NFC: Fix possible memory corruption when handling SHDLC I-Frame commands · 67084e26
    Suren Baghdasaryan authored
    commit 674d9de02aa7d521ebdf66c3958758bdd9c64e11 upstream.
    
    When handling SHDLC I-Frame commands "pipe" field used for indexing
    into an array should be checked before usage. If left unchecked it
    might access memory outside of the array of size NFC_HCI_MAX_PIPES(127).
    
    Malformed NFC HCI frames could be injected by a malicious NFC device
    communicating with the device being attacked (remote attack vector),
    or even by an attacker with physical access to the I2C bus such that
    they could influence the data transfers on that bus (local attack vector).
    skb->data is controlled by the attacker and has only been sanitized in
    the most trivial ways (CRC check), therefore we can consider the
    create_info struct and all of its members to tainted. 'create_info->pipe'
    with max value of 255 (uint8) is used to take an offset of the
    hdev->pipes array of 127 elements which can lead to OOB write.
    
    Cc: Samuel Ortiz <sameo@linux.intel.com>
    Cc: Allen Pais <allen.pais@oracle.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Suggested-by: 's avatarKevin Deus <kdeus@google.com>
    Signed-off-by: 's avatarSuren Baghdasaryan <surenb@google.com>
    Acked-by: 's avatarKees Cook <keescook@chromium.org>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    67084e26
Name
Last commit
Last update
..
hci Loading commit data...
nci Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
af_nfc.c Loading commit data...
core.c Loading commit data...
digital.h Loading commit data...
digital_core.c Loading commit data...
digital_dep.c Loading commit data...
digital_technology.c Loading commit data...
llcp.h Loading commit data...
llcp_commands.c Loading commit data...
llcp_core.c Loading commit data...
llcp_sock.c Loading commit data...
netlink.c Loading commit data...
nfc.h Loading commit data...
rawsock.c Loading commit data...