[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55820207.1070101@osg.samsung.com>
Date: Wed, 17 Jun 2015 17:25:59 -0600
From: Shuah Khan <shuahkh@....samsung.com>
To: Kees Cook <keescook@...omium.org>,
Michael Ellerman <mpe@...erman.id.au>
CC: LKML <linux-kernel@...r.kernel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andy Lutomirski <luto@...capital.net>,
Will Drewry <wad@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg KH <gregkh@...uxfoundation.org>,
Mauro Carvalho Chehab <mchehab@....samsung.com>,
"David S. Miller" <davem@...emloft.net>,
Arnd Bergmann <arnd@...db.de>, Joe Perches <joe@...ches.com>,
Jingoo Han <jingoohan1@...il.com>,
Linux API <linux-api@...r.kernel.org>,
Shuah Khan <shuahkh@....samsung.com>
Subject: Re: [PATCH] selftests: add seccomp suite
On 06/17/2015 12:12 PM, Kees Cook wrote:
> On Wed, Jun 17, 2015 at 12:31 AM, Michael Ellerman <mpe@...erman.id.au> wrote:
>> On Tue, 2015-06-16 at 10:54 -0700, Kees Cook wrote:
>>> This imports the existing seccomp test suite into the kernel's selftests
>>> tree. It contains extensive testing of seccomp features and corner cases.
>>> There remain additional tests to move into the kernel tree, but they have
>>> not yet been ported to all the architectures seccomp supports:
>>> https://github.com/redpig/seccomp/tree/master/tests
>>>
>>> Signed-off-by: Kees Cook <keescook@...omium.org>
>>> ---
>>> MAINTAINERS | 1 +
>>> tools/testing/selftests/Makefile | 1 +
>>> tools/testing/selftests/seccomp/.gitignore | 1 +
>>> tools/testing/selftests/seccomp/Makefile | 10 +
>>> tools/testing/selftests/seccomp/seccomp_bpf.c | 2109 ++++++++++++++++++++++++
>>> tools/testing/selftests/seccomp/test_harness.h | 537 ++++++
>>
>>
>> Thanks very much for adding this, it would have been very helpful recently when
>> I was trying to get seccomp filter working on powerpc :)
>>
>> I get one failure in TRACE_syscall.syscall_dropped:
>>
>> seccomp_bpf.c:1394:TRACE_syscall.syscall_dropped:Expected 1 (1) == syscall(207) (18446744073709551615)
>>
>>
>> So it looks like we're returning -1 instead of 1.
>>
>> That's probably a bug in our handling of the return value, or maybe an
>> inconsistency across the arches. I'll try and find time to dig into it.
>
> Ah-ha! Excellent. Did you add an implementation for change_syscall()
> in seccomp_bpf.c? I don't have a powerpc method in there. I would have
> expected both TRACE_syscall.syscall_redirected and .syscall_dropped to
> fail without that.
>
> If you did, maybe something isn't right with regs.SYSCALL_RET ? That's
> where the return value being tested on a skipped syscall is stored.
>
> Thanks for testing!
>
Thanks for the test. Fantastic to see so many positive responses
to this addition. Thanks Michael for testing it. It is now queued
for 4.2 in linux-kselftest next
thanks,
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@....samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists