Re: [PATCH] selftests/exec: include cwd in long path calculation

2017-10-12 Thread David Drysdale
Modulo the minor comment below: Reviewed-by: David Drysdale On Thu, Oct 12, 2017 at 1:40 AM, Steve Muckle wrote: > When creating a pathname close to PATH_MAX to test execveat, factor in > the current working directory path otherwise we end up with an absolute > path that is lo

Re: new ...at() flag: AT_NO_JUMPS

2017-05-18 Thread David Drysdale
On Fri, May 5, 2017 at 1:30 AM, Al Viro wrote: > On Mon, May 01, 2017 at 07:36:52PM +0200, Jann Horn wrote: > >> Oh, nice! >> >> It looks like this is somewhat similar to the old O_BENEATH proposal, >> but because the intentions behind the proposals are different >> (application sandboxing versus

Re: kmemleak report after 9082e87bfbf8 ("block: remove struct bio_batch")

2016-06-07 Thread David Drysdale
io) >>> - return submit_bio_wait(WRITE, bio); >>> + if (bio) { >>> + ret = submit_bio_wait(WRITE, bio); >>> + bio_put(bio); >>> + return ret; >>> + } >>> return 0; >>> } >> >> >> This patch appears to fix the memory leak on my machine. >> >> Tested-by: Catalin Marinas > > > The patch appears to work here as well. > > Tested-by: Larry fin...@lwfinger.net > > Thanks, > > Larry > Works for me too. Tested-by: David Drysdale

Re: linux-next memleak after IO on dax mountpoint

2016-06-02 Thread David Drysdale
On Sat, May 28, 2016 at 5:05 AM, Xiong Zhou wrote: > On Fri, May 27, 2016 at 04:46:17PM +0800, Xiong Zhou wrote: > ... >> Still working on to id which commit in this merge causes this issuer, > > Narrowed down to: > > 37e5823 block: add offset in blk_add_request_payload() > e048948 blk-mq: Export

Re: [PATCH v2] x86: wire up compat readv2/writev2 syscalls

2016-05-31 Thread David Drysdale
On Thu, Apr 7, 2016 at 9:43 PM, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- > arch/x86/entry/syscalls/syscall_32.tbl | 4 ++-- > arch/x86/entry/syscalls/syscall_64.tbl | 2 ++ > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/entry/syscalls/syscal

Re: [PATCH v3 0/4] um: Add seccomp support

2016-01-06 Thread David Drysdale
Meredydd Luff's original patch in my local tree so I could do UML testing of Capsicum (which uses seccomp for some of its userspace implementation). I've replaced my patch with this version, as it's much more complete, and all my tests still work. Which I guess is kind of: Tested-by: D

Re: RFC: fsyscall

2015-09-10 Thread David Drysdale
On Thu, Sep 10, 2015 at 2:43 PM, Serge E. Hallyn wrote: > On Tue, Sep 08, 2015 at 07:25:17PM -0500, Eric W. Biederman wrote: >> Andy Lutomirski writes: >> >> > On Tue, Sep 8, 2015 at 4:07 PM, Eric W. Biederman >> > wrote: >> >> >> Perhaps I had missed it but I don't recall capsicum being able t

Re: RFC: fsyscall

2015-09-09 Thread David Drysdale
On Wed, Sep 9, 2015 at 1:25 AM, Eric W. Biederman wrote: > Andy Lutomirski writes: > > On Tue, Sep 8, 2015 at 4:07 PM, Eric W. Biederman > > wrote: > > >> Perhaps I had missed it but I don't recall capsicum being able to wrap > >> things like reboot(2). > >> > > > > Ah, so you want to be able t

Re: [PATCHv4 man-pages 3/3] open.2: describe O_BENEATH flag

2015-08-14 Thread David Drysdale
On Fri, Aug 14, 2015 at 3:17 PM, Andy Lutomirski wrote: > On Fri, Aug 14, 2015 at 2:29 AM, David Drysdale wrote: >> On Fri, Aug 14, 2015 at 6:33 AM, Michael Kerrisk (man-pages) >> wrote: >>> On 13 August 2015 at 19:38, Andy Lutomirski wrote: >>>> On Thu, Aug

Re: [PATCHv4 man-pages 3/3] open.2: describe O_BENEATH flag

2015-08-14 Thread David Drysdale
On Fri, Aug 14, 2015 at 6:33 AM, Michael Kerrisk (man-pages) wrote: > On 13 August 2015 at 19:38, Andy Lutomirski wrote: >> On Thu, Aug 13, 2015 at 2:32 AM, David Drysdale wrote: >>> Signed-off-by: David Drysdale >> >> What's the behavior wrt fcntl(F_GE

Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values wrong in VM?

2015-08-14 Thread David Drysdale
On Thu, Aug 13, 2015 at 11:56 PM, Kees Cook wrote: > On Thu, Aug 13, 2015 at 3:54 PM, Linus Torvalds > wrote: >> On Thu, Aug 13, 2015 at 3:49 PM, Linus Torvalds >> wrote: >>> >>> Does the attached patch make sense and work? >> >> Btw, I'm not all that happy with it anyway. >> >> I still think De

Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values wrong in VM?

