Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4016356imu; Mon, 7 Jan 2019 13:54:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN5E9l9TtD17RWd4WwyKZZDsF7Wk3q44WVAOf6nYmuacNnbWe+2Z+TzHh8lx24rApOgN5AHO X-Received: by 2002:a63:e001:: with SMTP id e1mr12424234pgh.39.1546898088299; Mon, 07 Jan 2019 13:54:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546898088; cv=none; d=google.com; s=arc-20160816; b=wt0l9o/ZwRac9ZNs/WMXpDzMpaMNwMK2OAl7u6eiNUW4MXGbzyC1JiOnIOB41cFzFb P3iy28r3v7gcgemFOR6+G+B55S76AYtVJyn12woh+apjljPa3387HNiigMWL6QEarhsr mz+QuFsSTcJhkEIFf5PfuhxDREqkYCshdO5Sh98WUKOFylYVVZ5I9fOIB55Unp4+BDtL eHTocEYgApWYcofVI0HDiuXMge/KRcNfriumdomK3Dobcs550Dckma6lXDPDTaYiju6c 7LouJheJojLqmz0FnB6yu2Bxk2p2AuDyGAFvigvy3WWPbldShvVqPw5iMfFeL3URqIqv HwiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3ihpYysV7r1UoHl/0ejXOEq8g6731AzB2PM1+Cvg2Kk=; b=rTpXBb6p3/p+qLM7razGiF7/Ra6WmeDWmk158tGKN8x1BlpFpZtdhvfphbUV5t20uD sCd420FbF64crDxDdy7OMEzGu5gyCiH3sjdoG9itPzV+kz6Om1zX13jAe5bcI3RuRrw4 K70VHRGqSjdpz4VPI9YnxqCNGcBSVqnECVpKaB1t9sENBUN339rmnCoH9aNcN4YXG4ZT EFHIBS1Ee8hiM5eF7e3uFDkALqOPTNPe2bXj0miebnTckaJs76W92CPEDzRs6+PAgi/4 wr3cab85csBlQEHjxq8ZC9V+s4tXP5re2ZIB2r4YuLlgB8UAK26tO6mzD4kYXD0ND+Q2 80KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=rkiHpKAK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a16si18473441plm.365.2019.01.07.13.54.32; Mon, 07 Jan 2019 13:54:48 -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=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=rkiHpKAK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbfAGVxY (ORCPT + 99 others); Mon, 7 Jan 2019 16:53:24 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:41077 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbfAGVxX (ORCPT ); Mon, 7 Jan 2019 16:53:23 -0500 Received: by mail-yb1-f194.google.com with SMTP id j10so776790ybj.8 for ; Mon, 07 Jan 2019 13:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho-ws.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3ihpYysV7r1UoHl/0ejXOEq8g6731AzB2PM1+Cvg2Kk=; b=rkiHpKAKAHcU+nls5ju49i6OLK/vbHYaVlbCwFjsmuPmDAhaVcSUtRcXQWKfA//7tB +LbLFCGQyVS7/lIXQ2NVXi9Y7Zff35J13dN54XQ3vP8parrz+pYdb1gYW/OPEhGR/byH IQ6JlrxLKcQJOXG1zNn98FIiZAQsWDv/+jeEFMkNSQzzdvr8rkOORbm4kTogZN3F8TAk FoWyUptbk6M1d9UUY3SNMHMtdM2AUijH69aMGHKv30HJCySy4R8Cd/liVoXKvdc0SpoJ 1JvyOeyW8Uq6o7XvMefHfMXv7YJWBMu08YXGejFknDmSjL0ii864nRub85IXDllV8mbU peQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3ihpYysV7r1UoHl/0ejXOEq8g6731AzB2PM1+Cvg2Kk=; b=HwqXri4bjt0+L0zMvfNkOWjlu0rJE1cmlH905QKjQm/tCNqA+//UGQiqHJ+8xZtPJZ hSNzoiwkoXoN5V6EVTEj1LO4jLDjzIXE2MDa0m8H2jRUXL6uLEgTDJio/CYt52tPDtbJ CgZiW0c9XJyFb9B8hk8kigaC/0lamS883a947+E+dc7rmWQDjcNpPvnPxXn+x5n4QftA ubhW96UHzVqWtamZeE90KzDT7TjdYX2tU0Orqm5aRRep25cPyW/Xw0XZUMA1zgXxRTz2 ZhPRm/DZx3Lwj8Egw1ZmhQ5vXmOEBMduuJw2KM1PRfNNTUJSWTif3+kERfeqvy1GQrn0 3U9Q== X-Gm-Message-State: AJcUukdkT9XbSghXZzE4tqksu5I5RGyZfznIBsDgXwgKin+gJdRsxPYr SBxWU0sai+tRj4FGPlnFPHb3hg== X-Received: by 2002:a25:3a84:: with SMTP id h126mr26846169yba.87.1546898001731; Mon, 07 Jan 2019 13:53:21 -0800 (PST) Received: from cisco ([2601:282:901:dd7b:c092:9114:ac14:211f]) by smtp.gmail.com with ESMTPSA id h145sm26469437ywc.72.2019.01.07.13.53.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Jan 2019 13:53:21 -0800 (PST) Date: Mon, 7 Jan 2019 14:53:19 -0700 From: Tycho Andersen To: Kees Cook Cc: Ingo Molnar , James Morris , Linus Torvalds , LKML , linux-security-module , Thomas Gleixner , Borislav Petkov Subject: Re: [GIT PULL] security: seccomp changes for v4.21 Message-ID: <20190107215319.GD29009@cisco> References: <20190107101540.GA87402@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Jan 07, 2019 at 01:09:09PM -0800, Kees Cook wrote: > On Mon, Jan 7, 2019 at 2:15 AM Ingo Molnar wrote: > > > > > > * James Morris wrote: > > > > > From Kees: > > > > > > "- Add SECCOMP_RET_USER_NOTIF > > > > > > - seccomp fixes for sparse warnings and s390 build (Tycho)" > > > > > > > > > > > > The following changes since commit 1072bd678547f8663cfb81a22fdb50c589e4976e: > > > > > > security: fs: make inode explicitly non-modular (2018-12-12 14:58:51 -0800) > > > > > > are available in the Git repository at: > > > > > > git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-seccomp > > > > > > for you to fetch changes up to 55b8cbe470d103b44104c64dbf89e5cad525d4e0: > > > > > > Merge tag 'seccomp-next-part2' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into next-seccomp (2018-12-17 11:36:26 -0800) > > > > > > ---------------------------------------------------------------- > > > James Morris (2): > > > Merge tag 'seccomp-next' of https://git.kernel.org/.../kees/linux into next-seccomp > > > Merge tag 'seccomp-next-part2' of https://git.kernel.org/.../kees/linux into next-seccomp > > > > > > Tycho Andersen (6): > > > seccomp: hoist struct seccomp_data recalculation higher > > > seccomp: switch system call argument type to void * > > > seccomp: add a return code to trap to userspace > > > samples: add an example of seccomp user trap > > > seccomp: fix poor type promotion > > > seccomp, s390: fix build for syscall type change > > > > > > Documentation/ioctl/ioctl-number.txt | 1 + > > > Documentation/userspace-api/seccomp_filter.rst | 84 +++++ > > > arch/s390/kernel/compat_wrapper.c | 2 +- > > > include/linux/seccomp.h | 9 +- > > > include/linux/syscalls.h | 2 +- > > > include/uapi/linux/seccomp.h | 40 ++- > > > kernel/seccomp.c | 467 ++++++++++++++++++++++++- > > > samples/seccomp/.gitignore | 1 + > > > samples/seccomp/Makefile | 7 +- > > > samples/seccomp/user-trap.c | 375 ++++++++++++++++++++ > > > tools/testing/selftests/seccomp/seccomp_bpf.c | 447 ++++++++++++++++++++++- > > > 11 files changed, 1411 insertions(+), 24 deletions(-) > > > create mode 100644 samples/seccomp/user-trap.c > > > > 32-bit x86 allyesconfig doesn't build: > > > > /usr/bin/ld: i386:x86-64 architecture of input file `samples/seccomp/user-trap.o' is incompatible with i386 output > > /usr/bin/ld: samples/seccomp/user-trap.o: file class ELFCLASS64 incompatible with ELFCLASS32 > > /usr/bin/ld: final link failed: File in wrong format > > collect2: error: ld returned 1 exit status > > scripts/Makefile.host:99: recipe for target 'samples/seccomp/user-trap' failed > > make[2]: *** [samples/seccomp/user-trap] Error 1 > > > > Is this a known regression? > > That looks like something is busted in the samples Makefile? Tycho, > are you able to reproduce this? Given that the samples build only happens when CROSS_COMPILE is not set, I'll see about digging up a 32-bit box. But I think the patch below should fix it, I'll send it out when I actually get it tested. Sorry for the breakage! Tycho From b53b390ab554ef6e5b995ac050718fd62ed0803e Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Mon, 7 Jan 2019 14:46:34 -0700 Subject: [PATCH] samples/seccomp: fix 32-bit build Both the .o and the actual executable need to be built with -m32 in order to link correctly. Signed-off-by: Tycho Andersen Reported-by: Ingo Molnar --- samples/seccomp/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile index 4920903c8009..a5607668a5c7 100644 --- a/samples/seccomp/Makefile +++ b/samples/seccomp/Makefile @@ -37,6 +37,7 @@ HOSTCFLAGS_bpf-fancy.o += $(MFLAG) HOSTLDLIBS_bpf-direct += $(MFLAG) HOSTLDLIBS_bpf-fancy += $(MFLAG) HOSTLDLIBS_dropper += $(MFLAG) +HOSTLDLIBS_user-trap.o += $(MFLAG) HOSTLDLIBS_user-trap += $(MFLAG) endif always := $(hostprogs-m) -- 2.19.1