[PATCH RESEND v11 6/8] namei: aggressively check for nd->root escape on ".." resolution

2019-08-20 Thread Aleksa Sarai
This patch allows for LOOKUP_BENEATH and LOOKUP_IN_ROOT to safely permit ".." resolution (in the case of LOOKUP_BENEATH the resolution will still fail if ".." resolution would resolve a path outside of the root -- while LOOKUP_IN_ROOT will chroot(2)-style scope it). Magic-link jumps are still disal

[PATCH RESEND v11 1/8] namei: obey trailing magic-link DAC permissions

2019-08-20 Thread Aleksa Sarai
The ability for userspace to "re-open" file descriptors through /proc/self/fd has been a very useful tool for all sorts of usecases (container runtimes are one common example). However, the current interface for doing this has resulted in some pretty subtle security holes. Userspace can re-open a f

[PATCH RESEND v11 2/8] procfs: switch magic-link modes to be more sane

2019-08-20 Thread Aleksa Sarai
Now that magic-link modes are obeyed for file re-opening purposes, some of the pre-existing magic-link modes need to be adjusted to be more semantically correct. The most blatant example of this is /proc/self/exe, which had a mode of a+rwx even though tautologically the file could never be opened

Re: [PATCH 2/3] of_pmem: Add memory ranges which took a mce to bad range

2019-08-20 Thread Oliver O'Halloran
On Tue, Aug 20, 2019 at 12:30 PM Santosh Sivaraj wrote: > > Subscribe to the MCE notification and add the physical address which > generated a memory error to nvdimm bad range. Uh... I should have looked a bit closer at this on v1. a) of_pmem.c isn't part of the powerpc tree. You should have CCe

[PATCH v11 7/7] powerpc: add machine check safe copy_to_user

2019-08-20 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig in

[PATCH v11 6/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-08-20 Thread Santosh Sivaraj
From: Balbir Singh The pmem infrastructure uses memcpy_mcsafe in the pmem layer so as to convert machine check exceptions into a return value on failure in case a machine check exception is encountered during the memcpy. The return value is the number of bytes remaining to be copied. This patch

[PATCH v11 5/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-20 Thread Santosh Sivaraj
From: Balbir Singh If we take a UE on one of the instructions with a fixup entry, set nip to continue execution at the fixup entry. Stop processing the event further or print it. Co-developed-by: Reza Arbab Signed-off-by: Reza Arbab Signed-off-by: Balbir Singh Reviewed-by: Mahesh Salgaonkar

[PATCH v11 4/7] extable: Add function to search only kernel exception table

2019-08-20 Thread Santosh Sivaraj
Certain architecture specific operating modes (e.g., in powerpc machine check handler that is unable to access vmalloc memory), the search_exception_tables cannot be called because it also searches the module exception tables if entry is not found in the kernel exception table. Cc: Thomas Gleixner

[PATCH v11 3/7] powerpc/mce: Make machine_check_ue_event() static

2019-08-20 Thread Santosh Sivaraj
From: Reza Arbab The function doesn't get used outside this file, so make it static. Signed-off-by: Reza Arbab Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH v11 2/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-20 Thread Santosh Sivaraj
From: Balbir Singh The current code would fail on huge pages addresses, since the shift would be incorrect. Use the correct page shift value returned by __find_linux_pte() to get the correct physical address. The code is more generic and can handle both regular and compound pages. Fixes: ba41e1e

[PATCH v11 1/7] powerpc/mce: Schedule work from irq_work

2019-08-20 Thread Santosh Sivaraj
schedule_work() cannot be called from MCE exception context as MCE can interrupt even in interrupt disabled context. fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") Reviewed-by: Mahesh Salgaonkar Reviewed-by: Nicholas Piggin Acked-by: Balbir Singh Signed-off-by: Santosh Siv

[PATCH v11 0/7] powerpc: implement machine check safe memcpy

2019-08-20 Thread Santosh Sivaraj
During a memcpy from a pmem device, if a machine check exception is generated we end up in a panic. In case of fsdax read, this should only result in a -EIO. Avoid MCE by implementing memcpy_mcsafe. Before this patch series: ``` bash-4.4# mount -o dax /dev/pmem0 /mnt/pmem/ [ 7621.714094] Disablin

Re: [PATCH 1/3] powerpc/64: __ioremap_at clean up in the error case

2019-08-20 Thread Christophe Leroy
Hi Nick, Le 10/06/2019 à 05:08, Nicholas Piggin a écrit : __ioremap_at error handling is wonky, it requires caller to clean up after it. Implement a helper that does the map and error cleanup and remove the requirement from the caller. Signed-off-by: Nicholas Piggin --- This series is a diffe

[PATCH] powerpc/Makefile: Always pass --synthetic to nm if supported

2019-08-20 Thread Michael Ellerman
Back in 2004 we added logic to arch/ppc64/Makefile to pass the --synthetic option to nm, if it was supported by nm. Then in 2005 when arch/ppc64 and arch/ppc were merged, the logic to add --synthetic was moved inside an #ifdef CONFIG_PPC64 block within arch/powerpc/Makefile, and has remained there

Re: [PATCH v2] mm: hwpoison: disable memory error handling on 1GB hugepage

2019-08-20 Thread Wanpeng Li
Cc Mel Gorman, Kirill, Dave Hansen, On Tue, 11 Jun 2019 at 07:51, Naoya Horiguchi wrote: > > On Wed, May 29, 2019 at 04:31:01PM -0700, Mike Kravetz wrote: > > On 5/28/19 2:49 AM, Wanpeng Li wrote: > > > Cc Paolo, > > > Hi all, > > > On Wed, 14 Feb 2018 at 06:34, Mike Kravetz > > > wrote: > > >>

<    1   2