Re: [PATCH v1] proc/vmcore: fix clearing user buffer by properly using clear_user()

2021-11-11 Thread Baoquan He
On 11/11/21 at 08:18pm, David Hildenbrand wrote: > To clear a user buffer we cannot simply use memset, we have to use > clear_user(). Using a kernel config based on rawhide Fedora and a > virtio-mem device that registers a vmcore_cb, I can easily trigger: > > [ 11.327580] systemd[1]: Starting

Re: [PATCH v1] proc/vmcore: don't fake reading zeroes on surprise vmcore_cb unregistration

2021-11-11 Thread Baoquan He
On 11/11/21 at 08:22pm, David Hildenbrand wrote: > In commit cc5f2704c934 ("proc/vmcore: convert oldmem_pfn_is_ram callback > to more generic vmcore callbacks"), we added detection of surprise > vmcore_cb unregistration after the vmcore was already opened. Once > detected, we warn the user and

[PATCH v1] proc/vmcore: don't fake reading zeroes on surprise vmcore_cb unregistration

2021-11-11 Thread David Hildenbrand
In commit cc5f2704c934 ("proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks"), we added detection of surprise vmcore_cb unregistration after the vmcore was already opened. Once detected, we warn the user and simulate reading zeroes from that point on when accessing

[PATCH v1] proc/vmcore: fix clearing user buffer by properly using clear_user()

2021-11-11 Thread David Hildenbrand
To clear a user buffer we cannot simply use memset, we have to use clear_user(). Using a kernel config based on rawhide Fedora and a virtio-mem device that registers a vmcore_cb, I can easily trigger: [ 11.327580] systemd[1]: Starting Kdump Vmcore Save Service... [ 11.339697] kdump[420]: