[PATCH v11 8/8] selftests: add openat2(2) selftests

2019-07-27 Thread Aleksa Sarai
Test all of the various openat2(2) flags, as well as how file descriptor re-opening works. A small stress-test of a symlink-rename attack is included to show that the protections against ".."-based attacks are sufficient. In addition, the memfd selftest is fixed to no longer depend on the now-disa

[PATCH v11 7/8] open: openat2(2) syscall

2019-07-27 Thread Aleksa Sarai
The most obvious syscall to add support for the new LOOKUP_* scoping flags would be openat(2). However, there are a few reasons why this is not the best course of action: * The new LOOKUP_* flags are intended to be security features, and openat(2) will silently ignore all unknown flags. This m

[PATCH] Fix typo reigster to register

2019-07-27 Thread Pei Hsuan Hung
Signed-off-by: Pei Hsuan Hung Cc: triv...@kernel.org --- arch/powerpc/kernel/eeh.c | 2 +- arch/powerpc/platforms/cell/spufs/switch.c | 4 ++-- drivers/extcon/extcon-rt8973a.c | 2 +- drivers/gpu/drm/arm/malidp_regs.h | 2 +-

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

2019-07-27 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 v11 5/8] namei: LOOKUP_IN_ROOT: chroot-like path resolution

2019-07-27 Thread Aleksa Sarai
The primary motivation for the need for this flag is container runtimes which have to interact with malicious root filesystems in the host namespaces. One of the first requirements for a container runtime to be secure against a malicious rootfs is that they correctly scope symlinks (that is, they s

[PATCH v11 4/8] namei: O_BENEATH-style path resolution flags

2019-07-27 Thread Aleksa Sarai
Add the following flags to allow various restrictions on path resolution (these affect the *entire* resolution, rather than just the final path component -- as is the case with LOOKUP_FOLLOW). The primary justification for these flags is to allow for programs to be far more strict about how they w

[PATCH v11 3/8] open: O_EMPTYPATH: procfs-less file descriptor re-opening

2019-07-27 Thread Aleksa Sarai
Userspace has made use of /proc/self/fd very liberally to allow for descriptors to be re-opened. There are a wide variety of uses for this feature, but it has always required constructing a pathname and could not be done without procfs mounted. The obvious solution for this is to extend openat(2) t

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

2019-07-27 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

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

2019-07-27 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 v11 0/8] namei: openat2(2) path resolution restrictions

2019-07-27 Thread Aleksa Sarai
This patch is being developed here (with snapshots of each series version being stashed in separate branches with names of the form "resolveat/vX-summary"): Patch changelog: v11: * Fix checkpatch.pl errors and warnings where reasonab

[Bug 200055] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3214 .__lockdep_init_map+0x260/0x270

2019-07-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=200055 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Attachment #280503|0 |1 is obsolete|

[Bug 200055] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3214 .__lockdep_init_map+0x260/0x270

2019-07-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=200055 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Attachment #283679|0 |1 is obsolete|

[Bug 200055] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3214 .__lockdep_init_map+0x260/0x270

2019-07-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=200055 --- Comment #19 from Erhard F. (erhar...@mailbox.org) --- Created attachment 284001 --> https://bugzilla.kernel.org/attachment.cgi?id=284001&action=edit bisect.log At last... I got the offending commit. Funnily enough it is about silencing lock

[PATCH -next 34/34] ASoC: sun8i-codec: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/sunxi/sun8i-codec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/s

[PATCH -next 33/34] ASoC: sunxi: sun50i-codec-analog: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/sunxi/sun50i-codec-analog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/sunxi/sun50i-codec-analog

[PATCH -next 32/34] ASoC: sun8i-codec-analog: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/sunxi/sun8i-codec-analog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/sunxi/sun8i-codec-analog.c

[PATCH -next 31/34] ASoC: xlnx: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/xilinx/xlnx_i2s.c | 4 +--- sound/soc/xilinx/xlnx_spdif.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/so

[PATCH -next 30/34] ASoC: meson: axg-fifo: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/meson/axg-fifo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/a

[PATCH -next 28/34] ASoC: meson: axg-spdifin: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/meson/axg-spdifin.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/meson/axg-spdifin.c b/sound/soc/m

[PATCH -next 29/34] ASoC: meson: axg-spdifout: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/meson/axg-spdifout.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/meson/axg-spdifout.c b/sound/soc