2015-08-13 Thread David Drysdale
On Thu, Aug 13, 2015 at 6:15 PM, Andy Lutomirski wrote: > On Thu, Aug 13, 2015 at 9:28 AM, David Drysdale wrote: >> On Thu, Aug 13, 2015 at 4:17 PM, Denys Vlasenko wrote: >>> On 08/13/2015 10:30 AM, David Drysdale wrote: >>>> Hi folks, >>>> >&g

Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values wrong in VM?

2015-08-13 Thread David Drysdale
On Thu, Aug 13, 2015 at 4:17 PM, Denys Vlasenko wrote: > On 08/13/2015 10:30 AM, David Drysdale wrote: >> Hi folks, >> >> I've got an odd regression with the v4.2 rc kernel, and I wondered if anyone >> else could reproduce it. >> >> The problem occurs

[PATCHv4 2/3] selftests: Add test of O_BENEATH & openat(2)

2015-08-13 Thread David Drysdale
Add simple tests of openat(2) variations, including examples that check the new O_BENEATH flag. Signed-off-by: David Drysdale --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/openat/.gitignore | 4 + tools/testing/selftests/openat/Makefile | 29 tools

[PATCHv4 1/3] fs: add O_BENEATH flag to openat(2)

2015-08-13 Thread David Drysdale
nd_jump_link() for following symlinks without path expansion, when O_BENEATH is set. Signed-off-by: David Drysdale --- arch/alpha/include/uapi/asm/fcntl.h | 1 + arch/parisc/include/uapi/asm/fcntl.h | 1 + arch/sparc/include/uapi/asm/fcntl.h | 1 + fs/fcntl.c | 4 ++-- fs

[PATCHv4 man-pages 3/3] open.2: describe O_BENEATH flag

2015-08-13 Thread David Drysdale
Signed-off-by: David Drysdale --- man2/open.2 | 44 1 file changed, 44 insertions(+) diff --git a/man2/open.2 b/man2/open.2 index f49ab3042161..d09511f9ffb0 100644 --- a/man2/open.2 +++ b/man2/open.2 @@ -201,6 +201,43 @@ See for further details

[PATCHv4 0/3] fs: add O_BENEATH flag to openat(2)

2015-08-13 Thread David Drysdale
om v1 to v2 of Capsicum patchset: - renamed O_BENEATH_ONLY to O_BENEATH [Christoph Hellwig] David Drysdale (2): fs: add O_BENEATH flag to openat(2) selftests: Add test of O_BENEATH & openat(2) arch/alpha/include/uapi/asm/fcntl.h | 1 + arch/parisc/include/uapi/asm/fcntl.h |

[Regression v4.2 ?] 32-bit seccomp-BPF returned errno values wrong in VM?

2015-08-13 Thread David Drysdale
Hi folks, I've got an odd regression with the v4.2 rc kernel, and I wondered if anyone else could reproduce it. The problem occurs with a seccomp-bpf filter program that's set up to return an errno value -- an errno of 1 is always returned instead of what's in the filter, plus other oddities (sel

[PATCHv4 0/1] Document how to add a new syscall

2015-08-10 Thread David Drysdale
ett] - various minor markups [Josh Triplett] Changes since v1: - added paragraph on build requirements to Testing section [Shuah Khan, Peter Zijlstra] - various text clarifications [Kees Cook] - added Reviewed-by markers David Drysdale (1): Documentation: describe how to add a syste

[PATCHv4 1/1] Documentation: describe how to add a system call

2015-08-10 Thread David Drysdale
Add a document describing the process of adding a new system call, including the need for a flags argument for future compatibility, and covering 32-bit/64-bit concerns (albeit in an x86-centric way). Signed-off-by: David Drysdale Reviewed-by: Michael Kerrisk Reviewed-by: Eric B Munson

Re: [PATCHv3 1/1] Documentation: describe how to add a system call

2015-08-10 Thread David Drysdale
On Wed, Aug 5, 2015 at 5:21 PM, Pavel Machek wrote: > Hi! > >> Add a document describing the process of adding a new system call, >> including the need for a flags argument for future compatibility, and >> covering 32-bit/64-bit concerns (albeit in an x86-centric way). &g

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread David Drysdale
On Fri, Jul 31, 2015 at 2:06 PM, Josh Triplett wrote: > On Fri, Jul 31, 2015 at 10:48:32AM +0100, David Drysdale wrote: >> On Thu, Jul 30, 2015 at 7:50 PM, Josh Triplett wrote: >> > On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: >> >> +needs to

[PATCHv3 0/1] Document how to add a new syscall

2015-07-31 Thread David Drysdale
or markups [Josh Triplett] Changes since v1: - added paragraph on build requirements to Testing section [Shuah Khan, Peter Zijlstra] - various text clarifications [Kees Cook] - added Reviewed-by markers David Drysdale (1): Documentation: describe how to add a system call Docu

[PATCHv3 1/1] Documentation: describe how to add a system call

2015-07-31 Thread David Drysdale
Add a document describing the process of adding a new system call, including the need for a flags argument for future compatibility, and covering 32-bit/64-bit concerns (albeit in an x86-centric way). Signed-off-by: David Drysdale Reviewed-by: Michael Kerrisk Reviewed-by: Eric B Munson

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread David Drysdale
On Thu, Jul 30, 2015 at 7:50 PM, Josh Triplett wrote: > On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: >> Add a document describing the process of adding a new system call, >> including the need for a flags argument for future compatibility, and >> covering 3

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread David Drysdale
On Thu, Jul 30, 2015 at 9:38 AM, Ingo Molnar wrote: > > * David Drysdale wrote: > >> +Designing the API >> +- >> + >> +A new system call forms part of the API of the kernel, and has to be >> supported >> +indefinitely. As such, it

[PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread David Drysdale
Add a document describing the process of adding a new system call, including the need for a flags argument for future compatibility, and covering 32-bit/64-bit concerns (albeit in an x86-centric way). Signed-off-by: David Drysdale Reviewed-by: Michael Kerrisk Reviewed-by: Eric B Munson

[PATCHv2 0/1] Document how to add a new syscall

2015-07-30 Thread David Drysdale
el Kerrisk for suggesting several clarifications and additions.) Changes since v1: - added paragraph on build requirements to Testing section [Shuah Khan, Peter Zijlstra] - various text clarifications [Kees Cook] - added Reviewed-by markers David Drysdale (1): Documentation: describe

Re: [PATCH RFC 1/1] Documentation: describe how to add a system call

2015-07-28 Thread David Drysdale
On Tue, Jul 28, 2015 at 5:43 PM, Kees Cook wrote: > On Tue, Jul 28, 2015 at 4:41 AM, David Drysdale wrote: >> Add a document describing the process of adding a new system call, >> including the need for a flags argument for future compatibility, and >> covering 32-bit/64-bi

Re: [PATCH RFC 0/1] Document how to add a new syscall

2015-07-28 Thread David Drysdale
On Tue, Jul 28, 2015 at 3:19 PM, Peter Zijlstra wrote: > On Tue, Jul 28, 2015 at 07:59:16AM -0600, Shuah Khan wrote: >> On 07/28/2015 05:41 AM, David Drysdale wrote: >> > Given that I've gotten some of the details wrong in the past (and I've >> > seen other

Re: [PATCH RFC 0/1] UAPI,x86: export syscall numbers for all x86 archs

2015-07-28 Thread David Drysdale
On Tue, Jul 28, 2015 at 1:20 PM, Paul Moore wrote: > On Tue, Jul 28, 2015 at 4:05 AM, David Drysdale wrote: >> A while ago I was trying to build a seccomp-bpf filter program that would >> survive a change of x86 architecture. This was complicated for all sorts of >> re

[PATCH RFC 0/1] Document how to add a new syscall

2015-07-28 Thread David Drysdale
s, David (With thanks to Andrew Morton for looking over an initial draft, and to Michael Kerrisk for suggesting several clarifications and additions.) David Drysdale (1): Documentation: describe how to add a system call Documentation/adding-syscalls.txt | 454 ++

[PATCH RFC 1/1] Documentation: describe how to add a system call

2015-07-28 Thread David Drysdale
Add a document describing the process of adding a new system call, including the need for a flags argument for future compatibility, and covering 32-bit/64-bit concerns (albeit in an x86-centric way). Signed-off-by: David Drysdale Reviewed-by: Michael Kerrisk --- Documentation/adding

[PATCH RFC 0/1] UAPI,x86: export syscall numbers for all x86 archs

2015-07-28 Thread David Drysdale
tional set of definitions. For the new constants I've left in my original suggestion (__NR_amd64_) for the time being. What are folks' thoughts about the preferred naming for these? David Drysdale (1): UAPI,x86: export syscall numbers for all x86 archs arch/x86/entry/sy

[PATCH RFC 1/1] UAPI,x86: export syscall numbers for all x86 archs

2015-07-28 Thread David Drysdale
numbers in form __NR_amd64_. For example, this allows a seccomp-bpf filter to include filtering for multiple architectures, and (in particular) to include x32 syscalls in an x86_64 filter. (Programmatic control of the audit framework is another possible use case.) Signed-off-by: David Drysdale

Re: [PATCH] selftests/exec: Fix build on older distros.

