All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brazdil <dbrazdil@google.com>
To: Ondrej Mosnacek <omosnace@redhat.com>
Cc: SElinux list <selinux@vger.kernel.org>, Paul Moore <paul@paul-moore.com>
Subject: Re: [PATCH testsuite] Add AF_VSOCK SOCK_STREAM client/server tests
Date: Mon, 10 May 2021 09:00:35 +0000	[thread overview]
Message-ID: <YJj2M+DyfRmvoK8Q@google.com> (raw)
In-Reply-To: <CAFqZXNsj7ioO80hNUfwnZY9YZ0jOxc7b0UimCMtySVNnou=B+g@mail.gmail.com>

On Sat, May 08, 2021 at 09:27:01PM +0200, Ondrej Mosnacek wrote:
> On Sat, May 8, 2021 at 7:28 PM Ondrej Mosnacek <omosnace@redhat.com> wrote:
> > On Mon, Mar 29, 2021 at 8:39 PM David Brazdil <dbrazdil@google.com> wrote:
> > > If AF_VSOCK and vsock_loopback are supported by the system, run tests
> > > that exchange a byte of data between a client and a server listening on
> > > VMADDR_CID_LOCAL and a random port.
> > >
> > > Various permissions are removed from the client/server between runs and
> > > it is checked that the corresponding syscalls returned error.
> > >
> > > A newly created vsock_socket inherits the SID of the current process and
> > > it is tested that the vsock_socket returned by accept() inherits the same
> > > SID from its parent.
> > >
> > > SOCK_DGRAM is not tested as it is only supported in the VMCI transport.
> > >
> > > These tests depend on an upstream commit 1f935e8e72ec ("selinux: vsock:
> > > Set SID for socket returned by accept()"). It was first released in v5.12
> > > and backported to all the stable branches.
> > >
> > > Signed-off-by: David Brazdil <dbrazdil@google.com>
> > > ---
> > > This is also posted on GitHub as pull request #75:
> > >   https://github.com/SELinuxProject/selinux-testsuite/pull/75
> > >
> > > The patch that fixes the vsock_socket bug has been merged to 5.12 and
> > > backported to 5.10-stable and 5.11-stable. Backport all the way back
> > > to 4.4-stable is awaiting merging here:
> > >   https://lkml.kernel.org/stable/20210329182443.1960963-1-dbrazdil@google.com
> > > Since the expectation is that all stable kernels will soon have the patch,
> > > I skipped a kernel version check in this test.
> > >
> > >  policy/Makefile                  |   2 +-
> > >  policy/test_vsock_socket.te      |  52 ++++++++++++
> > >  tests/Makefile                   |   2 +-
> > >  tests/vsock_socket/.gitignore    |   3 +
> > >  tests/vsock_socket/Makefile      |   7 ++
> > >  tests/vsock_socket/check_vsock.c |  47 +++++++++++
> > >  tests/vsock_socket/client.c      | 129 ++++++++++++++++++++++++++++
> > >  tests/vsock_socket/server.c      | 140 +++++++++++++++++++++++++++++++
> > >  tests/vsock_socket/test          | 118 ++++++++++++++++++++++++++
> > >  9 files changed, 498 insertions(+), 2 deletions(-)
> > >  create mode 100644 policy/test_vsock_socket.te
> > >  create mode 100644 tests/vsock_socket/.gitignore
> > >  create mode 100644 tests/vsock_socket/Makefile
> > >  create mode 100644 tests/vsock_socket/check_vsock.c
> > >  create mode 100644 tests/vsock_socket/client.c
> > >  create mode 100644 tests/vsock_socket/server.c
> > >  create mode 100755 tests/vsock_socket/test
> >
> > Sorry for the late review... I finally looked at the patch and all
> > looks good, so I applied it (I used the version from the pull
> > request):
> > https://github.com/SELinuxProject/selinux-testsuite/commit/0a3f86ab841efa0f2bbd048243a801915d6808ba
Brilliant, thanks!

> 
> Actually, I missed that there were two compiler warnings when
> compiling the C code. They were trivial, so I pushed a fix:
> https://github.com/SELinuxProject/selinux-testsuite/commit/db6c1cc4c9631e1b44ee5a0c40ec7ede68ab43f9

Oops, thanks for fixing those.

> 
> I also enabled -Werror in CI, so that they are more visible in the future:
> https://github.com/SELinuxProject/selinux-testsuite/commit/0b78a9d433e8c4f956d18dc0db901f0a1a58c003
> 
> -- 
> Ondrej Mosnacek
> Software Engineer, Linux Security - SELinux kernel
> Red Hat, Inc.
> 

      reply	other threads:[~2021-05-10  9:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 18:39 [PATCH testsuite] Add AF_VSOCK SOCK_STREAM client/server tests David Brazdil
2021-05-08 17:28 ` Ondrej Mosnacek
2021-05-08 19:27   ` Ondrej Mosnacek
2021-05-10  9:00     ` David Brazdil [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJj2M+DyfRmvoK8Q@google.com \
    --to=dbrazdil@google.com \
    --cc=omosnace@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.