================================================================== BUG: KASAN: use-after-free in memset include/linux/string.h:337 [inline] BUG: KASAN: use-after-free in __ext4_expand_extra_isize+0x16f/0x240 fs/ext4/inode.c:5897 Write of size 50331616 at addr ffff8881abe021a0 by task rs:main Q:Reg/6022 CPU: 0 PID: 6022 Comm: rs:main Q:Reg Not tainted 4.20.0-rc7+ #161 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 memset+0x23/0x40 mm/kasan/kasan.c:285 memset include/linux/string.h:337 [inline] __ext4_expand_extra_isize+0x16f/0x240 fs/ext4/inode.c:5897 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5949 [inline] ext4_mark_inode_dirty+0x8f9/0xb20 fs/ext4/inode.c:6025 ext4_dirty_inode+0x97/0xc0 fs/ext4/inode.c:6059 __mark_inode_dirty+0x7c3/0x1510 fs/fs-writeback.c:2122 mark_inode_dirty include/linux/fs.h:2119 [inline] __generic_write_end+0x320/0x400 fs/buffer.c:2117 generic_write_end+0x6c/0x90 fs/buffer.c:2162 ext4_da_write_end+0x2e0/0xcd0 fs/ext4/inode.c:3203 generic_perform_write+0x4ca/0x6a0 mm/filemap.c:3151 __generic_file_write_iter+0x26e/0x630 mm/filemap.c:3265 ext4_file_write_iter+0x390/0x1420 fs/ext4/file.c:266 call_write_iter include/linux/fs.h:1857 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f65dc2b519d Code: d1 20 00 00 75 10 b8 01 00 00 00 0f 05 48 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 be fa ff ff 48 89 04 24 b8 01 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 07 fb ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007f65da856000 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00000000000000f5 RCX: 00007f65dc2b519d RDX: 00000000000000f5 RSI: 0000000000d27a90 RDI: 0000000000000005 RBP: 0000000000d27a90 R08: 0000000000d27b75 R09: 00007f65dbc323f7 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007f65da856480 R14: 0000000000000002 R15: 0000000000d27890 The buggy address belongs to the page: page:ffffea0006af8080 count:2 mapcount:0 mapping:ffff8881cc4d0658 index:0x427 flags: 0x2fffc000000203a(referenced|dirty|lru|active|private) raw: 02fffc000000203a ffffea0006b05c08 ffffea0006c7c348 ffff8881cc4d0658 raw: 0000000000000427 ffff8881affa1690 00000002ffffffff ffff8881d9a4adc0 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8881d9a4adc0 Memory state around the buggy address: ffff8881abe8ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881abe8ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881abe90000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881abe90080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881abe90100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== Linux version 4.20.0-rc7+ (syzkaller@ci) (gcc version 8.0.1 20180413 (experimental) (GCC)) #161 SMP PREEMPT Fri Dec 21 01:32:57 UTC 2018 Command line: BOOT_IMAGE=/vmlinuz root=/dev/sda1 console=ttyS0 earlyprintk=serial vsyscall=native rodata=n oops=panic panic_on_warn=1 nmi_watchdog=panic panic=86400 security=selinux ima_policy=tcb workqueue.watchdog_thresh=140 kvm-intel.nested=1 nf-conntrack-ftp.ports=20000 nf-conntrack-tftp.ports=20000 nf-conntrack-sip.ports=20000 nf-conntrack-irc.ports=20000 nf-conntrack-sane.ports=20000 vivid.n_devs=16 vivid.multiplanar=1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 spec_store_bypass_disable=prctl nopcid KERNEL supported cpus: Intel GenuineIntel AMD AuthenticAMD Centaur CentaurHauls x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format. BIOS-provided physical RAM map: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved BIOS-e820: [mem 0x0000000000100000-0x00000000bfffcfff] usable BIOS-e820: [mem 0x00000000bfffd000-0x00000000bfffffff] reserved BIOS-e820: [mem 0x00000000fffbc000-0x00000000ffffffff] reserved BIOS-e820: [mem 0x0000000100000000-0x000000021fffffff] usable printk: bootconsole [earlyser0] enabled Malformed early option 'vsyscall' nopcid: PCID feature disabled NX (Execute Disable) protection: active SMBIOS 2.4 present. DMI: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Hypervisor detected: KVM kvm-clock: Using msrs 4b564d01 and 4b564d00 kvm-clock: cpu 0, msr a53a001, primary cpu clock kvm-clock: using sched offset of 3569020203 cycles clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns tsc: Detected 2300.000 MHz processor last_pfn = 0x220000 max_arch_pfn = 0x400000000 x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT last_pfn = 0xbfffd max_arch_pfn = 0x400000000 found SMP MP-table at [mem 0x000f2ce0-0x000f2cef] mapped at [(____ptrval____)] check: Scanning 1 areas for low memory corruption Using GB pages for direct mapping ACPI: Early table checksum verification disabled ACPI: RSDP 0x00000000000F2AB0 000014 (v00 Google) ACPI: RSDT 0x00000000BFFFDBA0 000038 (v01 Google GOOGRSDT 00000001 GOOG 00000001) ACPI: FACP 0x00000000BFFFFF00 0000F4 (v02 Google GOOGFACP 00000001 GOOG 00000001) ACPI: DSDT 0x00000000BFFFDBE0 0017B2 (v01 Google GOOGDSDT 00000001 GOOG 00000001) ACPI: FACS 0x00000000BFFFFEC0 000040 ACPI: FACS 0x00000000BFFFFEC0 000040 ACPI: SSDT 0x00000000BFFFF590 000930 (v01 Google GOOGSSDT 00000001 GOOG 00000001) ACPI: APIC 0x00000000BFFFF4A0 000076 (v01 Google GOOGAPIC 00000001 GOOG 00000001) ACPI: WAET 0x00000000BFFFF470 000028 (v01 Google GOOGWAET 00000001 GOOG 00000001) ACPI: SRAT 0x00000000BFFFF3A0 0000C8 (v01 Google GOOGSRAT 00000001 GOOG 00000001) SRAT: PXM 0 -> APIC 0x00 -> Node 0 SRAT: PXM 0 -> APIC 0x01 -> Node 0 ACPI: SRAT: Node 0 PXM 0 [mem 0x00000000-0x0009ffff] ACPI: SRAT: Node 0 PXM 0 [mem 0x00100000-0xbfffffff] ACPI: SRAT: Node 0 PXM 0 [mem 0x100000000-0x21fffffff] NUMA: Node 0 [mem 0x00000000-0x0009ffff] + [mem 0x00100000-0xbfffffff] -> [mem 0x00000000-0xbfffffff] NUMA: Node 0 [mem 0x00000000-0xbfffffff] + [mem 0x100000000-0x21fffffff] -> [mem 0x00000000-0x21fffffff] NODE_DATA(0) allocated [mem 0x21fffa000-0x21fffdfff] Zone ranges: DMA [mem 0x0000000000001000-0x0000000000ffffff] DMA32 [mem 0x0000000001000000-0x00000000ffffffff] Normal [mem 0x0000000100000000-0x000000021fffffff] Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000000001000-0x000000000009efff] node 0: [mem 0x0000000000100000-0x00000000bfffcfff] node 0: [mem 0x0000000100000000-0x000000021fffffff] Zeroed struct page in unavailable ranges: 101 pages Initmem setup node 0 [mem 0x0000000000001000-0x000000021fffffff] kasan: KernelAddressSanitizer initialized ACPI: PM-Timer IO Port: 0xb008 ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1]) IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23 ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level) Using ACPI (MADT) for SMP configuration information smpboot: Allowing 2 CPUs, 0 hotplug CPUs PM: Registered nosave memory: [mem 0x00000000-0x00000fff] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff] PM: Registered nosave memory: [mem 0x000a0000-0x000effff] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff] PM: Registered nosave memory: [mem 0xbfffd000-0xbfffffff] PM: Registered nosave memory: [mem 0xc0000000-0xfffbbfff] PM: Registered nosave memory: [mem 0xfffbc000-0xffffffff] [mem 0xc0000000-0xfffbbfff] available for PCI devices Booting paravirtualized kernel on KVM clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns random: get_random_bytes called from boot_init_stack_canary arch/x86/include/asm/stackprotector.h:75 [inline] with crng_init=0 random: get_random_bytes called from start_kernel+0x153/0xa30 init/main.c:565 with crng_init=0 setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:2 nr_node_ids:1 percpu: Embedded 56 pages/cpu @(____ptrval____) s189256 r8192 d31928 u1048576 Built 1 zonelists, mobility grouping on. Total pages: 1935238 Policy zone: Normal Kernel command line: BOOT_IMAGE=/vmlinuz root=/dev/sda1 console=ttyS0 earlyprintk=serial vsyscall=native rodata=n oops=panic panic_on_warn=1 nmi_watchdog=panic panic=86400 security=selinux ima_policy=tcb workqueue.watchdog_thresh=140 kvm-intel.nested=1 nf-conntrack-ftp.ports=20000 nf-conntrack-tftp.ports=20000 nf-conntrack-sip.ports=20000 nf-conntrack-irc.ports=20000 nf-conntrack-sane.ports=20000 vivid.n_devs=16 vivid.multiplanar=1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 spec_store_bypass_disable=prctl nopcid Memory: 6489316K/7863916K available (114712K kernel code, 13832K rwdata, 17556K rodata, 3116K init, 25540K bss, 1374600K reserved, 0K cma-reserved) Running RCU self tests rcu: Preemptible hierarchical RCU implementation. rcu: RCU lockdep checking is enabled. rcu: RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=2. rcu: RCU callback double-/use-after-free debug enabled. Tasks RCU enabled. rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2 NR_IRQS: 4352, nr_irqs: 440, preallocated irqs: 16 Console: colour VGA+ 80x25 printk: console [ttyS0] enabled printk: console [ttyS0] enabled printk: bootconsole [earlyser0] disabled printk: bootconsole [earlyser0] disabled Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar ... MAX_LOCKDEP_SUBCLASSES: 8 ... MAX_LOCK_DEPTH: 48 ... MAX_LOCKDEP_KEYS: 8191 ... CLASSHASH_SIZE: 4096 ... MAX_LOCKDEP_ENTRIES: 32768 ... MAX_LOCKDEP_CHAINS: 65536 ... CHAINHASH_SIZE: 32768 memory used by lock dependency info: 7263 kB per task-struct memory footprint: 1920 bytes ACPI: Core revision 20181003 APIC: Switch to symmetric I/O mode setup x2apic enabled Switched APIC routing to physical x2apic. ..TIMER: vector=0x30 apic1=0 pin1=0 apic2=-1 pin2=-1 clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x212735223b2, max_idle_ns: 440795277976 ns Calibrating delay loop (skipped) preset value.. 4600.00 BogoMIPS (lpj=23000000) pid_max: default: 32768 minimum: 301 LSM: Security Framework initializing Yama: becoming mindful. SELinux: Initializing. AppArmor: AppArmor disabled by boot time parameter Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes) Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes) Mount-cache hash table entries: 16384 (order: 5, 131072 bytes) Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes) mce: CPU supports 32 MCE banks Last level iTLB entries: 4KB 1024, 2MB 1024, 4MB 1024 Last level dTLB entries: 4KB 1024, 2MB 1024, 4MB 1024, 1GB 4 Spectre V2 : Mitigation: Full generic retpoline Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch Speculative Store Bypass: Vulnerable Freeing SMP alternatives memory: 72K smpboot: CPU0: Intel(R) Xeon(R) CPU @ 2.30GHz (family: 0x6, model: 0x3f, stepping: 0x0) Performance Events: unsupported p6 CPU model 63 no PMU driver, software events only. rcu: Hierarchical SRCU implementation. NMI watchdog: Perf NMI watchdog permanently disabled smp: Bringing up secondary CPUs ... x86: Booting SMP configuration: .... node #0, CPUs: #1 kvm-clock: cpu 1, msr a53a041, secondary cpu clock smp: Brought up 1 node, 2 CPUs smpboot: Max logical packages: 1 smpboot: Total of 2 processors activated (9200.00 BogoMIPS) devtmpfs: initialized clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 512 (order: 4, 65536 bytes) xor: automatically using best checksumming function avx RTC time: 5:15:34, date: 12/21/18 NET: Registered protocol family 16 audit: initializing netlink subsys (disabled) kworker/u4:0 (25) used greatest stack depth: 23936 bytes left audit: type=2000 audit(1545369333.960:1): state=initialized audit_enabled=0 res=1 kworker/u4:2 (29) used greatest stack depth: 23112 bytes left cpuidle: using governor menu ACPI: bus type PCI registered dca service started, version 1.12.1 PCI: Using configuration type 1 for base access kworker/u4:3 (427) used greatest stack depth: 21120 bytes left kworker/u4:0 (579) used greatest stack depth: 20920 bytes left HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages cryptd: max_cpu_qlen set to 1000 raid6: sse2x1 gen() 1816 MB/s raid6: sse2x1 xor() 1106 MB/s raid6: sse2x2 gen() 3576 MB/s raid6: sse2x2 xor() 1867 MB/s raid6: sse2x4 gen() 5543 MB/s raid6: sse2x4 xor() 3137 MB/s raid6: avx2x1 gen() 3575 MB/s raid6: avx2x1 xor() 2038 MB/s raid6: avx2x2 gen() 6789 MB/s raid6: avx2x2 xor() 3800 MB/s raid6: avx2x4 gen() 10918 MB/s raid6: avx2x4 xor() 6437 MB/s raid6: using algorithm avx2x4 gen() 10918 MB/s raid6: .... xor() 6437 MB/s, rmw enabled raid6: using avx2x2 recovery algorithm ACPI: Added _OSI(Module Device) ACPI: Added _OSI(Processor Device) ACPI: Added _OSI(3.0 _SCP Extensions) ACPI: Added _OSI(Processor Aggregator Device) ACPI: Added _OSI(Linux-Dell-Video) ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio) ACPI: 2 ACPI AML tables successfully acquired and loaded ACPI: Interpreter enabled ACPI: (supports S0 S3 S4 S5) ACPI: Using IOAPIC for interrupt routing PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug ACPI: Enabled 16 GPEs in block 00 to 0F ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff]) acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge. PCI host bridge to bus 0000:00 pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xfebfffff window] pci_bus 0000:00: root bus resource [bus 00-ff] pci 0000:00:01.3: quirk: [io 0xb000-0xb03f] claimed by PIIX4 ACPI ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11) ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11) ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11) ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11) ACPI: PCI Interrupt Link [LNKS] (IRQs *9) vgaarb: loaded SCSI subsystem initialized ACPI: bus type USB registered usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb media: Linux media interface: v0.10 videodev: Linux video capture interface: v2.00 pps_core: LinuxPPS API ver. 1 registered pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti PTP clock support registered EDAC MC: Ver: 3.0.0 Advanced Linux Sound Architecture Driver Initialized. PCI: Using ACPI for IRQ routing Bluetooth: Core ver 2.22 NET: Registered protocol family 31 Bluetooth: HCI device and connection manager initialized Bluetooth: HCI socket layer initialized Bluetooth: L2CAP socket layer initialized Bluetooth: SCO socket layer initialized NET: Registered protocol family 8 NET: Registered protocol family 20 NetLabel: Initializing NetLabel: domain hash size = 128 NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO NetLabel: unlabeled traffic allowed by default nfc: nfc_init: NFC Core ver 0.1 NET: Registered protocol family 39 clocksource: Switched to clocksource kvm-clock VFS: Disk quotas dquot_6.6.0 VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) FS-Cache: Loaded CacheFiles: Loaded pnp: PnP ACPI init pnp: PnP ACPI: found 7 devices clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns NET: Registered protocol family 2 tcp_listen_portaddr_hash hash table entries: 4096 (order: 6, 294912 bytes) TCP established hash table entries: 65536 (order: 7, 524288 bytes) TCP bind hash table entries: 65536 (order: 10, 4194304 bytes) TCP: Hash tables configured (established 65536 bind 65536) UDP hash table entries: 4096 (order: 7, 655360 bytes) UDP-Lite hash table entries: 4096 (order: 7, 655360 bytes) NET: Registered protocol family 1 RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. NET: Registered protocol family 44 pci 0000:00:00.0: Limiting direct PCI/PCI transfers PCI-DMA: Using software bounce buffering for IO (SWIOTLB) software IO TLB: mapped [mem 0xbbffd000-0xbfffd000] (64MB) RAPL PMU: API unit is 2^-32 Joules, 3 fixed counters, 10737418240 ms ovfl timer RAPL PMU: hw unit of domain pp0-core 2^-0 Joules RAPL PMU: hw unit of domain package 2^-0 Joules RAPL PMU: hw unit of domain dram 2^-16 Joules VPID CAP should not exist if not support 1-setting enable VPID VM-execution control kvm: already loaded the other module clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x212735223b2, max_idle_ns: 440795277976 ns Machine check injector initialized check: Scanning for low memory corruption every 60 seconds Initialise system trusted keyrings workingset: timestamp_bits=40 max_order=21 bucket_order=0 zbud: loaded DLM installed squashfs: version 4.0 (2009/01/31) Phillip Lougher FS-Cache: Netfs 'nfs' registered for caching NFS: Registering the id_resolver key type Key type id_resolver registered Key type id_legacy registered nfs4filelayout_init: NFSv4 File Layout Driver Registering... Installing knfsd (copyright (C) 1996 okir@monad.swb.de). ntfs: driver 2.1.32 [Flags: R/W]. fuse init (API version 7.28) JFS: nTxBlock = 8192, nTxLock = 65536 SGI XFS with ACLs, security attributes, realtime, no debug enabled 9p: Installing v9fs 9p2000 file system support FS-Cache: Netfs '9p' registered for caching gfs2: GFS2 installed FS-Cache: Netfs 'ceph' registered for caching ceph: loaded (mds proto 32)