2015-06-25 Thread David Drysdale
On Fri, Jun 26, 2015 at 12:29 AM, Vinson Lee wrote: > From: Vinson Lee > > This patch fixes this build error on CentOS 5. > > execveat.c: In function ‘check_execveat_pathmax’: > execveat.c:185: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function) > execveat.c:185: error: (Each undeclare

Re: [PATCH v2 3/7] Introduce a new clone4 syscall with more flag bits and extensible arguments

2015-03-31 Thread David Drysdale
On Mon, Mar 23, 2015 at 3:05 PM, wrote: > On Mon, Mar 23, 2015 at 02:11:45PM +0000, David Drysdale wrote: >> On Sun, Mar 15, 2015 at 7:59 AM, Josh Triplett wrote: >> > diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S >> > index 0286735..ba28306 1006

Re: [PATCH v2 7/7] clone4: Add a CLONE_FD flag to get task exit notification via fd

2015-03-23 Thread David Drysdale
On Sun, Mar 15, 2015 at 8:00 AM, Josh Triplett wrote: > diff --git a/include/linux/compat.h b/include/linux/compat.h > index 6c4a68d..c90df5a 100644 > --- a/include/linux/compat.h > +++ b/include/linux/compat.h > @@ -299,6 +299,8 @@ struct compat_clone4_args { > compat_ulong_t stack_start;

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-23 Thread David Drysdale
On Mon, Mar 16, 2015 at 11:29 PM, wrote: > On Mon, Mar 16, 2015 at 03:14:14PM -0700, Thiago Macieira wrote: >> On Monday 16 March 2015 14:44:20 Kees Cook wrote: >> > > O_CLOEXEC >> > > Set the close-on-exec flag on the new file >> > >descriptor. See the descr

Re: [PATCH v2 3/7] Introduce a new clone4 syscall with more flag bits and extensible arguments

2015-03-23 Thread David Drysdale
On Sun, Mar 15, 2015 at 7:59 AM, Josh Triplett wrote: > diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S > index 0286735..ba28306 100644 > --- a/arch/x86/ia32/ia32entry.S > +++ b/arch/x86/ia32/ia32entry.S > @@ -483,6 +483,7 @@ GLOBAL(\label) > PTREGSCALL stub32_execveat,

Re: [PATCHv3 xfstests 2/3] generic: test openat and new O_BENEATH flag

2015-03-18 Thread David Drysdale
02:00:11PM +, David Drysdale wrote: >> >> Test basic openat(2) behaviour. >> >> >> >> Test that if O_BENEATH flag is set, openat() will only open >> >> paths that have no .. component and do not start with /. >> >> Symlinks a

Re: [PATCH 0/6] CLONE_FD: Task exit notification via file descriptor

2015-03-15 Thread David Drysdale
On Sat, Mar 14, 2015 at 7:29 PM, Josh Triplett wrote: > On Sat, Mar 14, 2015 at 12:03:12PM -0700, Thiago Macieira wrote: >> On Friday 13 March 2015 18:11:32 Thiago Macieira wrote: >> > On Friday 13 March 2015 14:51:47 Andy Lutomirski wrote: >> > > In any event, we should find out what FreeBSD does

Re: [PATCH 0/6] CLONE_FD: Task exit notification via file descriptor

2015-03-15 Thread David Drysdale
On Fri, Mar 13, 2015 at 7:42 PM, Josh Triplett wrote: > On Fri, Mar 13, 2015 at 04:05:29PM +0000, David Drysdale wrote: >> On Fri, Mar 13, 2015 at 1:40 AM, Josh Triplett wrote: >> > This patch series introduces a new clone flag, CLONE_FD, which lets the >> > calle

Re: [PATCH 0/6] CLONE_FD: Task exit notification via file descriptor

2015-03-13 Thread David Drysdale
On Fri, Mar 13, 2015 at 1:40 AM, Josh Triplett wrote: > This patch series introduces a new clone flag, CLONE_FD, which lets the caller > handle child process exit notification via a file descriptor rather than > SIGCHLD. CLONE_FD makes it possible for libraries to safely launch and manage > child

Re: [PATCHv3 man-pages 3/3] open.2: describe O_BENEATH flag

2015-03-09 Thread David Drysdale
On Mon, Mar 9, 2015 at 2:32 PM, Michael Kerrisk (man-pages) wrote: > On 03/09/2015 03:00 PM, David Drysdale wrote: >> Signed-off-by: David Drysdale > > Hi David, > > The text looks good insofar as it goes. But, it would be helpful > to have sentence or to that expla

[PATCHv3 xfstests 2/3] generic: test openat and new O_BENEATH flag

2015-03-09 Thread David Drysdale
Test basic openat(2) behaviour. Test that if O_BENEATH flag is set, openat() will only open paths that have no .. component and do not start with /. Symlinks are also checked for the same restrictions. Signed-off-by: David Drysdale --- .gitignore| 1 + common/openat

[PATCHv3 man-pages 3/3] open.2: describe O_BENEATH flag

2015-03-09 Thread David Drysdale
Signed-off-by: David Drysdale --- man2/open.2 | 32 1 file changed, 32 insertions(+) diff --git a/man2/open.2 b/man2/open.2 index 956531b24b26..be40dd7710df 100644 --- a/man2/open.2 +++ b/man2/open.2 @@ -716,6 +716,31 @@ XFS support was added .\" c

[PATCHv3 1/3] fs: add O_BENEATH flag to openat(2)

2015-03-09 Thread David Drysdale
nd_jump_link() for following symlinks without path expansion, when O_BENEATH is set. Signed-off-by: David Drysdale --- arch/alpha/include/uapi/asm/fcntl.h | 1 + arch/parisc/include/uapi/asm/fcntl.h | 1 + arch/sparc/include/uapi/asm/fcntl.h | 1 + fs/fcntl.c | 4 ++-- fs

[PATCHv3 0/3] fs: add O_BENEATH flag to openat(2)

2015-03-09 Thread David Drysdale
ENEATH_ONLY to O_BENEATH [Christoph Hellwig] David Drysdale (1): fs: add O_BENEATH flag to openat(2) arch/alpha/include/uapi/asm/fcntl.h | 1 + arch/parisc/include/uapi/asm/fcntl.h | 1 + arch/sparc/include/uapi/asm/fcntl.h | 1 + fs/fcntl.c | 4 ++

[PATCH 2/2] audit,x86: add x32_execve[at] to syscall classification

2015-03-06 Thread David Drysdale
Treat x32 ABI variants of execve[at] the same as x86_64 variants. Slightly speculative as the audit subsystem doesn't currently work with x32 ABI syscalls. If and when audit+x32 does work, this should correctly classify exec calls. Signed-off-by: David Drysdale --- arch/x86/kernel/audit

[PATCH 1/2] audit: add execveat to syscall classification

2015-03-06 Thread David Drysdale
New execveat syscall from v3.19 is missing from audit_classify_compat_syscall(). Reported-by: Brian Gerst Signed-off-by: David Drysdale --- lib/compat_audit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/compat_audit.c b/lib/compat_audit.c index 873f75b640ab..a49469f0511d 100644

[PATCH 0/2] Update audit syscall classification for execve variants

2015-03-06 Thread David Drysdale
Add a couple of missing execve variants to the syscall classification code in the audit system. - Patch 1 is potentially suitable for 3.19 stable. - Patch 2 need not be back-applied, as audit doesn't yet work with x32 syscalls in general. David Drysdale (2): audit: add execveat to sy

Re: x32 + audit status?

2015-03-06 Thread David Drysdale
On Fri, Mar 6, 2015 at 7:28 AM, Paul Moore wrote: > On Thu, Mar 5, 2015 at 6:07 PM, Andy Lutomirski wrote: >> On Mar 5, 2015 10:32 AM, "David Drysdale" wrote: >>> >>> Hi, >>> >>> Do we currently expect the audit system to work with x32 sy

x32 + audit status?

2015-03-05 Thread David Drysdale
Hi, Do we currently expect the audit system to work with x32 syscalls? I was playing with the audit system for the first time today (on v4.0-rc2, due to [1]), and it didn't seem to work for me. (Tweaking ptrace.c like the patch below seemed to help, but I may just have configured something wrong

Re: [PATCH 4/5] x86: Use generic compat audit code

2015-03-04 Thread David Drysdale
On Wed, Mar 4, 2015 at 6:39 AM, Brian Gerst wrote: > > On Wed, Mar 4, 2015 at 12:14 AM, Ingo Molnar wrote: > > > > * Brian Gerst wrote: > > > >> Use the generic compat syscall audit code instead of an x86 specific > >> implementation. > >> > >> Signed-off-by: Brian Gerst > >> --- > >> arch/x86

Re: [PATCH v2] selftests/exec: Check if the syscall exists and bail if not

2015-02-03 Thread David Drysdale
n on a system that doesn't implement the syscall we will get > ENOSYS back from the kernel, so change the logic that handles > __NR_execveat not being defined to also use ENOSYS rather than -ENOSYS. > > Signed-off-by: Michael Ellerman Acked-by: David Drysdale > --- > >

Re: [PATCH] selftests/exec: Check if the syscall exists and bail if not

2015-01-21 Thread David Drysdale
On Wed, Jan 21, 2015 at 7:41 AM, Michael Ellerman wrote: > On systems which don't implement sys_execveat(), this test produces a > lot of output. > > Add a check at the beginning to see if the syscall is present, and if > not just note one error and return. Good point, thanks. > Signed-off-by: M

Re: [PATCHv10 man-pages 5/5] execveat.2: initial man page for execveat(2)

2015-01-12 Thread David Drysdale
On Fri, Jan 9, 2015 at 9:50 PM, Al Viro wrote: > On Fri, Jan 09, 2015 at 04:28:52PM -0500, Rich Felker wrote: > >> The "magic open-once magic symlink" approach is really the cleanest >> solution I can find. In the case where the interpreter does not open >> the script, nothing terribly bad happens

Re: [PATCHv10 man-pages 5/5] execveat.2: initial man page for execveat(2)

2015-01-12 Thread David Drysdale
On Sat, Jan 10, 2015 at 1:33 AM, Rich Felker wrote: > On Fri, Jan 09, 2015 at 07:17:41PM -0600, Eric W. Biederman wrote: >> Rich Felker writes: >> >> > I'm not proposing code because I'm a libc developer not a kernel >> > developer. I know what's needed for userspace to provide a conforming >> >

Re: [PATCHv10 man-pages 5/5] execveat.2: initial man page for execveat(2)

2015-01-09 Thread David Drysdale
On Fri, Jan 9, 2015 at 3:47 PM, Michael Kerrisk (man-pages) wrote: > On 11/24/2014 12:53 PM, David Drysdale wrote: >> Signed-off-by: David Drysdale >> --- >> man2/execveat.2 | 153 >> >> 1 file changed,

Re: [PATCHv10 man-pages 5/5] execveat.2: initial man page for execveat(2)

2015-01-09 Thread David Drysdale
On Fri, Jan 9, 2015 at 4:13 PM, Rich Felker wrote: > On Fri, Jan 09, 2015 at 04:47:31PM +0100, Michael Kerrisk (man-pages) wrote: >> On 11/24/2014 12:53 PM, David Drysdale wrote: >> > Signed-off-by: David Drysdale >> > ---

Re: [PATCHv2 1/1] vfs: renumber FMODE_NONOTIFY and add to uniqueness check

2015-01-08 Thread David Drysdale
On Wed, Jan 7, 2015 at 12:29 AM, Andrew Morton wrote: > On Mon, 24 Nov 2014 11:23:19 +0000 David Drysdale wrote: > >> Fix clashing values for O_PATH and FMODE_NONOTIFY on sparc. >> The clashing O_PATH value was added in 5229645bdc35f1cc43eb ("vfs: add >> nonconfli

Re: [PATCH] selftests/exec: allow shell return code of 126

2015-01-06 Thread David Drysdale
On Mon, Jan 5, 2015 at 7:03 PM, Shuah Khan wrote: > On 01/05/2015 04:19 AM, David Drysdale wrote: >> When the shell fails to invoke a script because its path name >> is too long (ENAMETOOLONG), most shells return 127 to indicate >> command not found. However, some systems re

[PATCHv2] selftests/exec: allow shell return code of 126

2015-01-06 Thread David Drysdale
Uytterhoeven Signed-off-by: David Drysdale Tested-by: Geert Uytterhoeven --- tools/testing/selftests/exec/execveat.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c index

[PATCH] selftests/exec: allow shell return code of 126

2015-01-05 Thread David Drysdale
Uytterhoeven Signed-off-by: David Drysdale --- tools/testing/selftests/exec/execveat.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c index d273624c93a6..0d940c6e26bd

Re: [PATCH] selftests/exec: Use %zu to format size_t

2015-01-02 Thread David Drysdale
gt; > fail += check_execveat(fd, "", AT_EMPTY_PATH); > > } else { > > - printf("Failed to open length %lu filename, errno=%d (%s)\n", > > + printf("Failed to open length %zu filename, errno=%d (%s)\n",

Re: Linux 3.19-rc1 - merge window closed

2014-12-22 Thread David Drysdale
On 22 Dec 2014 18:02, "Linus Torvalds" wrote: > > On Mon, Dec 22, 2014 at 2:43 PM, Nicholas A. Bellinger > wrote: > > On Mon, 2014-12-22 at 21:56 +0100, Jiri Kosina wrote: > >> On Mon, 22 Dec 2014, Andrew Morton wrote: > >> > >> > On Sat, 20 Dec 2014 23:11:39 -0800 "Nicholas A. Bellinger

Re: [PATCH selftest fails!] m68k: Wire up execveat

2014-12-22 Thread David Drysdale
[Re-send from a different email address because I apparently can't send plaintext from gMail on my phone.] On 21 Dec 2014 09:37, "Andreas Schwab" wrote: > Geert Uytterhoeven writes: > Check success of execveat(5, '...', 0)... [FAIL] (child 792 exited

Re: [PATCHv10 2/5] x86: Hook up execveat system call.

2014-11-24 Thread David Drysdale
On Mon, Nov 24, 2014 at 5:06 PM, Dan Carpenter wrote: > On Mon, Nov 24, 2014 at 11:53:56AM +0000, David Drysdale wrote: >> Hook up x86-64, i386 and x32 ABIs. >> >> Signed-off-by: David Drysdale > > This one has been breaking my linux-next build for the past week. I&#

[PATCHv10 4/5] sparc: Hook up execveat system call.

2014-11-24 Thread David Drysdale
Signed-off-by: David Drysdale --- arch/sparc/include/uapi/asm/unistd.h | 3 ++- arch/sparc/kernel/syscalls.S | 10 ++ arch/sparc/kernel/systbls_32.S | 1 + arch/sparc/kernel/systbls_64.S | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch

[PATCHv10 2/5] x86: Hook up execveat system call.

2014-11-24 Thread David Drysdale
Hook up x86-64, i386 and x32 ABIs. Signed-off-by: David Drysdale --- arch/x86/ia32/audit.c| 1 + arch/x86/ia32/ia32entry.S| 1 + arch/x86/kernel/audit_64.c | 1 + arch/x86/kernel/entry_64.S | 28 arch/x86/syscalls/syscall_32.tbl

[PATCHv10 3/5] syscalls: add selftest for execveat(2)

2014-11-24 Thread David Drysdale
Signed-off-by: David Drysdale --- tools/testing/selftests/Makefile| 1 + tools/testing/selftests/exec/.gitignore | 9 + tools/testing/selftests/exec/Makefile | 25 ++ tools/testing/selftests/exec/execveat.c | 397 4 files changed, 432 insertions

[PATCHv10 man-pages 5/5] execveat.2: initial man page for execveat(2)

2014-11-24 Thread David Drysdale
Signed-off-by: David Drysdale --- man2/execveat.2 | 153 1 file changed, 153 insertions(+) create mode 100644 man2/execveat.2 diff --git a/man2/execveat.2 b/man2/execveat.2 new file mode 100644 index ..937d79e4c4f0 --- /dev

[PATCHv10 1/5] syscalls: implement execveat() system call

2014-11-24 Thread David Drysdale
O_CLOEXEC file descriptor fails (as the file will not be accessible after exec). Based on patches by Meredydd Luff Signed-off-by: David Drysdale --- fs/binfmt_em86.c | 4 ++ fs/binfmt_misc.c | 4 ++ fs/binfmt_script.c| 10 fs/e

[PATCHv10 0/5] syscalls,x86,sparc: Add execveat() system call

2014-11-24 Thread David Drysdale
ed by Al Viro). - Filled in bprm->filename with d_path() into a buffer, to avoid use of potentially-ephemeral dentry->d_name. - Patch against v3.14 (455c6fdbd21916). David Drysdale (4): syscalls: implement execveat() system call x86: Hook up execveat system call. syscalls: add sel

[PATCHv2 1/1] vfs: renumber FMODE_NONOTIFY and add to uniqueness check

2014-11-24 Thread David Drysdale
TIFY and __O_SYNC in sparc conflict"), and all of this will happen again -- so update the uniqueness check in fcntl_init() to include __FMODE_NONOTIFY. Signed-off-by: David Drysdale Acked-by: David S. Miller --- fs/fcntl.c | 5 +++-- include/linux/fs.h | 2 +-

[PATCHv2 0/1] vfs: renumber FMODE_NONOTIFY and add to uniqueness check

2014-11-24 Thread David Drysdale
, parisc, blackfin. David Drysdale (1): vfs: renumber FMODE_NONOTIFY and add to uniqueness check fs/fcntl.c | 5 +++-- include/linux/fs.h | 2 +- include/uapi/asm-generic/fcntl.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) -- 2.1.0.rc2.206.gedb03e5

Re: [PATCHv2 2/3] selftests: Add test of O_BENEATH & openat(2)

2014-11-21 Thread David Drysdale
On Tue, Nov 11, 2014 at 5:36 AM, Dave Chinner wrote: > [cc fste...@vger.kernel.org] > > On Tue, Nov 04, 2014 at 09:54:43AM +0000, David Drysdale wrote: >> Add simple tests of openat(2) variations, including examples that >> check the new O_BENEATH flag. >> >&

[PATCH] vfs: renumber FMODE_NONOTIFY and add to uniqueness check

2014-11-21 Thread David Drysdale
ned-off-by: David Drysdale --- fs/fcntl.c | 5 +++-- include/linux/fs.h | 4 ++-- include/uapi/asm-generic/fcntl.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/fcntl.c b/fs/fcntl.c index 99d440a4a6ba..ee85cd4e136a 100644 --- a/fs/fcn

Re: sparc: Clashing values for O_PATH and FMODE_NONOTIFY?

2014-11-20 Thread David Drysdale
On Thu, Nov 20, 2014 at 7:12 PM, Eric Paris wrote: > On Thu, 2014-11-20 at 12:12 +0000, David Drysdale wrote: >> [+linux-fsdevel, without the typo this time] >> >> On Wed, Nov 19, 2014 at 8:30 PM, David Miller wrote: >> > From: David Drysdale >> >

Re: sparc: Clashing values for O_PATH and FMODE_NONOTIFY?

2014-11-20 Thread David Drysdale
[+linux-fsdevel, without the typo this time] On Wed, Nov 19, 2014 at 8:30 PM, David Miller wrote: > From: David Drysdale > Date: Tue, 18 Nov 2014 13:13:51 + > >> Hi folks, >> >> It looks like the value for O_PATH on sparc: >> >> arch/sparc/inc

Re: [PATCHv9 4/5] sparc: Hook up execveat system call.

2014-11-20 Thread David Drysdale
On Wed, Nov 19, 2014 at 11:42 PM, Stephen Rothwell wrote: > Hi David, > > On Wed, 19 Nov 2014 17:27:51 +0000 David Drysdale wrote: >> >> diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S >> index 580cde9370c9..15069cb35dac 100644 >> -

[PATCHv9 2/5] x86: Hook up execveat system call.

2014-11-19 Thread David Drysdale
Hook up x86-64, i386 and x32 ABIs. Signed-off-by: David Drysdale --- arch/x86/ia32/audit.c| 1 + arch/x86/ia32/ia32entry.S| 1 + arch/x86/kernel/audit_64.c | 1 + arch/x86/kernel/entry_64.S | 28 arch/x86/syscalls/syscall_32.tbl

[PATCHv9 3/5] syscalls: add selftest for execveat(2)

2014-11-19 Thread David Drysdale
Signed-off-by: David Drysdale --- tools/testing/selftests/Makefile| 1 + tools/testing/selftests/exec/.gitignore | 9 + tools/testing/selftests/exec/Makefile | 25 ++ tools/testing/selftests/exec/execveat.c | 397 4 files changed, 432 insertions

[PATCHv9 4/5] sparc: Hook up execveat system call.

2014-11-19 Thread David Drysdale
Signed-off-by: David Drysdale Acked-by: David S. Miller --- arch/sparc/include/uapi/asm/unistd.h | 3 ++- arch/sparc/kernel/systbls_32.S | 1 + arch/sparc/kernel/systbls_64.S | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/uapi/asm/unistd.h

[PATCHv9 1/5] syscalls: implement execveat() system call

2014-11-19 Thread David Drysdale
O_CLOEXEC file descriptor fails (as the file will not be accessible after exec). Based on patches by Meredydd Luff Signed-off-by: David Drysdale --- fs/binfmt_em86.c | 4 ++ fs/binfmt_misc.c | 4 ++ fs/binfmt_script.c| 10 fs/e

[PATCHv9 man-pages 5/5] execveat.2: initial man page for execveat(2)

2014-11-19 Thread David Drysdale
Signed-off-by: David Drysdale --- man2/execveat.2 | 153 1 file changed, 153 insertions(+) create mode 100644 man2/execveat.2 diff --git a/man2/execveat.2 b/man2/execveat.2 new file mode 100644 index ..937d79e4c4f0 --- /dev

[PATCHv9 0/5] syscalls,x86,sparc: Add execveat() system call

2014-11-19 Thread David Drysdale
ce Meredydd's v3 patch: - Added a selftest. - Added a man page. - Left open_exec() signature untouched to reduce patch impact elsewhere (as suggested by Al Viro). - Filled in bprm->filename with d_path() into a buffer, to avoid use of potentially-ephemeral dentry->d_name. - Pat

sparc: Clashing values for O_PATH and FMODE_NONOTIFY?

2014-11-18 Thread David Drysdale
Hi folks, It looks like the value for O_PATH on sparc: arch/sparc/include/uapi/asm/fcntl.h:37:#define O_PATH 0x100 clashes with the arch-independent value for __FMODE_NONOTIFY: include/linux/fs.h:137:#define FMODE_NONOTIFY ((__force fmode_t)0x100) include/linux/fs.h:2764:#define _

[PATCHv8 3/4] sparc: Hook up execveat system call.

2014-11-14 Thread David Drysdale
Signed-off-by: David Drysdale --- arch/sparc/include/uapi/asm/unistd.h | 3 ++- arch/sparc/kernel/systbls_32.S | 1 + arch/sparc/kernel/systbls_64.S | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi

[PATCHv8 1/4] syscalls,x86: implement execveat() system call

2014-11-14 Thread David Drysdale
O_CLOEXEC file descriptor fails (as the file will not be accessible after exec). Only x86-64, i386 and x32 ABIs are supported in this patch. Based on patches by Meredydd Luff Signed-off-by: David Drysdale --- arch/x86/ia32/audit.c | 1 + arch/x86/ia32/ia32entry.S

[PATCHv8 2/4] syscalls,x86: add selftest for execveat(2)

2014-11-14 Thread David Drysdale
Signed-off-by: David Drysdale --- tools/testing/selftests/Makefile| 1 + tools/testing/selftests/exec/.gitignore | 9 + tools/testing/selftests/exec/Makefile | 25 ++ tools/testing/selftests/exec/execveat.c | 397 4 files changed, 432 insertions

[PATCHv8 man-pages 4/4] execveat.2: initial man page for execveat(2)

2014-11-14 Thread David Drysdale
Signed-off-by: David Drysdale --- man2/execveat.2 | 153 1 file changed, 153 insertions(+) create mode 100644 man2/execveat.2 diff --git a/man2/execveat.2 b/man2/execveat.2 new file mode 100644 index ..937d79e4c4f0 --- /dev

[PATCHv8 0/4] syscalls,x86,sparc: Add execveat() system call

2014-11-14 Thread David Drysdale
hanges since Meredydd's v3 patch: - Added a selftest. - Added a man page. - Left open_exec() signature untouched to reduce patch impact elsewhere (as suggested by Al Viro). - Filled in bprm->filename with d_path() into a buffer, to avoid use of potentially-ephemeral dentr

Re: + syscallsx86-implement-execveat-system-call.patch added to -mm tree

2014-11-14 Thread David Drysdale
On Fri, Nov 14, 2014 at 12:11 AM, Oleg Nesterov wrote: >> @@ -1479,7 +1489,26 @@ static int do_execve_common(struct filen >> >> bprm->file = file; >> - bprm->filename = bprm->interp = filename->name; >> + if (fd == AT_FDCWD || filename->name[0] == '/') { >> + bprm->filena

Re: [PATCHv7 0/3] syscalls,x86: Add execveat() system call

2014-11-13 Thread David Drysdale
On Wed, Nov 12, 2014 at 10:08 PM, Andrew Morton wrote: > On Fri, 7 Nov 2014 17:01:01 +0000 David Drysdale wrote: > >> This patch set adds execveat(2) for x86 > > I grabbed these. If someone else was planning to do so, feel free to > shout at me. > > I haven'

Re: [PATCHv7 0/3] syscalls,x86: Add execveat() system call

2014-11-13 Thread David Drysdale
On Wed, Nov 12, 2014 at 9:50 PM, Andrew Morton wrote: > On Fri, 7 Nov 2014 17:01:01 +0000 David Drysdale wrote: > >> This patch set adds execveat(2) for x86, and is derived from Meredydd >> Luff's patch from Sept 2012 (https://lkml.org/lkml/2012/9/11/528). >> &g

[PATCHv7 0/3] syscalls,x86: Add execveat() system call

2014-11-07 Thread David Drysdale
selftest. - Added a man page. - Left open_exec() signature untouched to reduce patch impact elsewhere (as suggested by Al Viro). - Filled in bprm->filename with d_path() into a buffer, to avoid use of potentially-ephemeral dentry->d_name. - Patch against v3.14 (455c6fdbd21916). David Dry

[PATCHv7 man-pages 3/3] execveat.2: initial man page for execveat(2)

2014-11-07 Thread David Drysdale
Signed-off-by: David Drysdale --- man2/execveat.2 | 153 1 file changed, 153 insertions(+) create mode 100644 man2/execveat.2 diff --git a/man2/execveat.2 b/man2/execveat.2 new file mode 100644 index ..937d79e4c4f0 --- /dev

[PATCHv7 1/3] syscalls,x86: implement execveat() system call

2014-11-07 Thread David Drysdale
O_CLOEXEC file descriptor fails (as the file will not be accessible after exec). Only x86-64, i386 and x32 ABIs are supported in this patch. Based on patches by Meredydd Luff Signed-off-by: David Drysdale --- arch/x86/ia32/audit.c | 1 + arch/x86/ia32/ia32entry.S

  1   2   >