• Vaibhav Hiremath's avatar
    [media] omap_vout: Added check in reqbuf & mmap for buf_size allocation · 383e4f69
    Vaibhav Hiremath authored
    The usecase where, user allocates small size of buffer
    through bootargs (video1_bufsize/video2_bufsize) and later from application
    tries to set the format which requires larger buffer size, driver doesn't
    check for insufficient buffer size and allows application to map extra buffer.
    This leads to kernel crash, when user application tries to access memory
    beyond the allocation size.
    
    Added check in both mmap and reqbuf call back function,
    and return error if the size of the buffer allocated by user through
    bootargs is less than the S_FMT size.
    Signed-off-by: default avatarVaibhav Hiremath <hvaibhav@ti.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    383e4f69
omap_vout.c 66.3 KB