[PATCH -next 27/34] ASoC: meson: axg-pdm: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/meson/axg-pdm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/meson/axg-pdm.c b/sound/soc/meson/axg

[PATCH -next 26/34] ASoC: meson: axg-tdm-formatter: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/meson/axg-tdm-formatter.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/meson/axg-tdm-formatter.c

[PATCH -next 25/34] ASoC: meson: g12a-tohdmitx: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/meson/g12a-tohdmitx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/meson/g12a-tohdmitx.c b/sound/s

[PATCH -next 24/34] ASoC: au1x: psc-i2s: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/au1x/psc-i2s.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-

[PATCH -next 23/34] ASoC: psc-ac97: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/au1x/psc-ac97.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/ps

[PATCH -next 22/34] ASoC: uniphier: aio-dma: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/uniphier/aio-dma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/uniphier/aio-dma.c b/sound/soc/uni

[PATCH -next 21/34] ASoC: uniphier: evea: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/uniphier/evea.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/uniphier/evea.c b/sound/soc/uniphier/

[PATCH -next 20/34] ASoC: inno_rk3036: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/codecs/inno_rk3036.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/inno_rk3036.c b/sound/soc

[PATCH -next 19/34] ASoC: jz4740: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/codecs/jz4740.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz

[PATCH -next 18/34] ASoC: mmp-sspa: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/pxa/mmp-sspa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-ssp

[PATCH -next 17/34] ASoC: codecs: jz4725b: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/codecs/jz4725b.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/

[PATCH -next 16/34] ASoC: codecs: msm8916-wcd: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/codecs/msm8916-wcd-digital.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/msm8916-wcd-digit

[PATCH -next 14/34] ASoC: xtfpga-i2s: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/xtensa/xtfpga-i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/xtensa/xtfpga-i2s.c b/sound/soc/x

[PATCH -next 15/34] ASoC: stm32: sai: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/stm/stm32_sai.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32

[PATCH -next 13/34] ASoC: kirkwood-i2s: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/kirkwood/kirkwood-i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/so

[PATCH -next 12/34] ASoC: spear: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/spear/spdif_in.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear

[PATCH -next 11/34] ASoC: mxs-saif: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/mxs/mxs-saif.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-sa

[PATCH -next 10/34] ASoC: sirf: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/sirf/sirf-usp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/sirf/sirf-usp.c b/sound/soc/sirf/sirf

[PATCH -next 09/34] ASoC: bcm2835-i2s: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/bcm/bcm2835-i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/b

[PATCH -next 08/34] ASoC: fsl_audmix: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/fsl/fsl_audmix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl

[PATCH -next 07/34] ASoC: imx-audmux: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/fsl/imx-audmux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx

[PATCH -next 06/34] ASoC: mt6797: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/mediatek/mt6797/mt6797-afe-pcm.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt6797/mt6

[PATCH -next 05/34] ASoC: mt8173: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/mediatek/mt8173/mt81

[PATCH -next 04/34] ASoC: ep93xx-i2s: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/cirrus/ep93xx-i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/c

[PATCH -next 03/34] ASoC: rockchip: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/codecs/rk3328_codec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/rk3328_codec.c b/sound/s

[PATCH -next 02/34] ASoC: tegra: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/tegra/tegra30_i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/t

[PATCH -next 01/34] ASoC: tegra20_das: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- sound/soc/tegra/tegra20_das.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/tegra/tegra20_das.c b/sound/soc/t

[PATCH -next 00/34] ASoC: use devm_platform_ioremap_resource() to simplify code

2019-07-27 Thread YueHaibing
devm_platform_ioremap_resource() internally have platform_get_resource() and devm_ioremap_resource() in it. So instead of calling them separately use devm_platform_ioremap_resource() directly. YueHaibing (34): ASoC: tegra20_das: use devm_platform_ioremap_resource() to simplify code ASoC: t

Re: [PATCH kernel v3] powerpc/xive: Drop deregistered irqs

2019-07-27 Thread Cédric Le Goater
Hello Alexey, >> --- a/arch/powerpc/kernel/irq.c >> +++ b/arch/powerpc/kernel/irq.c >> @@ -632,10 +632,13 @@ void __do_irq(struct pt_regs *regs) >>   may_hard_irq_enable(); >>     /* And finally process it */ >> -    if (unlikely(!irq)) >> +    if (unlikely(!irq)) { >>   __this_cpu