Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2133828imd; Fri, 2 Nov 2018 06:34:16 -0700 (PDT) X-Google-Smtp-Source: AJdET5f4+WR6KhMxDZXekhYUasHDJWOQRrwHWK9OZrY7az6xBHInCUvdZSfNZdKvqlqfTC6IaRaI X-Received: by 2002:a17:902:8306:: with SMTP id bd6-v6mr11757315plb.321.1541165656199; Fri, 02 Nov 2018 06:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541165656; cv=none; d=google.com; s=arc-20160816; b=qouRmc+Xxa+10fDv5myjNIpzfksowRe5ll4Uux9Rr9bl++M/IQN9STGQWUHhTzIxnF t6FZD40rrvkQttySTjbFQY5a0L5J+nN9J5Thcyh9x0X3IBzsHk2z77bFpMI+i655tARm z1Q0fEUBX6hjpDJRjgjCjvceKR3TKwBw5s+4cfpHxrWt1/eqPNzgCmZ3tOSz1ah27j8g e45ahjJQm4XafuD27H0rscIa/F+nnzNPXmUoFdsV12Eq+5kuqy3x+Ba91YjnSgFw6e60 Jbv+ZyS1z7U21RQLTYKCI+9LrezMuJtqlZsZ2WvuKid7Z05D/gOI0C2EtXwME7QA81Lm ymrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=iiBj4MNKBy7fOpxwwS5hRmTxjV00jauWji3Oo4eSyFw=; b=GLhMwfQ5POWwpO0aAlgm1qBSVaCbFMzD5+Cnh/GaBYAQtn4I9pt9mKvYIA0mhrfBTk GUxqhv+HPWGQ4bSSjGYNUxjoDFdB8A+F5AL8uLRmtLFA+QIfzqoA/MyOUJnadWrLOcGF Cmy1bDsbTIk0nRpO+n7MIa2H7HFXLDB8G7neqV5hFSwUZH7XXkMK7CAMJDLZg2Uun+Ea +zx5qoob5V2WfJS9ddfG4iCl545RyqfW8kkkkGwt21KAmNXlrfeGSdA5Po38XXMUqFdJ 890l0w2mF5GqeJwUfeuldI4zY2Ge38CTs5X9pPxvhAagG3odQV1/J0qNFvJwXVJVLyoj SzFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ihJToZ8+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9-v6si33044651plt.28.2018.11.02.06.34.00; Fri, 02 Nov 2018 06:34:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ihJToZ8+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727836AbeKBWkK (ORCPT + 99 others); Fri, 2 Nov 2018 18:40:10 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:38300 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbeKBWkJ (ORCPT ); Fri, 2 Nov 2018 18:40:09 -0400 Received: by mail-ot1-f67.google.com with SMTP id f24so1689928otl.5 for ; Fri, 02 Nov 2018 06:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iiBj4MNKBy7fOpxwwS5hRmTxjV00jauWji3Oo4eSyFw=; b=ihJToZ8+XnHw33trEUWuPenyaV2K6vcx/9Lbd6fLp2bni26va5F+Cr+6dkeR9yBh/H hnTpsxM/Y6aOM8uVVvMAZxioV15M6kVFVb3NsCXfACjdb+u5WM5XpOwpKAHJIQV4B/hZ ohR0bxRmYGXpzvjUAAJGfYlGuoTUV+hjtK03muq8WN1c9m6CBRTs/JlYT2BqWmRtmaTA sobPGS8ValyGPn4+cFB34mrYnaB2aYkg4jsbJLzD2/QGYZbpkeD2S3Yz3Ot2RrnF66A/ 58TGOK/xGEQdEMa95LNC3Yim3rEdXAf7tKa+4Ufhb4Odffw11Hrv/hLy4ASR7RToERLi 4E5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iiBj4MNKBy7fOpxwwS5hRmTxjV00jauWji3Oo4eSyFw=; b=USCYQacMfikk25AR967ykPPEP1H48Ws7tRbIOqQrEVz/be0HOrdy9ZWlxhbbRyjojU UU+c6CRgY4N69ucoZWwlqyuGY0WazbovmD9RSmJD7i8F51u5Wc91syc3AS1wTVFG89Qc FnlgQzlZvIQ+o59UrYQjssBeoLTEkBdUgtw1q9hdKmSKvFRScjJ7rfMjSGB01wLu4nk+ Niepq7ukPrmPaJ1x6Rn/fFnBJhwar+JgwhGNDkIwQaAMaTTm6iOEohda5cBbi6I2Ltj1 ng+Skpk/yy2tMqdVMpVhfwqeRwN3SaRks80KlyvuCzjaWRwVbPUPoGaAX2LYZnlxLrNX G49A== X-Gm-Message-State: AGRZ1gJrQ8Hk8G3q8UwTF9gK06U0IrtPd+AqV9+MwiN5TvVofNZ1JnrM asVVAhZVnpORRuv/y5RQnJFuIkCN/UN/0aRG2SE= X-Received: by 2002:a9d:2fac:: with SMTP id r41mr6741407otb.169.1541165578824; Fri, 02 Nov 2018 06:32:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Abdurachmanov Date: Fri, 2 Nov 2018 14:32:47 +0100 Message-ID: Subject: Re: [PATCH 2/2] RISC-V: Add support for SECCOMP To: Palmer Dabbelt Cc: Paul Moore , linux-riscv@lists.infradead.org, aou@eecs.berkeley.edu, eparis@redhat.com, Kees Cook , luto@amacapital.net, Will Drewry , wesley@sifive.com, dhowells@redhat.com, tglx@linutronix.de, Philippe Ombredanne , gregkh@linuxfoundation.org, Kate Stewart , linux-kernel@vger.kernel.org, linux-audit@redhat.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 29, 2018 at 9:27 PM Palmer Dabbelt wrote: > > On Sun, 28 Oct 2018 04:07:55 PDT (-0700), david.abdurachmanov@gmail.com wrote: > > On Thu, Oct 25, 2018 at 10:36 PM Paul Moore wrote: > >> > >> On Thu, Oct 25, 2018 at 2:31 PM David Abdurachmanov > >> wrote: > >> > On Wed, Oct 24, 2018 at 10:40 PM Palmer Dabbelt wrote: > >> > > From: "Wesley W. Terpstra" > >> > >> ... > >> > >> > Palmer, > >> > > >> > Half of the patch seems to touch audit parts. I started working on audit > >> > support this morning, and I can boot Fedora with audit traces. > >> > > >> > [root@fedora-riscv ~]# dmesg | grep audit > >> > [ 0.312000] audit: initializing netlink subsys (disabled) > >> > [ 0.316000] audit: type=2000 audit(0.316:1): state=initialized > >> > audit_enabled=0 res=1 > >> > [ 7.288000] audit: type=1130 audit(1529665913.772:2): pid=1 uid=0 > >> > auid=4294967295 ses=4294967295 msg='unit=systemd-remount-fs > >> > comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? > >> > terminal=? res=success' > >> > [ 7.684000] audit: type=1130 audit(1529665914.176:3): pid=1 uid=0 > >> > auid=4294967295 ses=4294967295 msg='unit=systemd-sysctl comm="systemd" > >> > exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? > >> > res=success' > >> > [..] > >> > > >> > I am still working on audit user-space support for better testing. > >> > > >> > I suggest we first implement audit and then seccomp. > >> > >> FYI, while small and far from comprehensive, we do have a test suite > >> we use for basic validation of the audit kernel bits which may be > >> helpful while you're working on the audit enablement: > >> > >> * https://github.com/linux-audit/audit-testsuite > > > > Currently I checked the following to work: > > - /proc/self/loginuid (required by DNF [package manager]) > > - auditctl (checked several different example rules from internet) > > - aulast > > - aulastlog > > - ausearch > > - ausyscall > > - aureport > > - autrace (compared some syscalls to strace: order and > > return value/input arguments seems to be correct) > > > > I checked audit-testsuite yesterday and it seems to be only for > > x86-64 / x86-32. After adjusting it (MODE, syscalls) I am at: > > > > Failed 4/14 test programs. 19/88 subtests failed. > > > > I don't plan to look further in the failure, e.g.: > > - syscall_socketcall: that's an old stuff and not relevant to > > new arches > > - syscall_module: Fedora kernel currently is not compiled > > with kernel loadable module support > > - filter_exclude: two tests fail because id -Z doesn't print > > any categories, but "semanage login -l" output is identical > > between x86_64 and riscv64 > > - netfilter_pkt: don't have CONFIG_IP_NF_MANGLE enabled > > > > Fedora kernel currently has minimal CONFIG_* options > > and is built without loadable module support. > > > > I will send the patches for review soon. > > Thanks! I fixed the last issue I see with SECCOMP this morning. I also have patch on top of libseccomp-2.3.3. Testsuite results for SIM: Regression Test Summary tests run: 4434 tests skipped: 88 tests passed: 4434 tests failed: 0 tests errored: 0 Testsuite results for LIVE: Regression Test Summary tests run: 6 tests skipped: 0 tests passed: 6 tests failed: 0 tests errored: 0 Then tested a couple examples manually w/ and w/o BPF and it performed the same as on x86_64 (also checked exit codes & strace output). Upstream libseccomp has now more tests. Once I rebase & re-test with master of libseccomp, I will send both. david