[PATCH v3] selftests/ptrace/get_syscall_info: fix for MIPS n32

2025-06-02 Thread Dmitry V. Levin
est on all 64-bit architectures by choosing constants that don't fit into 32-bit integers. Signed-off-by: Dmitry V. Levin Acked-by: Shuah Khan --- v3: Added Acked-by: https://lore.kernel.org/all/b2e62143-fa68-4cd1-bf6c-67f0ad49c...@linuxfoundation.org/ v2: Fixed MIPS #i

Re: [PATCH v2] selftests/ptrace/get_syscall_info: fix for MIPS n32

2025-06-02 Thread Dmitry V. Levin
On Sat, Mar 29, 2025 at 02:02:28PM +, Maciej W. Rozycki wrote: > On Sat, 29 Mar 2025, Dmitry V. Levin wrote: > > > > > +#if defined(_MIPS_SIM) && _MIPS_SIM == _MIPS_SIM_NABI32 > > > > +/* > > > > + * MIPS N32 is the only architecture whe

Re: [PATCH v2] selftests/ptrace/get_syscall_info: fix for MIPS n32

2025-03-29 Thread Dmitry V. Levin
On Fri, Mar 28, 2025 at 05:04:54PM -0600, Shuah Khan wrote: > On 1/15/25 16:37, Dmitry V. Levin wrote: > > MIPS n32 is one of two ILP32 architectures supported by the kernel > > that have 64-bit syscall arguments (another one is x32). > > > > When this test passed

Re: [PATCH v2] selftests/ptrace/get_syscall_info: fix for MIPS n32

2025-03-26 Thread Dmitry V. Levin
Could somebody pick up this patch, please? Nothing has changed since v2, so I have nothing new to add. v2: https://lore.kernel.org/all/20250115233747.ga28...@strace.io/ On Thu, Jan 16, 2025 at 01:37:47AM +0200, Dmitry V. Levin wrote: > MIPS n32 is one of two ILP32 architectures supported by

[PATCH v7 3/6] syscall.h: introduce syscall_set_nr()

2025-03-03 Thread Dmitry V. Levin
. Signed-off-by: Dmitry V. Levin Tested-by: Charlie Jenkins Reviewed-by: Charlie Jenkins Acked-by: Helge Deller # parisc Reviewed-by: Maciej W. Rozycki # mips --- arch/arc/include/asm/syscall.h| 11 +++ arch/arm/include/asm/syscall.h| 24 arch

[PATCH v6 3/6] syscall.h: introduce syscall_set_nr()

2025-02-17 Thread Dmitry V. Levin
. Signed-off-by: Dmitry V. Levin Tested-by: Charlie Jenkins Reviewed-by: Charlie Jenkins Acked-by: Helge Deller # parisc --- arch/arc/include/asm/syscall.h| 11 +++ arch/arm/include/asm/syscall.h| 24 arch/arm64/include/asm/syscall.h | 16

[PATCH v5 4/7] syscall.h: introduce syscall_set_nr()

2025-02-10 Thread Dmitry V. Levin
. Signed-off-by: Dmitry V. Levin Tested-by: Charlie Jenkins Reviewed-by: Charlie Jenkins Acked-by: Helge Deller # parisc --- arch/arc/include/asm/syscall.h| 11 +++ arch/arm/include/asm/syscall.h| 24 arch/arm64/include/asm/syscall.h | 16

[PATCH v4 4/7] syscall.h: introduce syscall_set_nr()

2025-02-02 Thread Dmitry V. Levin
. Signed-off-by: Dmitry V. Levin Tested-by: Charlie Jenkins Reviewed-by: Charlie Jenkins --- arch/arc/include/asm/syscall.h| 11 +++ arch/arm/include/asm/syscall.h| 24 arch/arm64/include/asm/syscall.h | 16 arch/hexagon

Re: [PATCH v3 3/6] syscall.h: introduce syscall_set_nr()

2025-01-28 Thread Dmitry V. Levin
On Tue, Jan 28, 2025 at 04:13:52PM +0100, Christophe Leroy wrote: > Le 28/01/2025 à 10:16, Dmitry V. Levin a écrit : > > Similar to syscall_set_arguments() that complements > > syscall_get_arguments(), introduce syscall_set_nr() > > that complements syscall_get_nr(). > &g

[PATCH v3 3/6] syscall.h: introduce syscall_set_nr()

2025-01-28 Thread Dmitry V. Levin
. Signed-off-by: Dmitry V. Levin Tested-by: Charlie Jenkins Reviewed-by: Charlie Jenkins --- arch/arc/include/asm/syscall.h| 11 +++ arch/arm/include/asm/syscall.h| 24 arch/arm64/include/asm/syscall.h | 16 arch/hexagon

[PATCH v3 6/6] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO

2025-01-28 Thread Dmitry V. Levin
Check whether PTRACE_SET_SYSCALL_INFO semantics implemented in the kernel matches userspace expectations. Signed-off-by: Dmitry V. Levin --- tools/testing/selftests/ptrace/Makefile | 2 +- .../selftests/ptrace/set_syscall_info.c | 514 ++ 2 files changed, 515

[PATCH v2] selftests/ptrace/get_syscall_info: fix for MIPS n32

2025-01-15 Thread Dmitry V. Levin
7;t fit into 32-bit integers. Signed-off-by: Dmitry V. Levin --- v2: Fixed MIPS #ifdef. .../selftests/ptrace/get_syscall_info.c | 53 +++ 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/ptrace/get_syscall_info.c b/tools/testing/s

