• Jukka Rissanen's avatar
    Bluetooth: Provide L2CAP ops callback for memcpy_fromiovec · 0498878b
    Jukka Rissanen authored
    The highly optimized TX path for L2CAP channels and its fragmentation
    within the HCI ACL packets requires to copy data from user provided
    IO vectors and also kernel provided memory buffers.
    
    This patch allows channel clients to provide a memcpy_fromiovec callback
    to keep this optimized behavior, but adapt it to kernel vs user memory
    for the TX path. For all kernel internal L2CAP channels, a default
    implementation is provided that can be referenced.
    
    In case of A2MP, this fixes a long-standing issue with wrongly accessing
    kernel memory as user memory.
    
    This patch originally by Marcel Holtmann.
    Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    0498878b
a2mp.c 21.5 KB