root@hikey:obj64$ while true; do ./mmap-cow 199 200 ; RET=`echo $?`; [ $RET -ne 0 ] && break ; done
Thread 95 (pid=12149): Pattern verified Thread 106 (pid=12160): Pattern verified Thread 178 (pid=12232): Pattern verified Thread 156 (pid=12210): Pattern verified Thread 159 (pid=12213): Pattern verified Thread 63 (pid=12117): Pattern verified Thread 184 (pid=12238): Pattern verified Thread 189 (pid=12243): Pattern verified Thread 198 (pid=12252): Pattern verified Thread 115 (pid=12169): Pattern verified Thread 145 (pid=12199) FAIL: Corruption at 0x4000002e24c0; Got d, Expected � Thread 117 (pid=12171): Pattern verified Thread 195 (pid=12249): Pattern verified Thread 52 (pid=12106): Pattern verified Thread 31 (pid=12085): Pattern verified Thread 169 (pid=12223): Pattern verified
Not sure I'm happy reproducing this...
but looks like we might have hit a bug for 4.14 on hikey (or even on arm64). It took quite sometime for me to reproduce this AND I was able to make it happen just once... which means we might have a race causing COW code to allow a PRIVATE only page to mess with the original page when mapping it.. will have to open a bug for this... and can't say its related to latest 4.14 only since this is intermittent and really hard to cause...
Opened:
https://bugs.linaro.org/show_bug.cgi?id=4052
For this bug.
I have also caught this:
Nov 5 12:02:54 hikey kernel: [ 22.148194] Unbalanced enable for IRQ 44 Nov 5 12:02:54 hikey kernel: [ 22.152193] ------------[ cut here ]------------ Nov 5 12:02:54 hikey kernel: [ 22.156872] WARNING: CPU: 2 PID: 509 at /home/inaddy/work/sources/linux/stable/stable-linux-4.14.y/kernel/ irq/manage.c:525 __enable_irq+0x78/0x80 Nov 5 12:02:54 hikey kernel: [ 22.169931] Modules linked in: ebtable_filter devlink ebtables ip6table_filter ip6_tables iptable_filter cpufreq_powersave cpufreq_conservative cpufreq_userspace cpufreq_ondemand fuse arc4 bridge stp llc wl18xx wlcore nls_ascii nls_cp437 mac80211 vfat fat cfg80211 snd_soc_hdmi_codec rfkill cdc_ether usbnet r8152 mii sd_mod sg aes_ce_blk crypto_simd cryptd aes_ce_cipher ghash_ce gf128mul aes_arm64 sha2_ce sha256_arm64 adv7511 sha1_ce kirin_drm hi6210_i2s drm_kms_helper snd_soc_core wlcore_sdio snd_pcm_dmaengine snd_pcm snd_timer snd dw_drm_dsi soundcore k3dma efi_pstore hisi_thermal drm efivars cpufreq_dt leds_gpio efivarfs ip_tables x_tables autofs4 uas usb_storage btrfs xor zstd_decompress zstd_compress xxhash raid6_pq dwc2 clk_hi655x hi655x_regulator udc_core usbcore dw_mmc_k3 phy_hi6220_usb dw_mmc_pltfm Nov 5 12:02:54 hikey kernel: [ 22.242048] dw_mmc i2c_designware_platform i2c_designware_core fixed hi655x_pmic Nov 5 12:02:54 hikey kernel: [ 22.249606] CPU: 2 PID: 509 Comm: kworker/2:2 Not tainted 4.14.79 #1 Nov 5 12:02:54 hikey kernel: [ 22.255975] Hardware name: HiKey Development Board (DT) Nov 5 12:02:54 hikey kernel: [ 22.261248] Workqueue: events_freezable thermal_zone_device_check Nov 5 12:02:54 hikey kernel: [ 22.267368] task: ffff8000616e0e00 task.stack: ffff00000b5f0000 Nov 5 12:02:54 hikey kernel: [ 22.273312] PC is at __enable_irq +0x78/0x80 Nov 5 12:02:54 hikey kernel: [ 22.277516] LR is at __enable_irq +0x78/0x80 Nov 5 12:02:54 hikey kernel: [ 22.281718] pc : [<ffff00000813e010>] lr : [<ffff00000813e010>] pstate: 000001c5 Nov 5 12:02:54 hikey kernel: [ 22.289129] sp : ffff00000b5f3c80 Nov 5 12:02:54 hikey kernel: [ 22.292457] x29: ffff00000b5f3c80 x28: 0000000000000000
And opened:
https://bugs.linaro.org/show_bug.cgi?id=4053
For this one.
o/