[PATCH 3/3] uapi: fix scsi/scsi_bsg_fc.h userspace compilation errors

2017-02-28 Thread Dmitry V. Levin
ype name 'uint32_t' uint32_t msgcode; /usr/include/scsi/scsi_bsg_fc.h:306:2: error: unknown type name 'uint32_t' uint32_t result; /usr/include/scsi/scsi_bsg_fc.h:309:2: error: unknown type name 'uint32_t' uint32_t reply_payload_rcv_len; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- inc

[PATCH] uapi: fix linux/nfsd/cld.h userspace compilation errors

2017-02-28 Thread Dmitry V. Levin
/cld.h:49:2: error: unknown type name 'uint32_t' uint32_t cm_xid; /* transaction id */ /usr/include/linux/nfsd/cld.h:51:3: error: unknown type name 'int64_t' int64_t cm_gracetime; /* grace period start time */ Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/linux/nfsd

[PATCH 2/3] uapi: fix scsi/scsi_netlink_fc.h userspace compilation errors

2017-02-28 Thread Dmitry V. Levin
(not in a function) } __attribute__((aligned(sizeof(uint64_t; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/scsi/scsi_netlink_fc.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/uapi/scsi/scsi_netlink_fc.h b/include/uap

[PATCH 1/3] uapi: fix scsi/scsi_netlink.h userspace compilation errors

2017-02-28 Thread Dmitry V. Levin
/scsi/scsi_netlink.h:48:33: error: 'uint64_t' undeclared here (not in a function) } __attribute__((aligned(sizeof(uint64_t; /usr/include/scsi/scsi_netlink.h:92:2: error: expected specifier-qualifier-list before 'uint64_t' uint64_t vendor_id; Signed-off-by: Dmitry V. Levin <l...@altlinux.

[PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

2017-02-28 Thread Dmitry V. Levin
' undeclared (first use in this function) return NULL; Suggested-by: Jeff Mahoney <je...@suse.com> Signed-off-by: Dmitry V. Levin <l...@altlinux.org> Reviewed-by: David Sterba <dste...@suse.com> --- v3: the patch seems to be lost, resending with updated list of addr

Re: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

2017-03-02 Thread Dmitry V. Levin
On Thu, Mar 02, 2017 at 12:42:12PM +0100, David Sterba wrote: > On Wed, Mar 01, 2017 at 03:54:35PM +0100, David Sterba wrote: > > On Wed, Mar 01, 2017 at 02:12:50AM +0300, Dmitry V. Levin wrote: > > > btrfs_err_str function is not called from anywhere and is replicated >

[PATCH] uapi: fix asm/ipcbuf.h userspace compilation errors

2017-02-26 Thread Dmitry V. Levin
-generic/ipcbuf.h:30:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused1; /usr/include/asm-generic/ipcbuf.h:31:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused2; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/asm-g

Re: + uapi-fix-linux-sysctlh-userspace-compilation-errors.patch added to -mm tree

2017-02-27 Thread Dmitry V. Levin
On Sat, Feb 25, 2017 at 01:35:51AM +0300, Dmitry V. Levin wrote: > On Fri, Feb 24, 2017 at 05:35:33PM +0300, Alexey Dobriyan wrote: > > On Thu, Feb 23, 2017 at 02:44:31PM -0800, a...@linux-foundation.org wrote: > > > /usr/include/linux/sysctl.h:38:2: error: unknown

Re: + uapi-fix-linux-sysctlh-userspace-compilation-errors.patch added to -mm tree

2017-02-27 Thread Dmitry V. Levin
On Mon, Feb 27, 2017 at 12:38:16PM +0300, Alexey Dobriyan wrote: > On Sat, Feb 25, 2017 at 1:35 AM, Dmitry V. Levin <l...@altlinux.org> wrote: > > On Fri, Feb 24, 2017 at 05:35:33PM +0300, Alexey Dobriyan wrote: > >> On Thu, Feb 23, 2017 at 02:44:31PM -0800, a...@li

[PATCH 0/5] uapi: fix userspace compilation of asm/ ipc headers

2017-03-25 Thread Dmitry V. Levin
This is resend of short series of trivial userspace compilation fixes acked earlier by Arnd Bergmann. Nobody else from the long Cc list of the original patch series has shown any interest at all, so I've trimmed Cc down. Dmitry V. Levin (5): uapi: fix asm/ipcbuf.h userspace compilation errors

[PATCH 4/5] uapi: fix asm/shmbuf.h userspace compilation errors

2017-03-25 Thread Dmitry V. Levin
/include/asm-generic/shmbuf.h:55:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused3; /usr/include/asm-generic/shmbuf.h:56:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused4; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> Acked-by

[PATCH 5/5] uapi: fix another asm/shmbuf.h userspace compilation error

2017-03-25 Thread Dmitry V. Levin
itself easily. Signed-off-by: Dmitry V. Levin <l...@altlinux.org> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/alpha/include/uapi/asm/shmbuf.h | 2 +- arch/avr32/include/uapi/asm/shmbuf.h | 2 +- arch/frv/include/uapi/asm/shmbuf.h | 2 +- arch/ia64/include/uapi/asm/shm

[PATCH 3/5] uapi: fix asm/sembuf.h userspace compilation errors

2017-03-25 Thread Dmitry V. Levin
type name '__kernel_ulong_t' __kernel_ulong_t __unused3; /usr/include/asm/sembuf.h:21:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused4; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/alpha/include/uapi/

[PATCH 1/5] uapi: fix asm/ipcbuf.h userspace compilation errors

2017-03-25 Thread Dmitry V. Levin
- sizeof(__kernel_mode_t)]; /usr/include/asm-generic/ipcbuf.h:30:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused1; /usr/include/asm-generic/ipcbuf.h:31:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused2; Signed-off-by: Dmitry V. Levin &l

[PATCH 2/5] uapi: fix asm/msgbuf.h userspace compilation errors

2017-03-25 Thread Dmitry V. Levin
/msgbuf.h:44:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused5; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/alpha/include/uapi/asm/msgbuf.h | 2 ++ arch/avr32/include/uapi/asm/msgbuf.h | 2 ++ arch

[PATCH] uapi: remove false assertion that statx_timestamp.tv_nsec can be negative

2017-04-22 Thread Dmitry V. Levin
it will cause an immense confusion. The best fix for this source of confusion is to change the type of struct statx_timestamp.tv_nsec from __s32 to __u32 . Fixes: a528d35e8bfc ("statx: Add a system call to make enhanced file info available") Signed-off-by: Dmitry V. Levin <l...@altlinux.or

Re: [PATCH] uapi: fix linux/nfsd/cld.h userspace compilation errors

2017-03-09 Thread Dmitry V. Levin
is should be safe to apply for 4.11 as well, but it's surely not urgent. > --b. > > On Wed, Mar 01, 2017 at 03:12:03AM +0300, Dmitry V. Levin wrote: > > Include and consistently use types it provides > > to fix the following linux/nfsd/cld.h userspace compilation errors: &g

Re: [RFC PATCH] uapi: fix linux/packet_diag.h userspace compilation error

2017-03-07 Thread Dmitry V. Levin
On Tue, Mar 07, 2017 at 12:16:49PM -0800, David Miller wrote: > From: "Dmitry V. Levin" <l...@altlinux.org> > Date: Tue, 28 Feb 2017 04:39:30 +0300 > > > Replace MAX_ADDR_LEN with its numeric value to fix the following > > linux/packet_diag.h userspace com

[PATCH] uapi: fix linux/packet_diag.h userspace compilation error

2017-03-07 Thread Dmitry V. Levin
the numeric value of MAX_ADDR_LEN is used instead of symbolic one, uapi/linux/if_link.h already does the same: $ grep MAX_ADDR_LEN include/uapi/linux/if_link.h __u8 mac[32]; /* MAX_ADDR_LEN */ There are no UAPI headers besides these two that use MAX_ADDR_LEN. Signed-off-by: Dmitry V. Levin &l

Re: Compat 32-bit syscall entry from 64-bit task!?

2017-03-13 Thread Dmitry V. Levin
On Wed, Mar 08, 2017 at 08:39:55PM -0800, Andrew Lutomirski wrote: > On Wed, Mar 8, 2017 at 3:41 PM, Dmitry V. Levin wrote: [...] > > Is there any progress with this (or any alternative) solution? > > > > I see the kernel side has changed a bit, and the strace part > >

Re: Compat 32-bit syscall entry from 64-bit task!?

2017-03-08 Thread Dmitry V. Levin
Hi, On Thu, Jan 26, 2012 at 07:03:43PM +0100, Denys Vlasenko wrote: > Hi Linus, > > On Thu, Jan 26, 2012 at 4:47 AM, Linus Torvalds > wrote: > >> Please look at strace source, get_scno() function, where > >> it reads syscall no and parameters. Let's see > >> -

[PATCH] MAINTAINERS: add btrfs file entries

2017-03-02 Thread Dmitry V. Levin
Add file entries for btrfs header files. Signed-off-by: Dmitry V. Levin <l...@altlinux.org> Acked-by: David Sterba <dste...@suse.com> --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0001835..04a758f 100644 --- a/MAINTAINERS +++ b

[PATCH v3 2/2] x86/uapi: fix asm/signal.h userspace compilation error

2017-03-02 Thread Dmitry V. Levin
Replace size_t with __kernel_uapi_size_t to fix the following asm/signal.h userspace compilation error: /usr/include/asm/signal.h:126:2: error: unknown type name 'size_t' size_t ss_size; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> Link: http://lkml.kernel.org/r/2017030200185

[PATCH 1/2] uapi: introduce __kernel_uapi_size_t

2017-03-02 Thread Dmitry V. Levin
API headers, e.g. in cases when size_t might differ from __kernel_size_t. Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/asm-generic/posix_types.h | 10 ++ arch/x86/include/uapi/asm/posix_types_x32.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/inc

Re: [PATCH] uapi: fix asm/signal.h userspace compilation errors

2017-03-02 Thread Dmitry V. Levin
On Thu, Mar 02, 2017 at 10:22:18AM -0500, Carlos O'Donell wrote: > On Wed, Mar 1, 2017 at 11:20 AM, Arnd Bergmann <a...@arndb.de> wrote: > > On Sun, Feb 26, 2017 at 2:01 AM, Dmitry V. Levin <l...@altlinux.org> wrote: > >> Include (guarded by #ifndef __KERNEL__) to f

[PATCH] uapi: fix linux/sched/types.h userspace compilation errors

2017-07-05 Thread Dmitry V. Levin
") Cc: sta...@vger.kernel.org # v4.12 Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/linux/sched/types.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/uapi/linux/sched/types.h b/include/uapi/linux/sched/types.h index

[PATCH v2] uapi: change the type of struct statx_timestamp.tv_nsec to unsigned

2017-04-26 Thread Dmitry V. Levin
n immense confusion. Fix this source of confusion by changing the type of struct statx_timestamp.tv_nsec from __s32 to __u32. Fixes: a528d35e8bfc ("statx: Add a system call to make enhanced file info available") Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- v1: fix mislea

Re: Revised statx(2) man page for review

2017-04-25 Thread Dmitry V. Levin
On Tue, Apr 25, 2017 at 01:14:26PM +0200, Michael Kerrisk (man-pages) wrote: [...] >The file timestamps are structures of the following type: > >struct statx_timestamp { >__s64 tv_sec;/* Seconds since the Epoch (UNIX time) */ >__s32 tv_nsec;

[PATCH] Fix compat_sys_sigpending breakage introduced by v4.13-rc1~6^2~12

2017-08-05 Thread Dmitry V. Levin
written in the wrong order. This bug was found by strace test suite. Reported-by: Anatoly Pugachev <mator...@gmail.com> Inspired-by: Eugene Syromyatnikov <evg...@gmail.com> Fixes: 8f13621abced ("sigpending(): move compat to native") Signed-off-by: Dmitry V. Levin <l...@

Re: [PATCH v06 05/36] uapi linux/sysctl.h: use __kernel_size_t instead of size_t

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:43:56PM +0200, Mikko Rapeli wrote: > Fixes userspace compilation error: > > error: unknown type name ‘size_t’ > > Signed-off-by: Mikko Rapeli > Cc: Arnd Bergmann > Cc: David S. Miller > --- >

Re: [PATCH v06 22/36] uapi linux/reiserfs_xattr.h: use __kernel_size_t instead of size_t

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:44:13PM +0200, Mikko Rapeli wrote: > Fixes userspace compilation error: > > error: unknown type name ‘size_t’ > size_t length; > > Signed-off-by: Mikko Rapeli > Cc: reiserfs-de...@vger.kernel.org > --- > include/uapi/linux/reiserfs_xattr.h | 2

Re: [PATCH v06 13/36] x86 uapi asm/sembuf.h: include linux/types.h and linux/ipc.h

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:44:04PM +0200, Mikko Rapeli wrote: > Fixes userspace compile errors like: > > error: field ‘sem_perm’ has incomplete type > struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ > error: unknown type name ‘__kernel_time_t’ > __kernel_time_t sem_otime; /* last

Re: [PATCH v06 21/36] uapi linux/kexec.h: use __kernel_size_t instead of size_t

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:44:12PM +0200, Mikko Rapeli wrote: > Fixes userspace compilation error: > > error: unknown type name ‘size_t’ > size_t bufsz; > > Signed-off-by: Mikko Rapeli > Cc: ke...@lists.infradead.org > Cc: Eric Biederman > --- >

Re: [PATCH v06 35/36] uapi linux/tls.h: don't include in user space

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:44:26PM +0200, Mikko Rapeli wrote: > It is not needed and not part of uapi headers, but causes > user space compilation error: > > fatal error: net/tcp.h: No such file or directory > #include > ^ > > Signed-off-by: Mikko Rapeli

Re: [PATCH v06 09/36] uapi asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:44:00PM +0200, Mikko Rapeli wrote: > Fixes userspace compilation errors like: > > error: field ‘msg_perm’ has incomplete type > struct ipc64_perm msg_perm; > error: unknown type name ‘__kernel_ulong_t’ > > Signed-off-by: Mikko Rapeli > Acked-by:

Re: [PATCH v06 19/36] uapi linux/omapfb.h: use __kernel_size_t instead of size_t

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:44:10PM +0200, Mikko Rapeli wrote: > Fixes userspace compilation error: > > error: unknown type name ‘size_t’ > > Signed-off-by: Mikko Rapeli > Cc: linux-o...@vger.kernel.org > Cc: Tomi Valkeinen > Cc: Aaro Koskinen

Re: [PATCH v06 12/36] x86 uapi asm/signal.h: use __kernel_size_t instead of size_t

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:44:03PM +0200, Mikko Rapeli wrote: > Fixes userspace compilation error: > > error: unknown type name ‘size_t’ > > Signed-off-by: Mikko Rapeli > Cc: Al Viro > Cc: Arnd Bergmann > Cc: H. Peter Anvin

Re: [PATCH v06 08/36] uapi asm-generic/shmbuf.h: include fixes

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:43:59PM +0200, Mikko Rapeli wrote: > Include linux/types.h and asm/msgbuf.h and use __kernel_size_t instead > of size_t. > > Fixes userspace compilation errors like: > > error: field ‘shm_perm’ has incomplete type > struct ipc64_perm shm_perm; /* operation perms */ >

Re: [PATCH v06 14/36] arm uapi asm/signal.h: include for size_t in userspace

2017-08-08 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 06:44:05PM +0200, Mikko Rapeli wrote: > Arnd Bergmann doubts that __kernel_size_t could be used here > so trying to fall back to gcc's . The only architecture where you cannot do this safely is x86 family because of x32 exception. If there is no chance

Re: [PATCH v06 15/36] uapi linux/socket.h: include sys/socket.h in user space

2017-08-08 Thread Dmitry V. Levin
; linux/vm_sockets.h > linux/ncp_fs.h > linux/nfc.h > linux/phonet.h > > Signed-off-by: Mikko Rapeli <mikko.rap...@iki.fi> > Cc: net...@vger.kernel.org > Cc: Dmitry V. Levin <l...@altlinux.org> > --- > include/uapi/linux/socket.h | 4 > 1 file chan

Re: [PATCH v06 14/36] arm uapi asm/signal.h: include for size_t in userspace

2017-08-09 Thread Dmitry V. Levin
On Wed, Aug 09, 2017 at 02:41:59PM +0200, Arnd Bergmann wrote: > On Wed, Aug 9, 2017 at 12:57 AM, Dmitry V. Levin <l...@altlinux.org> wrote: > > On Sun, Aug 06, 2017 at 06:44:05PM +0200, Mikko Rapeli wrote: > >> Arnd Bergmann <a...@arndb.de> doubts that __kernel_s

Re: [PATCH v06 30/36] uapi rdma/rdma_user_rxe.h: include in.h and in6.h

2017-08-09 Thread Dmitry V. Levin
On Wed, Aug 09, 2017 at 09:52:41AM -0600, Jason Gunthorpe wrote: > On Wed, Aug 09, 2017 at 04:48:08PM +0300, Moni Shoua wrote: > > > > > > I'm not sure this is a good idea, linux/in.h should not be included in > > > userspace users of this file, 'sockaddr_in' needs to come from glibc's > > >

Re: [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls

2017-06-14 Thread Dmitry V. Levin
On Wed, Jun 14, 2017 at 07:08:39AM +0200, Greg Kroah-Hartman wrote: > On Tue, Jun 13, 2017 at 09:17:05PM +0300, Gleb Fotengauer-Malinovskiy wrote: > > On Tue, May 30, 2017 at 04:33:57PM -0700, Laura Abbott wrote: > > > On 05/30/2017 07:11 AM, Gleb Fotengauer-Malinovskiy wrote: > > > > This problem

Re: [PATCH] x86/asm/64: do not clear high 32 bits of syscall number when CONFIG_X86_X32=y

2017-09-17 Thread Dmitry V. Levin
On Thu, Sep 14, 2017 at 10:46:37PM -0700, h...@zytor.com wrote: > On September 14, 2017 10:31:55 PM PDT, Ingo Molnar wrote: > > > >* Andy Lutomirski wrote: > > > >> >> > diff --git a/arch/x86/entry/entry_64.S > >b/arch/x86/entry/entry_64.S > >> >> > index

Re: [PATCH] x86/asm/64: do not clear high 32 bits of syscall number when CONFIG_X86_X32=y

2017-09-14 Thread Dmitry V. Levin
On Wed, Sep 13, 2017 at 06:49:21PM +0200, Oleg Nesterov wrote: > On 09/13, Dmitry V. Levin wrote: > > > > Before this change, CONFIG_X86_X32=y fastpath behaviour was different > > from slowpath: > > and even with this change they differ if CONFIG_X86_X32=n? No, I don't

Re: [PATCH] x86/asm/64: do not clear high 32 bits of syscall number when CONFIG_X86_X32=y

2017-09-14 Thread Dmitry V. Levin
On Thu, Sep 14, 2017 at 07:40:43PM +, Eugene Syromyatnikov wrote: > On Wed, Sep 13, 2017 at 4:49 PM, Oleg Nesterov wrote: > > IOW, why do we want to silently ignore the upper bits in $rax ? > > By the way, they are ignored elsewhere, in audit[1] or seccomp[2], for >

Re: [PATCH] x86/asm/64: do not clear high 32 bits of syscall number when CONFIG_X86_X32=y

2017-09-14 Thread Dmitry V. Levin
On Thu, Sep 14, 2017 at 02:05:04PM -0700, Andy Lutomirski wrote: > On Tue, Sep 12, 2017 at 3:57 PM, Dmitry V. Levin wrote: > > Before this change, CONFIG_X86_X32=y fastpath behaviour was different > > from slowpath: > > > > $ gcc -xc -Wall -O2 - <<'EOF' > &g

[PATCH] signal: remove unused variable

2017-09-13 Thread Dmitry V. Levin
Reported-by: Stephen Rothwell <s...@canb.auug.org.au> Fixes: 9b24ec57688a ("get_compat_sigset()") Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- kernel/signal.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/signal.c b/kernel/signal.c index 3198a7d2e5f

Re: [PATCH 1/2] pidmap(2)

2017-09-07 Thread Dmitry V. Levin
On Tue, Sep 05, 2017 at 10:05:00PM +0300, Alexey Dobriyan wrote: > From: Tatsiana Brouka > > Implement system call for bulk retrieveing of pids in binary form. > > Using /proc is slower than necessary: 3 syscalls + another 3 for each thread + > converting with atoi().

[PATCH] x86/asm/64: do not clear high 32 bits of syscall number when CONFIG_X86_X32=y

2017-09-12 Thread Dmitry V. Levin
g") Cc: sta...@vger.kernel.org Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- arch/x86/entry/entry_64.S | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 4916725..3bab6af 100644 --- a/arch/x86/entry/ent

Re: linux-next: build warning after merge of the vfs tree

2017-09-07 Thread Dmitry V. Levin
Hi, On Fri, Sep 08, 2017 at 09:25:45AM +1000, Stephen Rothwell wrote: > Hi Al, > > After merging the vfs tree, today's linux-next build (powerpc > ppc64_defconfig) produced this warning: > > kernel/signal.c: In function 'C_SYSC_rt_sigaction': > kernel/signal.c:3405:19: warning: unused variable

[PATCH 2/3] signal: simplify compat_sigpending()

2017-08-21 Thread Dmitry V. Levin
Remove "if it's big-endian..." ifdef in compat_sigpending(), use the endian-agnostic variant. Suggested-by: Al Viro <v...@zeniv.linux.org.uk> Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- kernel/signal.c | 4 1 file changed, 4 deletions(-) diff --git a/ke

[PATCH 1/3] signal: replace sigset_to_compat() with put_compat_sigset()

2017-08-21 Thread Dmitry V. Levin
_to_compat() into put_compat_sigset() that also calls copy_to_user(). Suggested-by: Al Viro <v...@zeniv.linux.org.uk> Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- arch/sparc/kernel/sys_sparc32.c | 6 +++--- include/linux/compat.h | 3 ++- kernel/compat.

[PATCH 3/3] signal: lift sigset size check out of do_sigpending()

2017-08-21 Thread Dmitry V. Levin
As sigsetsize argument of do_sigpending() is not used anywhere else in that function after the check, remove this argument and move the check out of do_sigpending() into rt_sigpending() and its compat analog. Suggested-by: Al Viro <v...@zeniv.linux.org.uk> Signed-off-by: Dmitry V. Le

Re: [PATCH] Fix compat_sys_sigpending breakage introduced by v4.13-rc1~6^2~12

2017-08-21 Thread Dmitry V. Levin
On Sun, Aug 06, 2017 at 07:22:03PM +0100, Al Viro wrote: > On Sat, Aug 05, 2017 at 11:00:50PM +0300, Dmitry V. Levin wrote: > > The latest change of compat_sys_sigpending has broken it in two ways. > > > > First, it tries to write 4 bytes more than userspace expects: &g

Re: [PATCH v06 35/36] uapi linux/tls.h: don't include in user space

2017-09-04 Thread Dmitry V. Levin
On Wed, Aug 09, 2017 at 02:25:54AM +0300, Dmitry V. Levin wrote: > On Sun, Aug 06, 2017 at 06:44:26PM +0200, Mikko Rapeli wrote: > > It is not needed and not part of uapi headers, but causes > > user space compilation error: > > > > fatal error: net/tcp.h: No such file

[PATCH] uapi: fix linux/kfd_ioctl.h userspace compilation errors

2017-11-12 Thread Dmitry V. Levin
/kfd_ioctl.h:258:2: error: unknown type name 'uint32_t' uint32_t num_ranks; /* from KFD */ Fixes: 6a1c9510694fe ("drm/amdkfd: Adding new IOCTL for scratch memory v2") Fixes: 5d71dbc3a5886 ("drm/amdkfd: Implement image tiling mode support v2") Signed-off-by: Dmitry V. Levi

[PATCH] uapi: fix linux/rxrpc.h userspace compilation errors

2017-11-12 Thread Dmitry V. Levin
UAPI definitions to userspace") Cc: <sta...@vger.kernel.org> # v4.14 Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/linux/rxrpc.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux/rxrpc.h b/include/ua

[PATCH] uapi: fix linux/tls.h userspace compilation error

2017-11-13 Thread Dmitry V. Levin
for userspace, cleanup this header file further by moving other redundant includes to net/tls.h. Fixes: 3c4d7559159b ("tls: kernel TLS support") Cc: <sta...@vger.kernel.org> # v4.13+ Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/net/tls.h| 4 in

Re: [PATCHv3 resend] uapi libc compat: add fallback for unsupported libcs

2017-12-03 Thread Dmitry V. Levin
Hi, On Sun, Nov 12, 2017 at 01:30:17PM -0500, Felix Janda wrote: > libc-compat.h aims to prevent symbol collisions between uapi and libc > headers for each supported libc. This requires continuous coordination > between them. > > The goal of this commit is to improve the situation for libcs

Re: [PATCH bpf 1/2] bpf: fix alignment of netns_dev/netns_ino fields in bpf_{map,prog}_info

2018-05-30 Thread Dmitry V. Levin
> syscall in order to handle this discrepancy) is to use __aligned_u64 > instead of __u64 for these fields. > > Reported-by: Dmitry V. Levin > Fixes: 52775b33bb507 ("bpf: offload: report device information about > offloaded maps") > Fixes: 675fc275a3a2d (

[PATCH] ext4: add crc32c soft dependency

2018-04-28 Thread Dmitry V. Levin
but there seems to be no mechanism to specify a dependency on an alias, so let's use this soft dependency as a workaround. Suggested-by: Alexey Gladkov <leg...@altlinux.org> Fixes: a45403b51582 ("ext4: always initialize the crc32c checksum driver") Cc: sta...@vger.kernel.org Signed-

Re: [PATCH 1/3] seccomp, ptrace: switch get_metadata types to arch independent

2018-02-20 Thread Dmitry V. Levin
4.16-rc2, and so > should be safe assuming it goes in before then. > > Reported-by: "Dmitry V. Levin" <l...@altlinux.org> > Signed-off-by: Tycho Andersen <ty...@tycho.ws> > CC: Kees Cook <keesc...@chromium.org> > CC: Oleg Nesterov <o...@redhat.com&g

Re: [PATCH v4 2/2] ptrace, seccomp: add support for retrieving seccomp metadata

2018-02-20 Thread Dmitry V. Levin
Hi, On Tue, Nov 14, 2017 at 07:00:19PM -0700, Tycho Andersen wrote: > With the new SECCOMP_FILTER_FLAG_LOG, we need to be able to extract these > flags for checkpoint restore, since they describe the state of a filter. > > So, let's add PTRACE_SECCOMP_GET_METADATA, similar to ..._GET_FILTER,

[PATCH] uapi: fix linux/usb/audio.h userspace compilation error

2018-08-13 Thread Dmitry V. Levin
NULL; Fixes: 6cfd839ae78e ("ALSA: usb-audio: UAC3. Add support for mixer unit.") Cc: # v4.18 Signed-off-by: Dmitry V. Levin --- include/uapi/linux/usb/audio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/aud

Re: [PATCH] uapi: fix linux/usb/audio.h userspace compilation error

2018-08-13 Thread Dmitry V. Levin
On Mon, Aug 13, 2018 at 05:55:25PM +0200, Takashi Iwai wrote: > On Mon, 13 Aug 2018 17:46:51 +0200, Dmitry V. Levin wrote: > > > > Replace NULL with 0 in uac_mixer_unit_bmControls() to fix the following > > linux/usb/audio.h userspace compilation error: > > > &g

[PATCH] uapi: fix sound/skl-tplg-interface.h userspace compilation errors

2018-08-13 Thread Dmitry V. Levin
:227:2: error: unknown type name 'u32' u32 rsvd3:11; Fixes: 0c24fdc00244 ("ASoC: topology: Move skl-tplg-interface.h to uapi") Cc: # v4.18 Signed-off-by: Dmitry V. Levin --- include/uapi/sound/skl-tplg-interface.h | 106 1 file changed, 54 insertions(+), 52

[PATCH] uapi: fix linux/kfd_ioctl.h userspace compilation errors

2018-04-04 Thread Dmitry V. Levin
trap handlers") Cc: <sta...@vger.kernel.org> # v4.16 Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/linux/kfd_ioctl.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioct

[PATCH] uapi: fix asm/bootparam.h userspace compilation errors

2018-04-04 Thread Dmitry V. Levin
: 4a362601baa6 ("x86/jailhouse: Add infrastructure for running in non-root cell") Cc: <sta...@vger.kernel.org> # v4.16 Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- arch/x86/include/uapi/asm/bootparam.h | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-)

Re: [PATCH] uapi: fix asm/bootparam.h userspace compilation errors

2018-04-05 Thread Dmitry V. Levin
On Thu, Apr 05, 2018 at 09:25:26AM +0200, Jan Kiszka wrote: > On 2018-04-05 06:32, Dmitry V. Levin wrote: > > Consistently use types provided by to fix the following > > asm/bootparam.h userspace compilation errors: > > > > /usr/include/asm/bootparam.h:140:2: er

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-12 Thread Dmitry V. Levin
On Thu, Apr 12, 2018 at 10:58:11AM +0100, Russell King - ARM Linux wrote: > On Thu, Apr 12, 2018 at 04:34:35AM +0300, Dmitry V. Levin wrote: > > A similar commit v4.16-rc1~159^2~37 > > ("signal/arm: Document conflicts with SI_USER and SIGFPE") must have > > intr

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-12 Thread Dmitry V. Levin
On Thu, Apr 12, 2018 at 01:19:49PM +0100, Russell King - ARM Linux wrote: > On Thu, Apr 12, 2018 at 02:03:14PM +0300, Dmitry V. Levin wrote: > > On Thu, Apr 12, 2018 at 10:58:11AM +0100, Russell King - ARM Linux wrote: > > > On Thu, Apr 12, 2018 at 04:34:35AM +0300, Dmi

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-12 Thread Dmitry V. Levin
On Thu, Apr 12, 2018 at 09:50:26AM -0700, Linus Torvalds wrote: > Does this attached patch perhaps fix the ARM case? > > It just uses FPE_FLTUNK as the default si_code for SIGFPE, which seems > sane enough. And then gets rid of FPE_FIXME, which should resolve the > nasty case. > > Hmm? Entirely

ppc compat v4.16 regression: sending SIGTRAP or SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-09 Thread Dmitry V. Levin
Hi, There seems to be a regression in v4.16 on ppc compat very similar to sparc compat regression reported earlier at https://marc.info/?l=linux-sparc=151501500704383 . The symptoms are exactly the same: the same signal_receive test from the strace test suite fails with the same diagnostics:

[PATCH] sparc: fix compat siginfo ABI regression

2018-04-13 Thread Dmitry V. Levin
with commit v4.16-11958-g16e205cf42da. This bug was found by strace test suite. Link: https://github.com/strace/strace/issues/21 Fixes: cc731525f26a ("signal: Remove kernel interal si_code magic") Thanks-to: Anatoly Pugachev <mator...@gmail.com> Signed-off-by: Dmitry V. Levin &l

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-11 Thread Dmitry V. Levin
Hi, On Mon, Apr 09, 2018 at 06:22:53PM +0300, Dmitry V. Levin wrote: > There seems to be a regression in v4.16 on ppc compat very similar > to sparc compat regression reported earlier at > https://marc.info/?l=linux-sparc=151501500704383 . > > The symptoms are exactly the

Re: [PATCH v5 0/4] vm: add a syscall to map a process memory into a pipe

2018-02-26 Thread Dmitry V. Levin
On Mon, Feb 26, 2018 at 12:02:25PM +0300, Pavel Emelyanov wrote: > On 02/21/2018 03:44 AM, Andrew Morton wrote: > > On Tue, 9 Jan 2018 08:30:49 +0200 Mike Rapoport > > wrote: > > > >> This patches introduces new process_vmsplice system call that combines > >>

Re: [PATCH 12/13] riscv: define syscall_get_arch()

2018-11-09 Thread Dmitry V. Levin
he generic ptrace API with PTRACE_GET_SYSCALL_INFO request. > > > > Signed-off-by: Dmitry V. Levin > > --- > > arch/riscv/include/asm/syscall.h | 6 ++ > > include/uapi/linux/audit.h | 1 + > > 2 files changed, 7 insertions(+) > > > > di

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

2018-11-10 Thread Dmitry V. Levin
with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin --- Apparently, we need to implement syscall_get_arch() on all architectures where linux/tracehook.h is compiled, not just those that use tracehook_report_syscall_entry(). This adds one more architecture to the initial list of 9 architectures where

[PATCH 03/13] elf-em.h: add EM_NDS32

2018-11-08 Thread Dmitry V. Levin
/developers/gabi/2012-12-31/ch4.eheader.html Signed-off-by: Dmitry V. Levin --- include/uapi/linux/elf-em.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/elf-em.h b/include/uapi/linux/elf-em.h index 56ff3f9d9633..f879c24a7c21 100644 --- a/include/uapi/linux/elf-em.h

[PATCH 04/13] elf-em.h: add EM_XTENSA

2018-11-08 Thread Dmitry V. Levin
://www.sco.com/developers/gabi/2012-12-31/ch4.eheader.html Signed-off-by: Dmitry V. Levin --- include/uapi/linux/elf-em.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/elf-em.h b/include/uapi/linux/elf-em.h index f879c24a7c21..2639119bf459 100644 --- a/include/uapi/linux/elf-em.h

[PATCH 05/13] m68k: define syscall_get_arch()

2018-11-08 Thread Dmitry V. Levin
syscall_get_arch() is required to be implemented on all architectures that use tracehook_report_syscall_entry() in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin --- arch/m68k/include/asm/syscall.h | 12 1 file changed

[PATCH 08/13] h8300: define syscall_get_arch()

2018-11-08 Thread Dmitry V. Levin
syscall_get_arch() is required to be implemented on all architectures that use tracehook_report_syscall_entry() in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin --- arch/h8300/include/asm/syscall.h | 5 + include/uapi/linux

[PATCH 09/13] hexagon: define syscall_get_arch()

2018-11-08 Thread Dmitry V. Levin
syscall_get_arch() is required to be implemented on all architectures that use tracehook_report_syscall_entry() in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin --- arch/hexagon/include/asm/syscall.h | 8 include/uapi/linux

[PATCH 01/13] Move EM_HEXAGON to uapi/linux/elf-em.h

2018-11-08 Thread Dmitry V. Levin
with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin --- arch/hexagon/include/asm/elf.h | 6 +- include/uapi/linux/elf-em.h| 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/hexagon/include/asm/elf.h b/arch/hexagon/include/asm/elf.h index 80311e7b8ca6..d10fbd54ae51 100644

Re: [PATCH v6] pidns: introduce syscall translate_pid

2018-11-08 Thread Dmitry V. Levin
Hi, On Mon, Jul 16, 2018 at 10:57:48AM -0700, Nagarathnam Muthusamy wrote: > On 06/01/2018 12:18 PM, Konstantin Khlebnikov wrote: > > Each process have different pids, one for each pid namespace it belongs. > > When interaction happens within single pid-ns translation isn't required. > > More

Re: [RFC PATCH] ptrace: add PTRACE_GET_SYSCALL_INFO request

2018-11-12 Thread Dmitry V. Levin
On Wed, Nov 07, 2018 at 12:44:58PM -0800, Andy Lutomirski wrote: > > On Nov 6, 2018, at 7:27 PM, Elvira Khabirova > > wrote: > > > > PTRACE_GET_SYSCALL_INFO lets ptracer obtain details of the syscall > > the tracee is blocked in. The request returns meaningful data only > > when the tracee is in

Re: [RFC PATCH] ptrace: add PTRACE_GET_SYSCALL_INFO request

2018-11-07 Thread Dmitry V. Levin
On Wed, Nov 07, 2018 at 12:21:01PM +0100, Oleg Nesterov wrote: > On 11/07, Elvira Khabirova wrote: > > > > In short, if a 64-bit task performs a syscall through int 0x80, its tracer > > has no reliable means to find out that the syscall was, in fact, > > a compat syscall, and misidentifies it. > >

Re: [RFC PATCH] ptrace: add PTRACE_GET_SYSCALL_INFO request

2018-11-07 Thread Dmitry V. Levin
On Wed, Nov 07, 2018 at 04:27:51AM +0100, Elvira Khabirova wrote: [...] > The structure was chosen according to [2], except for two changes. > First: instead of an arch field with a value of AUDIT_ARCH_*, a boolean > is_compat value is returned, because a) not all arches have an AUDIT_ARCH_* >

Re: [PATCH v4 1/2] ptrace: save the type of syscall-stop in ptrace_message

2018-11-29 Thread Dmitry V. Levin
On Thu, Nov 29, 2018 at 03:47:43PM +0100, Oleg Nesterov wrote: > On 11/29, Dmitry V. Levin wrote: > > > > 2. Document these values > > sure, they should be documented and live in include/uapi/, > > > chosen to avoid collisions with ptrace_message values

Re: [PATCH v4 1/2] ptrace: save the type of syscall-stop in ptrace_message

2018-11-30 Thread Dmitry V. Levin
On Fri, Nov 30, 2018 at 12:29:21PM +0100, Oleg Nesterov wrote: > On 11/30, Dmitry V. Levin wrote: > > On Thu, Nov 29, 2018 at 03:47:43PM +0100, Oleg Nesterov wrote: > > > > > > so that PTRACE_GETEVENTMSG users can easily tell > > > > whether this n

Re: [PATCH v2 06/15] m68k: define syscall_get_arch()

2018-12-02 Thread Dmitry V. Levin
Hi Geert, On Sun, Dec 02, 2018 at 11:29:10AM +0100, Geert Uytterhoeven wrote: > Hi Dmitry, > > On Tue, Nov 20, 2018 at 1:15 AM Dmitry V. Levin wrote: > > syscall_get_arch() is required to be implemented on all architectures > > in order to extend t

[PATCH] microblaze: fix syscall_set_return_value()

2018-12-02 Thread Dmitry V. Levin
architectures where error argument of syscall_set_return_value() is non-positive. Fixes: d5b37092aae1e ("microblaze: Implement include/asm/syscall.h.") Cc: sta...@vger.kernel.org # v2.6.32+ Signed-off-by: Dmitry V. Levin --- arch/microblaze/include/asm/syscall.h | 5 + 1 file changed, 1 inser

[PATCH] ia64: fix syscall_get_error()

2018-12-02 Thread Dmitry V. Levin
syscall_get_error() returns a non-positive value. Fixes: cfb361f13c81 ("[IA64] utrace syscall.h support for ia64") Cc: sta...@vger.kernel.org # v2.6.27+ Signed-off-by: Dmitry V. Levin --- arch/ia64/include/asm/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia

[PATCH] nios2: fix syscall_get_error()

2018-12-02 Thread Dmitry V. Levin
syscall_get_error() returns a non-positive value. Fixes: 1000197d80132 ("nios2: System calls handling") Cc: sta...@vger.kernel.org # v3.19+ Signed-off-by: Dmitry V. Levin --- arch/nios2/include/asm/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nios2/i

[PATCH] sh: fix syscall_set_return_value()

2018-12-02 Thread Dmitry V. Levin
error argument of syscall_set_return_value() is non-positive. Fixes: fb4f87a2f048b ("sh: Provide the asm/syscall.h interface, needed by tracehook.") Fixes: 94e2fb3d3e1f4 ("sh: Provide asm/syscall.h for SH-5.") Cc: sta...@vger.kernel.org # v2.6.28+ Signed-off-by: Dmitry V.

Re: [PATCH v4 1/2] ptrace: save the type of syscall-stop in ptrace_message

2018-11-29 Thread Dmitry V. Levin
On Wed, Nov 28, 2018 at 03:17:49PM -0800, Andy Lutomirski wrote: > On Wed, Nov 28, 2018 at 2:11 PM Dmitry V. Levin wrote: > > > > On Wed, Nov 28, 2018 at 06:23:46PM +0300, Dmitry V. Levin wrote: > > > On Wed, Nov 28, 2018 at 03:20:06PM +0100, Oleg Nesterov wrote: > >

[PATCH] mips: fix mips_get_syscall_arg o32 check

2018-11-21 Thread Dmitry V. Levin
nable HAVE_ARCH_TRACEHOOK.") Signed-off-by: Dmitry V. Levin --- arch/mips/include/asm/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index 0170602a1e4e..6cf8ffb5367e 100644 --- a/arch/mips/include/asm/syscall.h

Re: Official Linux system wrapper library?

2018-11-23 Thread Dmitry V. Levin
On Fri, Nov 23, 2018 at 12:15:39PM -0800, Daniel Colascione wrote: > On Fri, Nov 23, 2018 at 5:34 AM Florian Weimer wrote: > > > On Mon, Nov 12, 2018 at 12:11 AM, Florian Weimer wrote: > > >> > > >>> If the kernel provides a system call, libc should provide a C wrapper > > >>> for it, even if in

Re: [PATCH RESEND v3 1/3] ptrace: pass type of a syscall-stop in ptrace_message

2018-11-24 Thread Dmitry V. Levin
On Sat, Nov 24, 2018 at 03:54:02PM -1000, Joey Pabalinas wrote: > On Sun, Nov 25, 2018 at 02:22:27AM +0100, Elvira Khabirova wrote: > > Define two constants, PTRACE_EVENTMSG_SYSCALL_ENTRY and > > PTRACE_EVENTMSG_SYSCALL_EXIT, and place them in ptrace_message > > for the duration of syscall-stops.

<    1   2   3   4   5   6   7   >