[PATCH] selftests/ptrace/get_syscall_info: fix for MIPS n32

2025-01-15 Thread Dmitry V. Levin
7;t fit into 32-bit integers. Signed-off-by: Dmitry V. Levin --- .../selftests/ptrace/get_syscall_info.c | 53 +++ 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/ptrace/get_syscall_info.c b/tools/testing/selftests/ptrace/get_sysca

[PATCH v2 7/7] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO

2025-01-13 Thread Dmitry V. Levin
Check whether PTRACE_SET_SYSCALL_INFO semantics implemented in the kernel matches userspace expectations. Signed-off-by: Dmitry V. Levin --- tools/testing/selftests/ptrace/Makefile | 2 +- .../selftests/ptrace/set_syscall_info.c | 441 ++ 2 files changed, 442

[PATCH v2 4/7] syscall.h: introduce syscall_set_nr()

2025-01-13 Thread Dmitry V. Levin
. Signed-off-by: Dmitry V. Levin --- arch/arc/include/asm/syscall.h| 11 +++ arch/arm/include/asm/syscall.h| 24 arch/arm64/include/asm/syscall.h | 16 arch/hexagon/include/asm/syscall.h| 7 +++ arch/loongarch/include

Re: [PATCH 3/6] syscall.h: introduce syscall_set_nr()

2025-01-10 Thread Dmitry V. Levin
On Fri, Jan 10, 2025 at 08:37:46AM +0100, Sven Schnelle wrote: > "Dmitry V. Levin" writes: > > > Similar to syscall_set_arguments() that complements > > syscall_get_arguments(), introduce syscall_set_nr() > > that complements syscall_get_nr(). > > > >

[PATCH] selftests: harness: fix printing of mismatch values in __EXPECT()

2025-01-08 Thread Dmitry V. Levin
2-bit build warnings") Signed-off-by: Dmitry V. Levin --- tools/testing/selftests/kselftest_harness.h | 24 ++--- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index a5

[PATCH 6/6] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO

2025-01-07 Thread Dmitry V. Levin
Check whether PTRACE_SET_SYSCALL_INFO semantics implemented in the kernel matches userspace expectations. Signed-off-by: Dmitry V. Levin --- tools/testing/selftests/ptrace/Makefile | 2 +- .../selftests/ptrace/set_syscall_info.c | 436 ++ 2 files changed, 437

[PATCH 3/6] syscall.h: introduce syscall_set_nr()

2025-01-07 Thread Dmitry V. Levin
. Signed-off-by: Dmitry V. Levin --- arch/arc/include/asm/syscall.h| 6 ++ arch/arm/include/asm/syscall.h| 12 arch/arm64/include/asm/syscall.h | 7 +++ arch/hexagon/include/asm/syscall.h| 7 +++ arch/loongarch/include/asm/syscall.h | 7

[PATCH 1/6] Revert "arch: remove unused function syscall_set_arguments()"

2025-01-07 Thread Dmitry V. Levin
commits. This reverts commit 7962c2eddbfe7cce879acb06f9b4f205789e57b7. Signed-off-by: Dmitry V. Levin --- arch/nios2/include/asm/syscall.h | 11 arch/openrisc/include/asm/syscall.h | 7 ++ arch/powerpc/include/asm/syscall.h| 10 arch/riscv/include/asm/syscall.h

