USB: gadget: f_ncm: add bounds checks to ncm_unwrap_ntb()
commit 2b74b0a0 upstream. Some values extracted by ncm_unwrap_ntb() could possibly lead to several different out of bounds reads of memory. Specifically the values passed to netdev_alloc_skb_ip_align() need to be checked so that memory is not overflowed. Resolve this by applying bounds checking to a number of different indexes and lengths of the structure parsing logic. Reported-by: NIlja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: NBrooke Basile <brookebasile@gmail.com> Acked-by: NFelipe Balbi <balbi@kernel.org> Cc: stable <stable@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录