netlink: 4 bytes leftover after parsing attributes in process `syz-executor3'.

======================================================
WARNING: possible circular locking dependency detected
4.16.0-rc4+ #346 Not tainted
------------------------------------------------------
syz-executor7/12437 is trying to acquire lock:
 (&mm->mmap_sem){++++}, at: [<000000009eadc670>] __might_fault+0xe0/0x1d0 mm/memory.c:4570

but task is already holding lock:
 (ashmem_mutex){+.+.}, at: [<0000000066221510>] ashmem_pin_unpin drivers/staging/android/ashmem.c:705 [inline]
 (ashmem_mutex){+.+.}, at: [<0000000066221510>] ashmem_ioctl+0x3db/0x11b0 drivers/staging/android/ashmem.c:782

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (ashmem_mutex){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
       mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
       ashmem_mmap+0x53/0x410 drivers/staging/android/ashmem.c:362
       call_mmap include/linux/fs.h:1786 [inline]
       mmap_region+0xa99/0x15a0 mm/mmap.c:1705
       do_mmap+0x6c0/0xe00 mm/mmap.c:1483
       do_mmap_pgoff include/linux/mm.h:2223 [inline]
       vm_mmap_pgoff+0x1de/0x280 mm/util.c:355
       SYSC_mmap_pgoff mm/mmap.c:1533 [inline]
       SyS_mmap_pgoff+0x462/0x5f0 mm/mmap.c:1491
       SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline]
       SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91
       do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

-> #0 (&mm->mmap_sem){++++}:
       lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920
       __might_fault+0x13a/0x1d0 mm/memory.c:4571
       _copy_from_user+0x2c/0x110 lib/usercopy.c:10
       copy_from_user include/linux/uaccess.h:147 [inline]
       ashmem_pin_unpin drivers/staging/android/ashmem.c:710 [inline]
       ashmem_ioctl+0x438/0x11b0 drivers/staging/android/ashmem.c:782
       vfs_ioctl fs/ioctl.c:46 [inline]
       do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
       SYSC_ioctl fs/ioctl.c:701 [inline]
       SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
       do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(ashmem_mutex);
                               lock(&mm->mmap_sem);
                               lock(ashmem_mutex);
  lock(&mm->mmap_sem);

 *** DEADLOCK ***

1 lock held by syz-executor7/12437:
 #0:  (ashmem_mutex){+.+.}, at: [<0000000066221510>] ashmem_pin_unpin drivers/staging/android/ashmem.c:705 [inline]
 #0:  (ashmem_mutex){+.+.}, at: [<0000000066221510>] ashmem_ioctl+0x3db/0x11b0 drivers/staging/android/ashmem.c:782

stack backtrace:
CPU: 1 PID: 12437 Comm: syz-executor7 Not tainted 4.16.0-rc4+ #346
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 print_circular_bug.isra.38+0x2cd/0x2dc kernel/locking/lockdep.c:1223
 check_prev_add kernel/locking/lockdep.c:1863 [inline]
 check_prevs_add kernel/locking/lockdep.c:1976 [inline]
 validate_chain kernel/locking/lockdep.c:2417 [inline]
 __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3431
 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920
 __might_fault+0x13a/0x1d0 mm/memory.c:4571
 _copy_from_user+0x2c/0x110 lib/usercopy.c:10
 copy_from_user include/linux/uaccess.h:147 [inline]
 ashmem_pin_unpin drivers/staging/android/ashmem.c:710 [inline]
 ashmem_ioctl+0x438/0x11b0 drivers/staging/android/ashmem.c:782
 vfs_ioctl fs/ioctl.c:46 [inline]
 do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x453e69
RSP: 002b:00007fb8cc0e6c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb8cc0e76d4 RCX: 0000000000453e69
RDX: 0000000000000000 RSI: 0000000000007709 RDI: 0000000000000013
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000189 R14: 00000000006f2578 R15: 0000000000000000
binder_alloc: binder_alloc_mmap_handler: 12796 20001000-20005000 already mapped failed -16
binder_alloc: binder_alloc_mmap_handler: 12796 20001000-20005000 already mapped failed -16
binder_alloc: binder_alloc_mmap_handler: 12832 20001000-20005000 already mapped failed -16
binder_alloc: binder_alloc_mmap_handler: 12833 20001000-20005000 already mapped failed -16
binder_alloc: binder_alloc_mmap_handler: 12855 20001000-20005000 already mapped failed -16
binder_alloc: binder_alloc_mmap_handler: 12864 20001000-20005000 already mapped failed -16
binder_alloc: binder_alloc_mmap_handler: 12882 20001000-20005000 already mapped failed -16
openvswitch: netlink: Message has 4 unknown bytes.
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13176 comm=syz-executor5
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13176 comm=syz-executor5
openvswitch: netlink: Message has 4 unknown bytes.
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13192 comm=syz-executor5
openvswitch: netlink: Message has 4 unknown bytes.
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13212 comm=syz-executor3
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13225 comm=syz-executor5
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13228 comm=syz-executor3
openvswitch: netlink: Message has 4 unknown bytes.
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13239 comm=syz-executor3
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13252 comm=syz-executor5
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
binder: BINDER_SET_CONTEXT_MGR already set
binder: 13315:13330 ioctl 40046207 0 returned -16
binder: release 13315:13322 transaction 46 out, still active
binder: unexpected work type, 4, not freed
binder: undelivered TRANSACTION_COMPLETE
binder: send failed reply for transaction 46, target dead
binder: BINDER_SET_CONTEXT_MGR already set
binder: release 13357:13362 transaction 50 out, still active
binder: 13351:13365 ioctl 40046207 0 returned -16
binder: unexpected work type, 4, not freed
binder: 13351:13365 transaction failed 29189/-22, size 40-8 line 2848
binder: undelivered TRANSACTION_COMPLETE
binder: send failed reply for transaction 50, target dead
binder: undelivered TRANSACTION_ERROR: 29189
binder: BINDER_SET_CONTEXT_MGR already set
binder: release 13373:13374 transaction 55 out, still active
binder: unexpected work type, 4, not freed
binder: undelivered TRANSACTION_COMPLETE
binder: 13369:13375 ioctl 40046207 0 returned -16
binder: send failed reply for transaction 55, target dead
binder_alloc: 13378: binder_alloc_buf, no vma
binder: 13369:13375 transaction failed 29189/-3, size 40-8 line 2963
binder: undelivered TRANSACTION_ERROR: 29189
binder: BINDER_SET_CONTEXT_MGR already set
binder: release 13378:13380 transaction 59 out, still active
binder: unexpected work type, 4, not freed
binder: undelivered TRANSACTION_COMPLETE
binder: 13392:13393 ioctl 40046207 0 returned -16
binder: send failed reply for transaction 59, target dead
binder: 13392:13402 transaction failed 29189/-22, size 40-8 line 2848
binder: undelivered TRANSACTION_ERROR: 29189
binder: 13623:13628 ioctl c0306201 20007000 returned -14
kernel msg: ebtables bug: please report to author: bad policy
binder_alloc: binder_alloc_mmap_handler: 13623 20000000-20002000 already mapped failed -16
kernel msg: ebtables bug: please report to author: bad policy
binder: 13643:13647 ioctl c0306201 20007000 returned -14
kernel msg: ebtables bug: please report to author: bad policy
binder: 13653:13658 ioctl c0306201 20007000 returned -14
kernel msg: ebtables bug: please report to author: bad policy
binder: 13676:13685 ioctl c0306201 20007000 returned -14
raw_sendmsg: syz-executor4 forgot to set AF_INET. Fix it!
mmap: syz-executor3 (13776) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt.
openvswitch: netlink: Flow set message rejected, Key attribute missing.
netlink: 'syz-executor0': attribute type 1 has an invalid length.
netlink: 'syz-executor0': attribute type 1 has an invalid length.
snd_dummy snd_dummy.0: control 120:0:0:�:0 is already present
netlink: 'syz-executor0': attribute type 1 has an invalid length.
snd_dummy snd_dummy.0: control 120:0:0:�:0 is already present
netlink: 'syz-executor0': attribute type 1 has an invalid length.
binder: 14052 RLIMIT_NICE not set
snd_dummy snd_dummy.0: control 120:0:0:�:0 is already present
binder: 14066:14069 transaction failed 29189/-22, size 0-0 line 2848
binder: 14066:14073 transaction failed 29189/-22, size 0-0 line 2848
binder: 14086 RLIMIT_NICE not set
binder: 14091:14098 transaction failed 29189/-22, size 0-0 line 2848
binder: 14101 RLIMIT_NICE not set
binder: 14124 RLIMIT_NICE not set
binder: 14120:14128 transaction failed 29189/-22, size 0-0 line 2848
binder: 14136:14137 transaction failed 29189/-22, size 0-0 line 2848
binder: 14144:14145 transaction failed 29189/-22, size 0-0 line 2848
binder: 14149:14158 transaction failed 29189/-22, size 0-0 line 2848
binder: release 14177:14185 transaction 72 out, still active
binder: undelivered TRANSACTION_COMPLETE
binder: release 14179:14189 transaction 73 out, still active
binder: BINDER_SET_CONTEXT_MGR already set
binder_alloc: 14177: binder_alloc_buf, no vma
binder: 14177:14203 transaction failed 29189/-3, size 0-0 line 2963
binder: 14177:14185 ioctl 40046207 0 returned -16
binder: undelivered TRANSACTION_ERROR: 29189
binder: send failed reply for transaction 72, target dead
binder: send failed reply for transaction 73, target dead
capability: warning: `syz-executor4' uses 32-bit capabilities (legacy support in use)
audit: type=1400 audit(1520514746.846:40): avc:  denied  { setfcap } for  pid=15065 comm="syz-executor4" capability=31  scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1