Re: [PATCH v4 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2024-12-26 Thread Dmitry V. Levin
On Thu, Dec 26, 2024 at 06:52:52PM +0800, Celeste Liu wrote: > This test checks that orig_a0 allows a syscall argument to be modified, > and that changing a0 does not change the syscall argument. > > Co-developed-by: Quan Zhou > Signed-off-by: Quan Zhou > Co-developed-by: Charlie Jenkins > Sign

Re: [PATCH 1/2] uprobe: Change uretprobe syscall scope and number

2024-07-24 Thread Dmitry V. Levin
On Fri, Jul 12, 2024 at 03:52:27PM +0200, Jiri Olsa wrote: > After discussing with Arnd [1] it's preferable to change uretprobe > syscall number to 467 to omit the merge conflict with xattrat syscalls. > > Also changing the ABI to 'common' which will ease up the global > scripts/syscall.tbl manage

Re: [PATCH v23 3/5] tracing: Allow user-space mapping of the ring-buffer

2024-07-02 Thread Dmitry V. Levin
On Tue, Jul 02, 2024 at 11:18:07AM -0400, Steven Rostedt wrote: > On Tue, 2 Jul 2024 10:36:03 -0400 > Mathieu Desnoyers wrote: > > > > I can send a patch this week to update it. Or feel free to send a patch > > > yourself. > > > > You need to reserve an unused ioctl Code and Seq# range within:

Re: [PATCH v23 3/5] tracing: Allow user-space mapping of the ring-buffer

2024-07-02 Thread Dmitry V. Levin
On Tue, Jul 02, 2024 at 11:32:53AM -0400, Mathieu Desnoyers wrote: [...] > Note that user events also has this issue: the ioctl is not reserved in > the ioctl-number.rst list. See include/uapi/linux/user_events.h: > > #define DIAG_IOC_MAGIC '*' > > /* Request to register a user_event */ > #define

[PATCH] uapi: change TRACE_MMAP_IOCTL_GET_READER to avoid collision with TCGETS

2024-06-30 Thread Dmitry V. Levin
hange the value of TRACE_MMAP_IOCTL_GET_READER a bit to avoid this collision. Given that _IO('T', 0x1) is _IOC(_IOC_NONE, 'T', 0x1, 0), something like _IOC(_IOC_NONE, 'T', 0x1, 0x1) should be OK. Fixes: cf9f0f7c4c5bb ("tracing: Allow user-space mapping of t

Re: [PATCH v23 3/5] tracing: Allow user-space mapping of the ring-buffer

2024-06-30 Thread Dmitry V. Levin
On Fri, May 10, 2024 at 03:04:32PM +0100, Vincent Donnefort wrote: [...] > diff --git a/include/uapi/linux/trace_mmap.h b/include/uapi/linux/trace_mmap.h > index b682e9925539..bd1066754220 100644 > --- a/include/uapi/linux/trace_mmap.h > +++ b/include/uapi/linux/trace_mmap.h > @@ -43,4 +43,6 @@ str

Re: Linux include/uapi/linux/libc-compat.h and Musl include/netinet/in.h incompatibility for __UAPI_DEF_IN6_ADDR_ALT

2021-03-29 Thread Dmitry V. Levin
Hi, On Tue, Mar 30, 2021 at 12:30:52PM +1300, Chris Packham wrote: > Hi, > > I've come over from https://github.com/strace/strace/issues/177 > there's a bit of context there. > > Crosstool-ng has hit a problem when building a recent enough version > of strace in a configuration that uses musl li

Re: [PATCH] ia64: fix ia64_syscall_get_set_arguments() for break-based syscalls

2021-03-03 Thread Dmitry V. Levin
dler already enforces locals=0 and fixes `break`. > > Tested on v5.10 on rx3600 machine (ia64 9040 CPU). > > CC: Oleg Nesterov > CC: linux-i...@vger.kernel.org > CC: linux-kernel@vger.kernel.org > CC: Andrew Morton > Reported-by: Dmitry V. Levin > Bug: https://bu

Re: [PATCH] ia64: fix ptrace(PTRACE_SYSCALL_INFO_EXIT) sign

2021-03-03 Thread Dmitry V. Levin
On Wed, Mar 03, 2021 at 03:30:19PM +0100, Oleg Nesterov wrote: > On 03/02, Sergei Trofimovich wrote: > > > > > --- a/arch/ia64/include/asm/syscall.h > > > +++ b/arch/ia64/include/asm/syscall.h > > > @@ -32,7 +32,7 @@ static inline void syscall_rollback(struct task_struct > > > *task, > > > static

Re: [PATCH] ia64: fix ptrace(PTRACE_SYSCALL_INFO_EXIT) sign

2021-03-03 Thread Dmitry V. Levin
> } > > Tested on v5.10 on rx3600 machine (ia64 9040 CPU). > > CC: linux-i...@vger.kernel.org > CC: linux-kernel@vger.kernel.org > CC: Andrew Morton > Reported-by: Dmitry V. Levin > Bug: https://bugs.gentoo.org/769614 > Signed-off-by: Sergei Trofimovich > ---

[PATCH] uapi: nfnetlink_cthelper.h: fix userspace compilation error

2021-02-22 Thread Dmitry V. Levin
Apparently, and could not be included into the same compilation unit because of a cut-and-paste typo in the former header. Fixes: 12f7a505331e6 ("netfilter: add user-space connection tracking helper infrastructure") Cc: # v3.6 Signed-off-by: Dmitry V. Levin --- include/uapi/linux

Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-22 Thread Dmitry V. Levin
On Mon, Feb 22, 2021 at 09:53:10AM -0500, Mathieu Desnoyers wrote: > - On Feb 22, 2021, at 6:57 AM, Dmitry V. Levin l...@altlinux.org wrote: > > On Mon, Feb 22, 2021 at 11:04:43AM +0100, Piotr Figiel wrote: [...] > >> +#ifdef CONFIG_RSEQ > >> +static long ptrace_ge

Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-22 Thread Dmitry V. Levin
On Mon, Feb 22, 2021 at 11:04:43AM +0100, Piotr Figiel wrote: [...] > --- a/include/uapi/linux/ptrace.h > +++ b/include/uapi/linux/ptrace.h > @@ -102,6 +102,14 @@ struct ptrace_syscall_info { > }; > }; > > +#define PTRACE_GET_RSEQ_CONFIGURATION0x420f > + > +struct ptrace_rseq_confi

[PATCH v2] sparc: make copy_thread honor pid namespaces

2021-02-19 Thread Dmitry V. Levin
current: 10002, parent: 10001, fork returned: 10001 current: 10001, parent: 1, fork returned: 10003 current: 1, parent: 0, fork returned: 10001 This bug was found by strace test suite. Cc: Eric W. Biederman Cc: sta...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- v2: Replaced ta

[PATCH] sparc: make copy_thread honor pid namespaces

2021-02-17 Thread Dmitry V. Levin
_exit(0); err(1, "wait"); } return !WIFEXITED(status) || WEXITSTATUS(status) != 0; } EOF $ sh -c ./a.out current: 10001, parent: 1, fork returned: 10002 current: 1, parent: 0, fork returned: 10001 Cc: Eric W. Biederman Cc: sta...@vger.kernel.org Signed-off-b

Re: [PATCH] fs/nsfs.c: fix ioctl support of compat processes

