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

[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

[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 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 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 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 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

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

Re: [PATCH 00/14] Prepare syscall_get_arch for PTRACE_GET_SYSCALL_INFO

2019-02-27 Thread Dmitry V. Levin
On Sat, Feb 09, 2019 at 01:22:19AM +0300, Dmitry V. Levin wrote: > On Thu, Jan 17, 2019 at 03:34:44PM -0500, Richard Guy Briggs wrote: > > On 2019-01-09 15:40, Dmitry V. Levin wrote: > > > syscall_get_arch() is required to be implemented on all architectures in > > >

[PATCH 04/14] h8300: define syscall_get_arch()

2019-02-27 Thread Dmitry V. Levin
-by: Paul Moore Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Yoshinori Sato Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: uclinux-h8-de...@lists.sourceforge.jp Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. arch/h8300

[PATCH 05/14] Move EM_HEXAGON to uapi/linux/elf-em.h

2019-02-27 Thread Dmitry V. Levin
PTRACE_GET_SYSCALL_INFO request. Acked-by: Paul Moore Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Richard Kuo Cc: linux-hexa...@vger.kernel.org Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. arch

[PATCH 06/14] hexagon: define syscall_get_arch()

2019-02-27 Thread Dmitry V. Levin
-by: Paul Moore Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Richard Kuo Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-hexa...@vger.kernel.org Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. arch/hexagon/include/asm

[PATCH 08/14] Move EM_NDS32 to uapi/linux/elf-em.h

2019-02-27 Thread Dmitry V. Levin
request. Acked-by: Paul Moore Cc: Greentime Hu Cc: Vincent Chen Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. arch/nds32/include/asm

[PATCH 09/14] nds32: define syscall_get_arch()

2019-02-27 Thread Dmitry V. Levin
-by: Paul Moore Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Greentime Hu Cc: Vincent Chen Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. arch/nds32/include/asm/syscall.h | 9

[PATCH 10/14] nios2: define syscall_get_arch()

2019-02-27 Thread Dmitry V. Levin
-by: Paul Moore Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Ley Foon Tan Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: nios2-...@lists.rocketboards.org Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. arch/nios2/include/asm

[PATCH 12/14] Move EM_UNICORE to uapi/linux/elf-em.h

2019-02-27 Thread Dmitry V. Levin
PTRACE_GET_SYSCALL_INFO request. Acked-by: Paul Moore Cc: Guan Xuetao Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. arch/unicore32/include/asm/elf.h | 3

[PATCH 13/14] unicore32: define syscall_get_arch()

2019-02-27 Thread Dmitry V. Levin
-by: Paul Moore Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Guan Xuetao Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. arch/unicore32/include/asm/syscall.h | 12

[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

[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: [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: [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 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: [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 > ---

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 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: 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

[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

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

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

[RESEND v3 PATCH 1/3] Documentation: update seq_file

2014-09-29 Thread Dmitry V. Levin
Date: Wed, 17 Oct 2012 20:29:22 +0400 Starting with commit v3.2-rc4-1-g02125a8, seq_path_root() no longer changes the value of root. Starting with commit v3.2-rc7-104-g8c9379e, some arguments of seq_path() and seq_path_root() are const. Signed-off-by: Dmitry V. Levin Acked-by: Rob Landley

[RESEND v3 PATCH 2/3] vfs: cleanup show_mountinfo

2014-09-29 Thread Dmitry V. Levin
esult, the temporary variable "root" in show_mountinfo() that holds a copy of struct path root is no longer needed. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c index 73

[RESEND v3 PATCH 3/3] vfs: make mounts and mountstats honor root dir like mountinfo does

2014-09-29 Thread Dmitry V. Levin
Date: Wed, 17 Oct 2012 20:29:55 +0400 Change show_vfsmnt() and show_vfsstat() to show mountpoints relative to the root directory and skip mountpoints outside of chroot jail the same way as show_mountinfo() does. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 13 +++-- 1 file

Re: [RESEND v3 PATCH 3/3] vfs: make mounts and mountstats honor root dir like mountinfo does

2014-09-29 Thread Dmitry V. Levin
On Mon, Sep 29, 2014 at 07:32:22PM +0100, Al Viro wrote: > On Mon, Sep 29, 2014 at 10:05:23PM +0400, Dmitry V. Levin wrote: > > Date: Wed, 17 Oct 2012 20:29:55 +0400 > > > > Change show_vfsmnt() and show_vfsstat() to show mountpoints relative > > to the root directory a

Re: [RESEND v3 PATCH 3/3] vfs: make mounts and mountstats honor root dir like mountinfo does

2014-09-29 Thread Dmitry V. Levin
On Mon, Sep 29, 2014 at 08:33:29PM +0100, Al Viro wrote: > On Mon, Sep 29, 2014 at 10:43:33PM +0400, Dmitry V. Levin wrote: > > On Mon, Sep 29, 2014 at 07:32:22PM +0100, Al Viro wrote: > > > On Mon, Sep 29, 2014 at 10:05:23PM +0400, Dmitry V. Levin wrote: > > > > D

Re: [RESEND v3 PATCH 3/3] vfs: make mounts and mountstats honor root dir like mountinfo does

2014-09-29 Thread Dmitry V. Levin
On Mon, Sep 29, 2014 at 10:20:57PM +0100, Al Viro wrote: > On Tue, Sep 30, 2014 at 12:26:59AM +0400, Dmitry V. Levin wrote: > > > > Again, we do not break userland. > > > > Occasionally, we do. If you say there was no chroot prefix removal in the > > kerne

[PATCH] x86: use compat version for preadv2 and pwritev2

2016-05-11 Thread Dmitry V. Levin
Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table. This bug was found by strace test suite. Fixes: 4babf2c5efb7 ("x86: wire up preadv2 and pwritev2") Signed-off-by: Dmitry V. Levin --- arch/x86/entry/syscalls/syscall_32.tbl | 4 ++

Re: [PATCH] x86: use compat version for preadv2 and pwritev2

2016-05-11 Thread Dmitry V. Levin
On Wed, May 11, 2016 at 12:14:11PM +0200, Thomas Gleixner wrote: > On Wed, 11 May 2016, Dmitry V. Levin wrote: > > Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries > > in the 32-bit syscall table. > > So this is 2016 and we added a syscalls which r

Re: [PATCH] x86: use compat version for preadv2 and pwritev2

2016-05-12 Thread Dmitry V. Levin
On Thu, May 12, 2016 at 09:30:37AM +0200, Christoph Hellwig wrote: > On Wed, May 11, 2016 at 11:48:17AM +0300, Dmitry V. Levin wrote: > > Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries > > in the 32-bit syscall table. > > > > This bug was

[PATCH] parisc: fix a bug when syscall number of tracee is __NR_Linux_syscalls

2016-04-26 Thread Dmitry V. Levin
trace test suite. Cc: sta...@vger.kernel.org Signed-off-by: Dmitry V. Levin --- arch/parisc/kernel/syscall.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index c976ebf..57b4836 100644 --- a/arch/parisc/kernel/sysca

Re: [PATCH] parisc: fix a bug when syscall number of tracee is __NR_Linux_syscalls

2016-04-26 Thread Dmitry V. Levin
On Tue, Apr 26, 2016 at 10:45:11PM -0400, Mike Frysinger wrote: > On 27 Apr 2016 04:56, Dmitry V. Levin wrote: > > Do not load one entry beyond the end of the syscall table when the > > syscall number of a traced process equals to __NR_Linux_syscalls. > > Similar bug with

[RESEND PATCH] vfs: show_vfsstat: do not ignore errors from show_devname method

2015-11-18 Thread Dmitry V. Levin
Date: Thu, 19 Mar 2015 11:10:54 + Explicitly check show_devname method return code and bail out in case of an error. This fixes regression introduced by commit 9d4d65748a5c. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs

[PATCH 1/3] vfs: show_vfsmnt: remove redundant initialization of error code

2015-11-18 Thread Dmitry V. Levin
As err variable is now always checked right after the first assignment, its initialization is redundant and could be safely removed. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc_namespace.c b/fs

[PATCH 2/3] vfs: show_mountinfo: cleanup error code checks

2015-11-18 Thread Dmitry V. Levin
Check err variable right after each assignment. This change makes initialization of err redundant, so remove the initialization. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/fs/proc_namespace.c

[PATCH 3/3] vfs: show_vfsstat: remove redundant initialization and check of error code

2015-11-18 Thread Dmitry V. Levin
As err variable is now always checked right after each assignment, its initialization is redundant and could be safely removed. For the same reason, the last check of err is also redundant and could be removed as well. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 5 ++--- 1 file

[PATCH] x86/signal: fix restart_syscall number for x32 tasks

2015-11-30 Thread Dmitry V. Levin
/tests/restart_syscall.test Reported-and-tested-by: Elvira Khabirova Signed-off-by: Dmitry V. Levin Cc: sta...@vger.kernel.org --- arch/x86/kernel/signal.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c

[RESEND PATCH 4/4] vfs: show_vfsstat: remove redundant initialization and check of error code

2015-12-02 Thread Dmitry V. Levin
Date: Wed, 18 Nov 2015 21:09:45 + As err variable is now always checked right after each assignment, its initialization is redundant and could be safely removed. For the same reason, the last check of err is also redundant and could be removed as well. Signed-off-by: Dmitry V. Levin

[RESEND PATCH 3/4] vfs: show_mountinfo: cleanup error code checks

2015-12-02 Thread Dmitry V. Levin
Wed, 18 Nov 2015 21:08:33 + Check err variable right after each assignment. This change makes initialization of err redundant, so remove the initialization. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions

[RESEND PATCH 2/4] vfs: show_vfsmnt: remove redundant initialization of error code

2015-12-02 Thread Dmitry V. Levin
Date: Wed, 18 Nov 2015 21:07:10 + As err variable is now always checked right after the first assignment, its initialization is redundant and could be safely removed. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[RESEND v2 PATCH 1/4] vfs: show_vfsstat: do not ignore errors from show_devname method

2015-12-02 Thread Dmitry V. Levin
Date: Thu, 19 Mar 2015 11:10:54 + Explicitly check show_devname method return code and bail out in case of an error. This fixes regression introduced by commit 9d4d65748a5c. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs

Re: [PATCH] x86/signal: fix restart_syscall number for x32 tasks

2015-12-12 Thread Dmitry V. Levin
On Mon, Dec 07, 2015 at 03:22:06PM -0800, Andy Lutomirski wrote: > [not real reply because I'm using a bad internet connection right now > and I'm not set up with my usual Gmane reply hack right now] > > The new code is (whitespace-damaged): > > static inline unsigned long get_nr_restart_syscall(

[PATCH] sh64: fix __NR_fgetxattr

2015-12-08 Thread Dmitry V. Levin
According to arch/sh/kernel/syscalls_64.S and common sense, __NR_fgetxattr has to be defined to 259, but it doesn't. Instead, it's defined to 269, which is of course used by another syscall, __NR_sched_setaffinity in this case. This bug was found by strace test suite. Signed-off-by

[PATCH] unix_diag: fix incorrect sign extension in unix_lookup_by_ino

2016-02-18 Thread Dmitry V. Levin
ts to incorrect comparison on 64-bit architectures for inode numbers greater than INT_MAX. This bug was found by strace test suite. Signed-off-by: Dmitry V. Levin Cc: --- net/unix/diag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/unix/diag.c b/net/unix/diag.c index c5

[RESEND v3 PATCH] vfs: show_vfsstat: do not ignore errors from show_devname method

2016-02-18 Thread Dmitry V. Levin
Date: Thu, 19 Mar 2015 11:10:54 + Explicitly check show_devname method return code and bail out in case of an error. This fixes regression introduced by commit 9d4d65748a5c. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs

Re: [PATCH] seccomp: cap SECCOMP_RET_ERRNO data to MAX_ERRNO

2015-02-06 Thread Dmitry V. Levin
> ignored by userspace. Acked-by: Dmitry V. Levin -- ldv -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: a method to distinguish between syscall-enter/exit-stop

2015-02-06 Thread Dmitry V. Levin
On Fri, Feb 06, 2015 at 12:07:03PM -0800, Kees Cook wrote: > On Fri, Feb 6, 2015 at 11:32 AM, Andy Lutomirski wrote: > > On Fri, Feb 6, 2015 at 11:23 AM, Kees Cook wrote: [...] > >> And an unrelated thought: > >> > >> 3) Can't we find some way to fix the inability of a ptracer to > >> distinguish

Re: a method to distinguish between syscall-enter/exit-stop

2015-02-06 Thread Dmitry V. Levin
On Fri, Feb 06, 2015 at 05:07:41PM -0800, Kees Cook wrote: > On Fri, Feb 6, 2015 at 3:17 PM, Dmitry V. Levin wrote: > > On Fri, Feb 06, 2015 at 12:07:03PM -0800, Kees Cook wrote: > >> On Fri, Feb 6, 2015 at 11:32 AM, Andy Lutomirski > >> wrote: > >> > On

Re: [PATCH v5 3/5] x86: Split syscall_trace_enter into two phases

2015-02-05 Thread Dmitry V. Levin
Hi, On Fri, Sep 05, 2014 at 03:13:54PM -0700, Andy Lutomirski wrote: > This splits syscall_trace_enter into syscall_trace_enter_phase1 and > syscall_trace_enter_phase2. Only phase 2 has full pt_regs, and only > phase 2 is permitted to modify any of pt_regs except for orig_ax. This breaks ptrace,

Re: [PATCH v5 3/5] x86: Split syscall_trace_enter into two phases

2015-02-05 Thread Dmitry V. Levin
On Thu, Feb 05, 2015 at 01:27:16PM -0800, Kees Cook wrote: > On Thu, Feb 5, 2015 at 1:19 PM, Dmitry V. Levin wrote: > > Hi, > > > > On Fri, Sep 05, 2014 at 03:13:54PM -0700, Andy Lutomirski wrote: > >> This splits syscall_trace_enter into

Re: [PATCH v5 3/5] x86: Split syscall_trace_enter into two phases

2015-02-05 Thread Dmitry V. Levin
On Thu, Feb 05, 2015 at 03:12:39PM -0800, Kees Cook wrote: > On Thu, Feb 5, 2015 at 1:52 PM, Andy Lutomirski wrote: > > On Thu, Feb 5, 2015 at 1:40 PM, Dmitry V. Levin wrote: > >> On Thu, Feb 05, 2015 at 01:27:16PM -0800, Kees Cook wrote: > >>> On Thu, Feb 5, 20

Re: [PATCH v5 3/5] x86: Split syscall_trace_enter into two phases

2015-02-05 Thread Dmitry V. Levin
On Thu, Feb 05, 2015 at 04:09:06PM -0800, Andy Lutomirski wrote: > On Thu, Feb 5, 2015 at 3:49 PM, Kees Cook wrote: > > On Thu, Feb 5, 2015 at 3:39 PM, Dmitry V. Levin wrote: [...] > >> There is a clear difference: before these changes, SECCOMP_RET_ERRNO used > >>

[RESEND v4 PATCH] Documentation: update seq_file

2014-12-15 Thread Dmitry V. Levin
. Signed-off-by: Dmitry V. Levin Acked-by: Rob Landley --- Documentation/filesystems/seq_file.txt | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/filesystems/seq_file.txt b/Documentation/filesystems/seq_file.txt index b797ed3..9de4303 100644 --- a

[RESEND v4 PATCH 1/2] vfs: cleanup show_mountinfo

2014-12-15 Thread Dmitry V. Levin
esult, the temporary variable "root" in show_mountinfo() that holds a copy of struct path root is no longer needed. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c index 73

[RESEND v4 PATCH 2/2] vfs: make mounts and mountstats honor root dir like mountinfo does

2014-12-15 Thread Dmitry V. Levin
As we already show mountpoints relative to the root directory, thanks to the change made back in 2000, change show_vfsmnt() and show_vfsstat() to skip out-of-root mountpoints the same way as show_mountinfo() does. Signed-off-by: Dmitry V. Levin --- fs/proc_namespace.c | 13 +++-- 1 file

Re: [PATCH 8/8] Use __kernel_long_t in struct mq_attr

2015-11-23 Thread Dmitry V. Levin
On Fri, Dec 27, 2013 at 02:14:24PM -0800, H.J. Lu wrote: > Both x32 and x86-64 use the same struct mq_attr for system calls. But > x32 long is 32-bit. This patch replaces long with __kernel_long_t in > struct mq_attr. > > Signed-off-by: H.J. Lu > --- > include/uapi/linux/mqueue.h | 10 +

[PATCH v2 11/13] Move EM_UNICORE to uapi/linux/elf-em.h

2019-03-17 Thread Dmitry V. Levin
PTRACE_GET_SYSCALL_INFO request. Acked-by: Paul Moore Cc: Guan Xuetao Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- Notes: v2: unchanged arch/unicore32/include/asm/elf.h | 3 +-- include/uapi/linux/elf

Re: [RESEND PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2019-03-19 Thread Dmitry V. Levin
On Tue, Mar 19, 2019 at 12:19:57PM -0700, Andrei Vagin wrote: > There are a few system calls (pselect, ppoll, etc) which replace a task > sigmask while they are running in a kernel-space > > When a task calls one of these syscalls, the kernel saves a current > sigmask in task->saved_sigmask and se

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: [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 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 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 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

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 00/14] Prepare syscall_get_arch for PTRACE_GET_SYSCALL_INFO

2019-02-08 Thread Dmitry V. Levin
On Thu, Jan 17, 2019 at 03:34:44PM -0500, Richard Guy Briggs wrote: > On 2019-01-09 15:40, Dmitry V. Levin wrote: > > syscall_get_arch() is required to be implemented on all architectures in > > order > > to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request:

[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

[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 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 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 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 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

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 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 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

[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

[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 +++---

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/

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: [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 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: > > >

[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

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

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

[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: [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/

[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

[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

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

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

[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

[PATCH 00/14] Prepare syscall_get_arch for PTRACE_GET_SYSCALL_INFO

2019-01-09 Thread Dmitry V. Levin
on all architectures. All patches from this patchset have been already reviewed, so it's ready to be merged without waiting for the ptrace-specific part. As it's all about syscall_get_arch(), it should probably go via audit tree. Dmitry V. Levin (14): Move EM_ARCOMPACT and

<    1   2   3   4   5   >