Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2970209imu; Wed, 7 Nov 2018 02:46:46 -0800 (PST) X-Google-Smtp-Source: AJdET5cUxNACdKu8aa4uk9dCOwpiJdS2lq4kpwv6UlK1Vjgnq/K0RF+HHsiEtRh4HArJrIWwzt7d X-Received: by 2002:a17:902:a9cb:: with SMTP id b11-v6mr1327794plr.219.1541587606033; Wed, 07 Nov 2018 02:46:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541587606; cv=none; d=google.com; s=arc-20160816; b=z3ZKlZv0uzlpcYcS7cv0aZYA96eZXc6kWrPavwWoaDvqi8peuvgjkRsQ3kliIZPYIu 7ijE6xOlotSPzq+ZQOMaf3SYb9knUxCmv0QyO/hAxKKMfEjX2RIaYBDaBXQgN7GyRLYs xlBjb7J8wgn+Kt2x7hLZYwMpr9eaae4B6VTxMidJs5Qh3BV01EgtNU1pX32h/RchPPIW rvsvjm0MWHgT1ZD9LNVMoSdbz+wdNbt8iz8zEAn03EX44mZf/BFd/5Fd8vby/inIpLjz RXlFpgH2VlbfLLd1jv/Q6gawvKgpBWjZBT3A6Y/WmjOuk97FKkknjKLbwYOlxT58JgRt 5cDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5d2sZmArluhobQqxaA/yYKQnmCmIhPyJnd73IUvKZvs=; b=pB6XJ0hs55zrrmG/yikXBpJPMcHv7zHErl6yEjJfGqCuQ69hHbZfdtvsxbD1orzJR0 M/azgbueRkyMvJwJYdGIYRwSncPTeoI+KE9WkxwxkWg9vJoOTe8ZbuYcNMwZ8oMODP7P bwp08z2phWUREBH5jTV2D2vol9oK6m8gXevz5iuN+RIds/kMnyPYBeT72Se6iwr02LWx Z0uzN9etylcruRiK0vIljfuW28IBvaMkpTJADl+vfPcekAC0DAQEEghn6ntYGW9G4YMb 7YnMlQ7kkuSOiTkCAoZF8odWj1AKt3QFBwjWXYIP6VK/OnHACnTIgm01aX3uQc7RqH0T my4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qcWCXRhN; 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 p23si200176pgk.312.2018.11.07.02.46.31; Wed, 07 Nov 2018 02:46:46 -0800 (PST) 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=qcWCXRhN; 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 S1730800AbeKGUPy (ORCPT + 99 others); Wed, 7 Nov 2018 15:15:54 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:46262 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbeKGUPy (ORCPT ); Wed, 7 Nov 2018 15:15:54 -0500 Received: by mail-ot1-f65.google.com with SMTP id q5so14298632otl.13 for ; Wed, 07 Nov 2018 02:46:06 -0800 (PST) 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:content-transfer-encoding; bh=5d2sZmArluhobQqxaA/yYKQnmCmIhPyJnd73IUvKZvs=; b=qcWCXRhNFqra5eSKHEGVNR76q5Mk5vIjjPXZ8J2XvfNfq0TSMVqhabJNJGtfbTEIJt IWn7WHYXayi11Nq8N/UNFgX5TBdzemN3pYiNhSPn5ILYFnb6U9BagkLZMC9hWLEPvOzf prhxde3xSvytNcppJ4iOGREmKmPOoX1wU9G34ORrCV1F8mgsmhg5CwTCOtW4+jvRxZqq fmOuPGBz9nIBPkGDk/c5Y4IDQOS4B6jvNrwpqe/OQL1bA8WMtDa31K66ehfzSa4IzWMA OXIZue3b8IkxXRyfpvYPvtbswlVzujwk/I8zr5Gcv8aJnUph4RI44vadEkQlOxjBsLc3 AfAw== 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:content-transfer-encoding; bh=5d2sZmArluhobQqxaA/yYKQnmCmIhPyJnd73IUvKZvs=; b=J6dH+6BW3oAUY52VLyujPAFA1964CyUGCpC9c+MV6ewtSTYVCMEx02gsXTvGB49PXj APmSn89A07GxlnGwFriRHffc0fuvCcU9BpSPqpkoM5KIYrbpkxhacuNQ/ZeF7aWemqny Zq3XbTKvfRPlaSAr8deAi5FPCUUrnCHybQFy4N5s5bMR/vMMEELQQDCWd1xfgIttWVKQ dlH0Q3MwknxfF+Oydsbq/a12W5qGmp2nTfHldnBeppUB5qBuVZXQvbVmU8OaeYwtQhL6 o2ez5Q29dB0plvPwiHSPMegzQrKNSZYnRuAtZTlO0dkmqyFl4858ppFABNREWotoWp9k pmgw== X-Gm-Message-State: AGRZ1gLIwT/JjeFsEWTD8JRN45M01UJptAIx+mR/8nHY2BmHw7hqC59N +H24jTOAUnbzGNowv/UHrjxms4sjn2iofSahASk= X-Received: by 2002:a9d:6315:: with SMTP id q21mr782901otk.174.1541587565520; Wed, 07 Nov 2018 02:46:05 -0800 (PST) MIME-Version: 1.0 References: <20181029104854.17432-1-david.abdurachmanov@gmail.com> In-Reply-To: From: David Abdurachmanov Date: Wed, 7 Nov 2018 11:45:53 +0100 Message-ID: Subject: Re: [PATCH 0/2] riscv: add audit support To: Paul Moore Cc: Palmer Dabbelt , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 6, 2018 at 10:25 PM David Abdurachmanov wrote: > > On Tue, Nov 6, 2018 at 9:06 PM Paul Moore wrote: > > > > On Mon, Oct 29, 2018 at 6:49 AM David Abdurachmanov > > wrote: > > > This patchset adds system call audit support on riscv (riscv32 & > > > riscv64). > > > > > > The pachset was prepared on top of v4.19 tag. > > > > > > audit-userspace changes were submitted. See: > > > https://github.com/linux-audit/audit-userspace/pull/73 > > > > > > Tested the following manually: > > > - 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 seem to be correct) > > > - /proc/self/loginuid (required by DNF [package manager]) > > > > > > I looked into audit-testsuite and with some adjustments results are: > > > > > > Failed 4/14 test programs. 19/88 subtests failed. > > > > I realize that the test suite failures are likely not due to your > > code, but rather shortcomings in the test suite itself, but I think it > > is important to resolve these problems before we commit the kernel > > changes. I did some extra work this evening (well, after midnight) and I am passing all bits I would expect to pass. Test Summary Report ------------------- syscall_socketcall/test (Wstat: 0 Tests: 3 Failed: 3) Failed tests: 1-3 Files=3D14, Tests=3D88, 107 wallclock secs ( 1.07 usr 0.38 sys + 58.77 cusr 19.32 csys =3D 79.54 CPU) Result: FAIL Failed 1/14 test programs. 3/88 subtests failed. The only failing test now is syscall_socketcall, which is not supported on riscv and others. From man page: On a some architectures-for example, x86-64 and ARM=E2=80=94there is no socketcall() system call; instead socket(2), accept(2), bind(2), and so on really are implemented as separate system calls. Then I redone syscall_socketcall test to fit new 64-bit arches. It still mostly checks the same thing, but uses different syscall. Instead of socketcall(SYS_CONNECT, ..) we check for connect(..). This will not generate SOCKETCALL record, thus instead check for SYSCALL record where syscall=3Dconnect. All is here: https://github.com/davidlt/audit-testsuite/commits/riscv64 With that: Running as user root with context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 on system Fedora exec_execve/test ......... ok exec_name/test ........... ok file_create/test ......... ok file_delete/test ......... ok file_rename/test ......... ok filter_exclude/test ...... ok filter_sessionid/test .... ok login_tty/test ........... ok lost_reset/test .......... ok netfilter_pkt/test ....... ok syscalls_file/test ....... ok syscall_module/test ...... ok syscall_socketcall/test .. ok user_msg/test ............ ok All tests successful. Files=3D14, Tests=3D88, 123 wallclock secs ( 1.26 usr 0.59 sys + 70.85 cusr 22.60 csys =3D 95.30 CPU) Result: PASS Same audit kernel patch and libaudit, nothing changed here. Hopefully this allows to move forward as I would love to have audit & seccomp in the next kernel version (and thus Fedora). Thanks, david