2020-09-07 Thread Dmitry V. Levin
and the example in ioctl_ns(2) manual page doesn't work when e.g. it's compiled with -m32 on a 64-bit kernel. > "Dmitry V. Levin" writes: > > On Fri, Jul 24, 2020 at 11:20:26AM +0200, Arnd Bergmann wrote: > >> On Fri, Jul 24, 2020 at 2:12 AM Dmitry V. Levin w

Re: [Linux-kernel-mentees] [PATCH v3] ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info()

2020-08-01 Thread Dmitry V. Levin
syscall_info`. > > Cc: sta...@vger.kernel.org > Fixes: 201766a20e30 ("ptrace: add PTRACE_GET_SYSCALL_INFO request") > Suggested-by: Dan Carpenter > Signed-off-by: Peilin Ye > --- > Change in v3: > - Remove unnecessary `__aligned__` attribute. (Suggested

Re: [Linux-kernel-mentees] [PATCH v2] ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info()

2020-08-01 Thread Dmitry V. Levin
gt; doing memset() on `info`. (Suggested by Dmitry V. Levin > ) > > Reference: https://lwn.net/Articles/417989/ > > $ # before: > $ pahole -C "ptrace_syscall_info" kernel/ptrace.o > struct ptrace_syscall_info { > __u8

Re: [Linux-kernel-mentees] [PATCH] ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info()

2020-07-31 Thread Dmitry V. Levin
On Mon, Jul 27, 2020 at 05:36:44PM -0400, Peilin Ye wrote: > ptrace_get_syscall_info() is copying uninitialized stack memory to > userspace due to the compiler not initializing holes in statically > allocated structures. Fix it by initializing `info` with memset(). > > Cc: sta...@vger.kernel.org >

Re: [PATCH] fs/nsfs.c: fix ioctl support of compat processes

2020-07-24 Thread Dmitry V. Levin
On Fri, Jul 24, 2020 at 11:20:26AM +0200, Arnd Bergmann wrote: > On Fri, Jul 24, 2020 at 2:12 AM Dmitry V. Levin wrote: > > > > According to Documentation/driver-api/ioctl.rst, in order to support > > 32-bit user space running on a 64-bit kernel, each subsystem or driver &

[PATCH] fs/nsfs.c: fix ioctl support of compat processes

2020-07-23 Thread Dmitry V. Levin
iptor") Cc: sta...@vger.kernel.org # v4.9+ Signed-off-by: Dmitry V. Levin --- fs/nsfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nsfs.c b/fs/nsfs.c index 800c1d0eb0d0..a00236bffa2c 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -21,6 +21,7 @@ static long ns_ioctl(struct file *filp, unsigned int

[PATCH] s390: fix syscall_get_error for compat processes

2020-06-02 Thread Dmitry V. Levin
ce changes") Cc: Elvira Khabirova Cc: sta...@vger.kernel.org # v2.6.28+ Signed-off-by: Dmitry V. Levin --- arch/s390/include/asm/syscall.h | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.

Re: [PATCH 2/4] seccomp: add two missing ptrace ifdefines

2019-09-19 Thread Dmitry V. Levin
On Thu, Sep 19, 2019 at 09:55:30AM -0700, Kees Cook wrote: > On Thu, Sep 19, 2019 at 01:42:51PM +0300, Dmitry V. Levin wrote: > > On Wed, Sep 18, 2019 at 10:33:09AM -0700, Kees Cook wrote: > > > This is actually fixed in -next already (and, yes, with the Fixes line > &g

Re: [PATCH 2/4] seccomp: add two missing ptrace ifdefines

2019-09-19 Thread Dmitry V. Levin
On Wed, Sep 18, 2019 at 10:33:09AM -0700, Kees Cook wrote: > On Wed, Sep 18, 2019 at 11:15:12AM +0200, Tyler Hicks wrote: > > On 2019-09-18 10:48:31, Christian Brauner wrote: > > > Add tw missing ptrace ifdefines to avoid compilation errors on systems > > > that do not provide PTRACE_EVENTMSG_SYSCA

Re: [PATCH v2] fork: check exit_signal passed in clone3() call

2019-09-11 Thread Dmitry V. Levin
On Wed, Sep 11, 2019 at 04:54:47PM +0200, Christian Brauner wrote: > On Wed, Sep 11, 2019 at 03:32:13PM +0100, Eugene Syromiatnikov wrote: > > On Wed, Sep 11, 2019 at 04:16:36PM +0200, Christian Brauner wrote: > > > On Wed, Sep 11, 2019 at 03:52:36PM +0200, Christian Brauner wrote: > > > > On Wed,

Re: [PATCH] fork: fail on non-zero higher 32 bits of args.exit_signal

2019-09-10 Thread Dmitry V. Levin
re's no sane reason to accept them. > > * kernel/fork.c (copy_clone_args_from_user): Fail with -EINVAL if > args.exit_signal converted to unsigned int is not equal to the original > value. > > Signed-off-by: Eugene Syromiatnikov Reviewed-by: Dmitry V. Levin -- ldv

Re: [ptrace] 201766a20e: kernel_selftests.seccomp.make_fail

2019-08-05 Thread Dmitry V. Levin
On Mon, Jul 29, 2019 at 05:35:30PM +0800, kernel test robot wrote: > FYI, we noticed the following commit (built with gcc-7): > > commit: 201766a20e30f982ccfe36bebfad9602c3ff574a ("ptrace: add > PTRACE_GET_SYSCALL_INFO request") > https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/

Re: [PATCH 09/16] sparc64: use the generic get_user_pages_fast code

2019-07-17 Thread Dmitry V. Levin
On Wed, Jul 17, 2019 at 03:04:56PM -0700, Linus Torvalds wrote: > On Wed, Jul 17, 2019 at 2:59 PM Dmitry V. Levin wrote: > > > > So this ended up as commit 7b9afb86b6328f10dc2cad9223d7def12d60e505 > > (thanks to Anatoly for bisecting) and introduced a regression: > >

Re: [PATCH 09/16] sparc64: use the generic get_user_pages_fast code

2019-07-17 Thread Dmitry V. Levin
Hi, On Tue, Jun 25, 2019 at 04:37:08PM +0200, Christoph Hellwig wrote: > The sparc64 code is mostly equivalent to the generic one, minus various > bugfixes and two arch overrides that this patch adds to pgtable.h. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Khalid Aziz > --- > arch/spa

[PATCH v2] clone: fix CLONE_PIDFD support

2019-07-14 Thread Dmitry V. Levin
("fork: add clone3") Bisected-and-tested-by: Anatoly Pugachev Signed-off-by: Dmitry V. Levin --- arch/x86/ia32/sys_ia32.c | 4 include/linux/sched/task.h | 1 + kernel/fork.c | 17 +++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/arc

Re: [PATCH] clone: fix CLONE_PIDFD support

2019-07-14 Thread Dmitry V. Levin
On Sun, Jul 14, 2019 at 04:23:05PM +0200, Christian Brauner wrote: > On Sun, Jul 14, 2019 at 05:10:08PM +0300, Dmitry V. Levin wrote: > > On Sun, Jul 14, 2019 at 02:17:25PM +0200, Christian Brauner wrote: > > > On Sun, Jul 14, 2019 at 03:02:06PM +0300, Dmitry V. Levin

Re: [PATCH] clone: fix CLONE_PIDFD support

2019-07-14 Thread Dmitry V. Levin
On Sun, Jul 14, 2019 at 02:17:25PM +0200, Christian Brauner wrote: > On Sun, Jul 14, 2019 at 03:02:06PM +0300, Dmitry V. Levin wrote: > > The introduction of clone3 syscall accidentally broke CLONE_PIDFD > > support in traditional clone syscall on compat x86 and those > > a

[PATCH] clone: fix CLONE_PIDFD support

2019-07-14 Thread Dmitry V. Levin
("fork: add clone3") Bisected-and-tested-by: Anatoly Pugachev Signed-off-by: Dmitry V. Levin --- arch/x86/ia32/sys_ia32.c | 1 + kernel/fork.c| 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index 64a6c952091e..98754baf4

[PATCH] selftests/seccomp/seccomp_bpf: update for PTRACE_GET_SYSCALL_INFO

2019-07-08 Thread Dmitry V. Levin
The syscall entry/exit is now exposed via PTRACE_GETEVENTMSG, update the test accordingly. Reported-by: kernel test robot Signed-off-by: Dmitry V. Levin --- tools/testing/selftests/seccomp/seccomp_bpf.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools

Re: [PATCH 1/2] CLONE_PIDFD: do not use the value pointed by parent_tidptr

2019-06-24 Thread Dmitry V. Levin
On Mon, Jun 24, 2019 at 01:59:43PM +0200, Christian Brauner wrote: > On Mon, Jun 24, 2019 at 11:49:40AM +0200, Christian Brauner wrote: > > On Sun, Jun 23, 2019 at 02:27:17PM +0300, Dmitry V. Levin wrote: > > > Userspace needs a cheap and reliable way to tell whether CLONE_PIDFD

Re: [PATCH] samples: make pidfd-metadata fail gracefully on older kernels

2019-06-23 Thread Dmitry V. Levin
On Sat, Jun 22, 2019 at 12:13:39AM +0200, Christian Brauner wrote: [...] > Out of curiosity: what makes the new flag different than say > CLONE_NEWCGROUP or any new clone flag that got introduced? > CLONE_NEWCGROUP too would not be detectable apart from the method I gave > you above; same for other

[PATCH 2/2] samples: make pidfd-metadata fail gracefully on older kernels

2019-06-23 Thread Dmitry V. Levin
Initialize pidfd to an invalid descriptor, to fail gracefully on those kernels that do not implement CLONE_PIDFD and leave pidfd unchanged. Signed-off-by: Dmitry V. Levin --- samples/pidfd/pidfd-metadata.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/pidfd

[PATCH 1/2] CLONE_PIDFD: do not use the value pointed by parent_tidptr

2019-06-23 Thread Dmitry V. Levin
to extend legacy clone syscall this way. So remove the pidfd == 0 check. Userspace that needs to be portable to kernels without CLONE_PIDFD support is advised to initialize pidfd with -1 and check the pidfd value returned by CLONE_PIDFD. Signed-off-by: Dmitry V. Levin --- kernel/f

Re: [PATCH] samples: make pidfd-metadata fail gracefully on older kernels

2019-06-21 Thread Dmitry V. Levin
On Thu, Jun 20, 2019 at 01:10:37PM +0200, Christian Brauner wrote: > On Thu, Jun 20, 2019 at 02:00:37PM +0300, Dmitry V. Levin wrote: > > Cc'ed more people as the issue is not just with the example but > > with the interface itself. > > > > On Thu, Jun 20, 201

Re: [PATCH] samples: make pidfd-metadata fail gracefully on older kernels

2019-06-20 Thread Dmitry V. Levin
Cc'ed more people as the issue is not just with the example but with the interface itself. On Thu, Jun 20, 2019 at 12:31:06PM +0200, Christian Brauner wrote: > On Thu, Jun 20, 2019 at 06:11:44AM +0300, Dmitry V. Levin wrote: > > Initialize pidfd to an invalid descriptor, to fail

[PATCH] samples: make pidfd-metadata fail gracefully on older kernels

2019-06-19 Thread Dmitry V. Levin
Initialize pidfd to an invalid descriptor, to fail gracefully on those kernels that do not implement CLONE_PIDFD and leave pidfd unchanged. Signed-off-by: Dmitry V. Levin --- samples/pidfd/pidfd-metadata.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/pidfd

Re: strace for m68k bpf_prog_info mismatch

2019-05-21 Thread Dmitry V. Levin
Hi Baruch, Geert, Could you share these findings with bpf and netdev people, please? On Fri, May 03, 2019 at 02:16:04PM +0200, Geert Uytterhoeven wrote: > Hi Baruch, > > On Fri, May 3, 2019 at 1:52 PM Baruch Siach wrote: > > On Fri, May 03 2019, Geert Uytterhoeven wrote: > > > On Fri, May 3, 20

Re: [PATCH 0/4] uapi, vfs: Change the mount API UAPI [ver #2]

2019-05-16 Thread Dmitry V. Levin
[looks like linux-abi is a typo, Cc'ed linux-api instead] On Thu, May 16, 2019 at 05:50:22PM +0100, Al Viro wrote: > [linux-abi cc'd] > > On Thu, May 16, 2019 at 06:31:52PM +0200, Christian Brauner wrote: > > On Thu, May 16, 2019 at 05:22:59PM +0100, Al Viro wrote: > > > On Thu, May 16, 2019 at 1

[PATCH v11 3/7] mips: define syscall_get_error()

2019-05-10 Thread Dmitry V. Levin
-by: Paul Burton Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Ralf Baechle Cc: James Hogan Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-m...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v11: unchanged v10: unchanged v9: unchanged v8: unchanged v7

[PATCH v11 4/7] parisc: define syscall_get_error()

2019-05-10 Thread Dmitry V. Levin
-by: Helge Deller # parisc Cc: James E.J. Bottomley Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-par...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v11: unchanged v10: unchanged v9: unchanged v8: added Acked-by from

[PATCH v11 2/7] hexagon: define syscall_get_error() and syscall_get_return_value()

2019-05-10 Thread Dmitry V. Levin
: Richard Kuo Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-hexa...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Richard, this patch is waiting for ACK since November. Notes: v11: unchanged v10: unchanged v9: unchanged v8

[PATCH v11 5/7] powerpc: define syscall_get_error()

2019-05-10 Thread Dmitry V. Levin
-by: Michael Ellerman Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Notes: v11: added Acked-by from https://lore.kernel.org/lkml

[PATCH v11 6/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-05-10 Thread Dmitry V. Levin
el exceeds the size specified by "addr" argument, the output is truncated. Co-authored-by: Dmitry V. Levin Reviewed-by: Oleg Nesterov Reviewed-by: Kees Cook Cc: Andy Lutomirski Cc: Eugene Syromyatnikov Cc: linux-...@vger.kernel.org Cc: strace-de...@lists.strace.io Signed-off

[PATCH v11 7/7] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO

2019-05-10 Thread Dmitry V. Levin
Check whether PTRACE_GET_SYSCALL_INFO semantics implemented in the kernel matches userspace expectations. Acked-by: Shuah Khan Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linux-kselft...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes

[PATCH v11 1/7] nds32: fix asm/syscall.h

2019-05-10 Thread Dmitry V. Levin
. Reported-by: kbuild test robot Fixes: 1932fbe36e02 ("nds32: System calls handling") Acked-by: Greentime Hu Cc: Vincent Chen Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Signed-off-by: Dmitry V. Levin --- Notes: v11: unchanged v10: a

Re: [GIT PULL] arch: add pidfd and io_uring syscalls everywhere

2019-04-23 Thread Dmitry V. Levin
Hi, On Tue, Apr 23, 2019 at 09:28:48PM +0200, Arnd Bergmann wrote: > The following changes since commit 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b: > > Linux 5.1-rc1 (2019-03-17 14:22:26 -0700) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/arnd/

[PATCH linux-next v10 7/7] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO

2019-04-15 Thread Dmitry V. Levin
Check whether PTRACE_GET_SYSCALL_INFO semantics implemented in the kernel matches userspace expectations. Acked-by: Shuah Khan Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linux-kselft...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes

[PATCH linux-next v10 6/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-04-15 Thread Dmitry V. Levin
el exceeds the size specified by "addr" argument, the output is truncated. Co-authored-by: Dmitry V. Levin Reviewed-by: Oleg Nesterov Reviewed-by: Kees Cook Cc: Andy Lutomirski Cc: Eugene Syromyatnikov Cc: linux-...@vger.kernel.org Cc: strace-de...@lists.strace.io Signed-off

[PATCH linux-next v10 5/7] powerpc: define syscall_get_error()

2019-04-15 Thread Dmitry V. Levin
: Michael Ellerman Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Michael, this patch is waiting for ACK since early December. Notes: v10

[PATCH linux-next v10 3/7] mips: define syscall_get_error()

2019-04-15 Thread Dmitry V. Levin
-by: Paul Burton Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Ralf Baechle Cc: James Hogan Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-m...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v10: unchanged v9: unchanged v8: unchanged v7: added Acked-by v6

[PATCH linux-next v10 2/7] hexagon: define syscall_get_error() and syscall_get_return_value()

2019-04-15 Thread Dmitry V. Levin
: Richard Kuo Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-hexa...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Richard, this patch is waiting for ACK since November. Notes: v10: unchanged v9: unchanged v8: moved syscall_get_arch

[PATCH linux-next v10 1/7] nds32: fix asm/syscall.h

2019-04-15 Thread Dmitry V. Levin
. Reported-by: kbuild test robot Fixes: 1932fbe36e02 ("nds32: System calls handling") Acked-by: Greentime Hu Cc: Vincent Chen Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Signed-off-by: Dmitry V. Levin --- Notes: v10: added Acked-by v

[PATCH linux-next v10 4/7] parisc: define syscall_get_error()

2019-04-15 Thread Dmitry V. Levin
-by: Helge Deller # parisc Cc: James E.J. Bottomley Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-par...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v10: unchanged v9: unchanged v8: added Acked-by v7: unchanged

Re: [PATCH linux-next v9 7/7] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO

2019-04-08 Thread Dmitry V. Levin
On Mon, Apr 08, 2019 at 11:51:45AM -0600, shuah wrote: > On 4/8/19 11:42 AM, Dmitry V. Levin wrote: > > Check whether PTRACE_GET_SYSCALL_INFO semantics implemented in the kernel > > matches userspace expectations. > > > > Cc: Oleg Nesterov > > Cc: Andy Lutom

[PATCH linux-next v9 7/7] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO

2019-04-08 Thread Dmitry V. Levin
Check whether PTRACE_GET_SYSCALL_INFO semantics implemented in the kernel matches userspace expectations. Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Shuah Khan Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linux-kselft...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v9

[PATCH linux-next v9 6/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-04-08 Thread Dmitry V. Levin
el exceeds the size specified by "addr" argument, the output is truncated. Co-authored-by: Dmitry V. Levin Reviewed-by: Oleg Nesterov Reviewed-by: Kees Cook Cc: Andy Lutomirski Cc: Eugene Syromyatnikov Cc: linux-...@vger.kernel.org Cc: strace-de...@lists.strace.io Signed-off

[PATCH linux-next v9 4/7] parisc: define syscall_get_error()

2019-04-08 Thread Dmitry V. Levin
-by: Helge Deller # parisc Cc: James E.J. Bottomley Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-par...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v9: unchanged v8: added Acked-by v7: unchanged v6: unchanged v5

[PATCH linux-next v9 3/7] mips: define syscall_get_error()

2019-04-08 Thread Dmitry V. Levin
-by: Paul Burton Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Ralf Baechle Cc: James Hogan Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-m...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v9: unchanged v8: unchanged v7: added Acked-by v6: unchanged v5

[PATCH linux-next v9 1/7] nds32: fix asm/syscall.h

2019-04-08 Thread Dmitry V. Levin
. Reported-by: kbuild test robot Fixes: 1932fbe36e02 ("nds32: System calls handling") Cc: Greentime Hu Cc: Vincent Chen Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Signed-off-by: Dmitry V. Levin --- Dear nds32 maintainers, this fix is waiti

[PATCH linux-next v9 2/7] hexagon: define syscall_get_error() and syscall_get_return_value()

2019-04-08 Thread Dmitry V. Levin
: Richard Kuo Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-hexa...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Richard, this patch is waiting for ACK since November. Notes: v9: unchanged v8: moved syscall_get_arch to separate audit

Re: linux-next: manual merge of the audit tree with Linus' tree

2019-04-08 Thread Dmitry V. Levin
On Mon, Apr 08, 2019 at 11:31:31AM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the audit tree got conflicts in: > > arch/mips/kernel/ptrace.c > kernel/seccomp.c > > between commit: > > b35f549df1d7 ("syscalls: Remove start and number from > syscall_get_argume

Re: [PATCH 3/6 v3] riscv: Fix syscall_get_arguments() and syscall_set_arguments()

2019-04-04 Thread Dmitry V. Levin
On Mon, Apr 01, 2019 at 09:41:07AM -0400, Steven Rostedt wrote: > From: "Dmitry V. Levin" > > RISC-V syscall arguments are located in orig_a0,a1..a5 fields > of struct pt_regs. > > Due to an off-by-one bug and a bug in pointer arithmetic > syscall_get_argume

Re: [PATCH 4/6 v3] csky: Fix syscall_get_arguments() and syscall_set_arguments()

2019-04-04 Thread Dmitry V. Levin
On Mon, Apr 01, 2019 at 09:41:08AM -0400, Steven Rostedt wrote: > From: "Dmitry V. Levin" > > C-SKY syscall arguments are located in orig_a0,a1,a2,a3,regs[0],regs[1] > fields of struct pt_regs. > > Due to an off-by-one bug and a bug in pointer arithmetic > sysc

Re: [PATCH v5 13/25] m68k: add asm/syscall.h

2019-03-29 Thread Dmitry V. Levin
On Wed, Dec 12, 2018 at 11:55:16AM +0300, Dmitry V. Levin wrote: > On Mon, Dec 10, 2018 at 04:30:25PM +0300, Dmitry V. Levin wrote: > > On Mon, Dec 10, 2018 at 02:06:28PM +0100, Geert Uytterhoeven wrote: > > > On Mon, Dec 10, 2018 at 1:41 PM Dmitry V. Levin wrote: > > >

Re: [RFC][PATCH 0/4 v2] sycalls: Remove args i and n from syscall_get_arguments()

2019-03-29 Thread Dmitry V. Levin
On Fri, Mar 29, 2019 at 11:12:18AM -0700, Linus Torvalds wrote: > On Fri, Mar 29, 2019 at 10:40 AM Steven Rostedt wrote: > > > > I'll keep it around for now, but this should go as a warning to Dmitry, > > to get something using it soon, or they may be dropped. > > I don't think _that_ is the argu

Re: [PATCH] riscv: fix syscall_get_arguments() and syscall_set_arguments()

2019-03-29 Thread Dmitry V. Levin
On Fri, Mar 29, 2019 at 01:15:14PM -0400, Steven Rostedt wrote: > On Fri, 29 Mar 2019 20:12:21 +0300 > "Dmitry V. Levin" wrote: > > > RISC-V syscall arguments are located in orig_a0,a1..a5 fields > > of struct pt_regs. > > > > Due to an off

Re: [PATCH] riscv: fix syscall_get_arguments() and syscall_set_arguments()

2019-03-29 Thread Dmitry V. Levin
On Fri, Mar 29, 2019 at 01:56:35PM -0400, Steven Rostedt wrote: > On Fri, 29 Mar 2019 18:52:18 +0100 > David Abdurachmanov wrote: > > > I have alternative version posted in December part of SECCOMP > > patchset which is based on arm64 implementation. > > > > http://lists.infradead.org/pipermail/

[PATCH] riscv: fix syscall_get_arguments() and syscall_set_arguments()

2019-03-29 Thread Dmitry V. Levin
: e2c0cdfba7f69 ("RISC-V: User-facing API") Cc: Steven Rostedt Cc: Ingo Molnar Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Cc: linux-ri...@lists.infradead.org Cc: sta...@vger.kernel.org # v4.15+ Signed-off-by: Dmitry V. Levin --- arch/riscv/include/asm/syscall.h | 12 +++---

[PATCH] csky: fix syscall_get_arguments() and syscall_set_arguments()

2019-03-29 Thread Dmitry V. Levin
instead. Fixes: 4859bfca11c7d ("csky: System Call") Cc: Steven Rostedt Cc: Ingo Molnar Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Cc: sta...@vger.kernel.org # v4.20+ Signed-off-by: Dmitry V. Levin --- arch/csky/include/asm/syscall.h | 10 ++ 1 file changed, 6 insert

Re: [PATCH v2] x86/syscalls: Mark expected switch fall-throughs

2019-03-27 Thread Dmitry V. Levin
On Wed, Mar 27, 2019 at 11:52:19PM +0100, Thomas Gleixner wrote: > On Thu, 28 Mar 2019, Dmitry V. Levin wrote: > > On Wed, Mar 27, 2019 at 03:29:16PM +0100, Thomas Gleixner wrote: > > > On Wed, 27 Mar 2019, Dmitry V. Levin wrote: > > > > On Tue, Mar 26, 2019 at 0

Re: [PATCH v2] x86/syscalls: Mark expected switch fall-throughs

2019-03-27 Thread Dmitry V. Levin
On Wed, Mar 27, 2019 at 03:29:16PM +0100, Thomas Gleixner wrote: > On Wed, 27 Mar 2019, Dmitry V. Levin wrote: > > On Tue, Mar 26, 2019 at 04:12:45PM +0100, Oleg Nesterov wrote: > > > On 03/23, Thomas Gleixner wrote: > > [...] > > > > 2) syscall_set_arguments(

Re: [PATCH v2] x86/syscalls: Mark expected switch fall-throughs

2019-03-26 Thread Dmitry V. Levin
On Tue, Mar 26, 2019 at 04:12:45PM +0100, Oleg Nesterov wrote: > On 03/23, Thomas Gleixner wrote: [...] > > 2) syscall_set_arguments() has been introduced in 2008 and we still have > > no caller. Instead of polishing it, can it be removed completely or are > > there plans to actually use i

Re: [PATCH] csky: Update syscall_trace_enter/exit implementation

2019-03-25 Thread Dmitry V. Levin
On Mon, Mar 25, 2019 at 08:41:54PM +0800, Guo Ren wrote: > On Mon, Mar 25, 2019 at 03:17:54PM +0300, Dmitry V. Levin wrote: > > On Mon, Mar 25, 2019 at 08:03:39PM +0800, guo...@kernel.org wrote: > > [...] > > > diff --git a/arch/csky/include/uapi/asm/ptrace.h > >

Re: [PATCH] csky: Update syscall_trace_enter/exit implementation

2019-03-25 Thread Dmitry V. Levin
On Mon, Mar 25, 2019 at 08:03:39PM +0800, guo...@kernel.org wrote: [...] > diff --git a/arch/csky/include/uapi/asm/ptrace.h > b/arch/csky/include/uapi/asm/ptrace.h > index a4eaa8d..9bf5b1a 100644 > --- a/arch/csky/include/uapi/asm/ptrace.h > +++ b/arch/csky/include/uapi/asm/ptrace.h > @@ -62,6 +62

[PATCH linux-next v8 6/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-03-21 Thread Dmitry V. Levin
el exceeds the size specified by "addr" argument, the output is truncated. Co-authored-by: Dmitry V. Levin Reviewed-by: Oleg Nesterov Reviewed-by: Kees Cook Cc: Andy Lutomirski Cc: Eugene Syromyatnikov Cc: linux-...@vger.kernel.org Cc: strace-de...@lists.strace.io Signed-off

  1   2   3   4   5   >