Skip to content

Commit 26528be

Browse files
Todd Kjosgregkh
authored andcommitted
binder: fix handling of misaligned binder object
Fixes crash found by syzbot: kernel BUG at drivers/android/binder_alloc.c:LINE! (2) Reported-and-tested-by: syzbot+55de1eb4975dec156d8f@syzkaller.appspotmail.com Signed-off-by: Todd Kjos <tkjos@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 36f3093 commit 26528be

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/android/binder.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,7 @@ static size_t binder_get_object(struct binder_proc *proc,
20572057
size_t object_size = 0;
20582058

20592059
read_size = min_t(size_t, sizeof(*object), buffer->data_size - offset);
2060-
if (read_size < sizeof(*hdr))
2060+
if (read_size < sizeof(*hdr) || !IS_ALIGNED(offset, sizeof(u32)))
20612061
return 0;
20622062
binder_alloc_copy_from_buffer(&proc->alloc, object, buffer,
20632063
offset, read_size);

0 commit comments

Comments
 (0)