aboutsummaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorAlistair Strachan <astrachan@google.com>2018-12-18 20:32:48 -0500
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2019-03-27 07:45:17 -0700
commit101bd52410724fa34af63e0ce0f3aeb5f93e84bc (patch)
tree4858799d91734f124d71d3f550d8899b3c638701 /net/unix/af_unix.c
parent8a1dd35a8f2d0e65afafc758df834b30bbc56efd (diff)
media: uvcvideo: Fix 'type' check leading to overflow
commit 47bb117911b051bbc90764a8bff96543cbd2005f upstream. When initially testing the Camera Terminal Descriptor wTerminalType field (buffer[4]), no mask is used. Later in the function, the MSB is overloaded to store the descriptor subtype, and so a mask of 0x7fff is used to check the type. If a descriptor is specially crafted to set this overloaded bit in the original wTerminalType field, the initial type check will fail (falling through, without adjusting the buffer size), but the later type checks will pass, assuming the buffer has been made suitably large, causing an overflow. Avoid this problem by checking for the MSB in the wTerminalType field. If the bit is set, assume the descriptor is bad, and abort parsing it. Originally reported here: https://groups.google.com/forum/#!topic/syzkaller/Ot1fOE6v1d8 A similar (non-compiling) patch was provided at that time. Reported-by: syzbot <syzkaller@googlegroups.com> Bug: 111760968 Signed-off-by: Alistair Strachan <astrachan@google.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: Ieaad998693c4fcd0ea5f9902f50ad3b979e967d8
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions