From 60040c29c5e93404030b7058fd08920a2350b705 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 15 Feb 2023 18:39:41 +0800 Subject: [PATCH] [fixme!] a hack applied to skip ramoops pmsg write user date exception. [ 13.702813][ T1] file system registered [ 13.905931][ T156] Unable to handle kernel paging request at virtual address ffff80000bc00013 [ 13.919148][ T156] Mem abort info: [ 13.926204][ T156] ESR = 0x0000000096000061 [ 13.934130][ T156] EC = 0x25: DABT (current EL), IL = 32 bits [ 13.943647][ T156] SET = 0, FnV = 0 [ 13.950792][ T156] EA = 0, S1PTW = 0 [ 13.958046][ T156] FSC = 0x21: alignment fault [ 13.966206][ T156] Data abort info: [ 13.973200][ T156] ISV = 0, ISS = 0x00000061 [ 13.981146][ T156] CM = 0, WnR = 1 [ 13.988232][ T156] swapper pgtable: 4k pages, 48-bit VAs, pgdp=00000000a2e80000 [ 13.999244][ T156] [ffff80000bc00013] pgd=10000001fffff003, p4d=10000001fffff003, pud=10000001ffffe003, pmd=1000000100de5003, pte=006800009da00f0f [ 14.019729][ T156] Internal error: Oops: 0000000096000061 [#1] PREEMPT SMP [ 14.030265][ T156] Modules linked in: [ 14.037488][ T156] CPU: 6 PID: 156 Comm: servicemanager Tainted: G W 6.2.0-rc8-01153-ge547a3f8ffed-dirty #397 875419ac35738882635cc222f82d9ee02b2c1883 [ 14.059663][ T156] Hardware name: Qualcomm Technologies, Inc. SM7125 IDP (DT) [ 14.070537][ T156] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 14.081867][ T156] pc : __arch_copy_from_user+0xc0/0x230 [ 14.090929][ T156] lr : persistent_ram_update_user+0x124/0x224 [ 14.100508][ T156] sp : ffff80000ce33b30 [ 14.108115][ T156] x29: ffff80000ce33b30 x28: ffff0000872c6600 x27: 0000000000000000 [ 14.119681][ T156] x26: 0000000000000000 x25: 000000000000000b x24: ffff000080d5d900 [ 14.131254][ T156] x23: 000000000000000b x22: 0000000000000007 x21: 000000000000000b [ 14.142832][ T156] x20: ffff80000bc00013 x19: 0000fffff0da2528 x18: ffff80000a5ab2f0 [ 14.154425][ T156] x17: 0000000000000028 x16: 0000000000009063 x15: 0000fffff0da2528 [ 14.166039][ T156] x14: 00000000ffffffff x13: 00000000000419c0 x12: 0000000000040000 [ 14.177660][ T156] x11: 000000000001ffff x10: ffff0000872c6fe0 x9 : ffff80000ac1f330 [ 14.189309][ T156] x8 : ffff0000872c6600 x7 : 0000000048590358 x6 : ffff80000bc00013 [ 14.200950][ T156] x5 : ffff80000bc0001e x4 : 0000fffff0da2528 x3 : df0000000d009c02 [ 14.212598][ T156] x2 : 000000000000000b x1 : 0000fffff0da2530 x0 : ffff80000bc00013 [ 14.224267][ T156] Call trace: [ 14.231087][ T156] __arch_copy_from_user+0xc0/0x230 [ 14.239896][ T156] persistent_ram_write_user+0x74/0x10c [ 14.249053][ T156] ramoops_pstore_write_user+0x34/0x50 [ 14.258143][ T156] write_pmsg+0xd0/0x120 [ 14.265962][ T156] do_iter_write+0x174/0x200 [ 14.274156][ T156] vfs_writev+0x70/0xc0 [ 14.281895][ T156] do_writev+0x74/0x130 [ 14.289648][ T156] __arm64_sys_writev+0x20/0x30 [ 14.298098][ T156] invoke_syscall+0x48/0x114 [ 14.306307][ T156] el0_svc_common.constprop.0+0x60/0x11c [ 14.315580][ T156] do_el0_svc+0x38/0xc0 [ 14.323367][ T156] el0_svc+0x48/0xc0 [ 14.330843][ T156] el0t_64_sync_handler+0xb8/0xbc [ 14.339493][ T156] el0t_64_sync+0x194/0x198 [ 14.347606][ T156] Code: a88120c7 36180082 f8400823 91002021 (f80084c3) [ 14.358230][ T156] ---[ end trace 0000000000000000 ]--- [ 14.372981][ T156] Kernel panic - not syncing: Oops: Fatal exception [ 14.383267][ T156] SMP: stopping secondary CPUs [ 14.391731][ T156] Kernel Offset: 0x80000 from 0xffff800008000000 [ 14.401761][ T156] PHYS_OFFSET: 0x80000000 [ 14.409742][ T156] CPU features: 0x80000,040a0108,cc00720b [ 14.419163][ T156] Memory Limit: none [ 14.432312][ T156] Rebooting in 5 seconds.. --- fs/pstore/pmsg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c index 55f139afa327b9..66364a39011c31 100644 --- a/fs/pstore/pmsg.c +++ b/fs/pstore/pmsg.c @@ -17,6 +17,8 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf, struct pstore_record record; int ret; + return -EFAULT; + if (!count) return 0;