Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp900312ybh; Wed, 11 Mar 2020 13:08:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvWV8c19i1g3pVxksnlsFe8kguEsjgZNinQxh70xjlrA/S55uaRcMIZDTSKAjBxmU9SkmgP X-Received: by 2002:a4a:a8c6:: with SMTP id r6mr1479245oom.21.1583957320107; Wed, 11 Mar 2020 13:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583957320; cv=none; d=google.com; s=arc-20160816; b=GzUq6GOWRvPVzN/bYgi9zg4OKdnSIqXiO4vyeT8OCwo2TDSzGr1Zwb/hNLJDWSkZt7 bRYy5NasJ5RJcjVy0vjt1sYWo8OxLHF51TvJXqfJ3ygJUpwVm6kspzA1yN+Dh7DTXETf SzkkXrC5hcA6E8RmtQMv4smU0F29Ih1pHjopi7weLe/0Gm17pxBBUqImlQNvGkbi6/N1 sUvUgJCpGjl6gsn/DaQCbE78sessHRe5F8dUJ96uMYOQsTLQpKTS26CMSv5Gpn2xzqGZ L6wi6LyaxzrwBWF3HKoXxWgWovkiVFOd6IW86KQPA0xEIe1vRFzWdUskkDJcy0DWmFKw qoHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=++5B0kFRrjAGwY1Pe388z5375HPFD4iEhCYSO75vU9k=; b=CeJFmvPMqWNJPqp8F73V32kqq2E/7cy3pLsttpNFx6TXQlBcxkyD3vIwvbryv5exHQ R/EXw6Yh25l9RLxfu11atkK2KmXxBk36TTr1jTOompNyjbZO0Y8W6k9mBeB4Kxbpouxu pxQTZD6VeyhuejATumsVC5hSUY4n2S13s1hXQs/apnI2QMpiBUzVkfaCXj9b7OYfDNTZ Gjiy3GHlptyXkoOCQNRPL0zxTvUgc2DhZRGLKGmsi5ePt0QprVl8J4OfpXWf7XhA3lIT h2lO9ZgwXpqE/Og2dR/mIwkRHxvyEZfLLvG0e6ZiVO1/omyjOCgDV3gZ1WGEpOKsr5aW twKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d7K69vo1; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q137si1640395oic.139.2020.03.11.13.08.22; Wed, 11 Mar 2020 13:08:40 -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=@chromium.org header.s=google header.b=d7K69vo1; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387459AbgCKUGh (ORCPT + 99 others); Wed, 11 Mar 2020 16:06:37 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40391 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387449AbgCKUGg (ORCPT ); Wed, 11 Mar 2020 16:06:36 -0400 Received: by mail-pl1-f195.google.com with SMTP id h11so1586876plk.7 for ; Wed, 11 Mar 2020 13:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=++5B0kFRrjAGwY1Pe388z5375HPFD4iEhCYSO75vU9k=; b=d7K69vo1bhwMw4HUPNraxkxEDAvA63FgjV5gB6GbslC680eWufo5K6jlOXYSNUy5w/ E9tlsJ0ehHvi6PE7Niu4XjXz9RFah90G7btm8mbFIiRNJD7x8jHwKTo2zT5whrDZ0X5T dELIHgYrIolfYS/CXnML26PUrUSP+338rgp6k= 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; bh=++5B0kFRrjAGwY1Pe388z5375HPFD4iEhCYSO75vU9k=; b=DsOd3W8Us/x4Cqu/Jbzmjg5rlCL7wMBu6dSaiuukH4mw7ae0WeIysII6frjvo5HP2v ZORKsbDETkPyXbmRBdMRuPq9o0ywZaSTYCj28wf2DnFJQDYsavkx+e9iHeayDS+Uxa3Z LW/La5+3G9hYGCo0ZAFsb0iLwNb7OUY78ip3J9agX3+KVkF9NJ3cdJu4GCuWrK5pxm62 06qaPaHCKp3MSQ+hqdu+mp4zOXq1zzDCLe2t31mGFgTFmK2t0meGDEjakuNUCHKKI1jD BWHkoIXc9Z9zjOz4BWA86sUcmbWj6/GmvAyifoLEM/7D7mPsHLzfBSPAbzMmRi9V0jG4 3WzA== X-Gm-Message-State: ANhLgQ0wepAVTYWC5bFfFCKdRYLFdaoT4FhBgPWdWzT00USzBQjVwwa7 NAJw486EbEGM+zQm4M83GjYQYA== X-Received: by 2002:a17:902:7618:: with SMTP id k24mr4601393pll.320.1583957195759; Wed, 11 Mar 2020 13:06:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m12sm6440567pjf.25.2020.03.11.13.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 13:06:34 -0700 (PDT) Date: Wed, 11 Mar 2020 13:06:33 -0700 From: Kees Cook To: Sven Schnelle Cc: Andy Lutomirski , Will Drewry , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH] seccomp: add compat_ioctl for seccomp notify Message-ID: <202003111305.87B2A84A@keescook> References: <20200310123332.42255-1-svens@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200310123332.42255-1-svens@linux.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 01:33:32PM +0100, Sven Schnelle wrote: > Hi, > > executing the seccomp_bpf testsuite with 32 bit userland (both s390 and x86) > doesn't work because there's no compat_ioctl handler defined. Is that something > that is supposed to work? Disclaimer: I don't know enough about seccomp to judge > whether there would be some adjustments required in the compat ioctl handler. > Just setting it to seccomp_notify_ioctl() makes the testsuite pass, but i'm not > sure whether that's correct. > > Signed-off-by: Sven Schnelle Whoops! Yes, running a mixed environment (64-bit kernel and 32-bit userspace) shows this as broken. I'll tweak the commit log a bit and apply it. Thanks! -Kees > --- > kernel/seccomp.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/seccomp.c b/kernel/seccomp.c > index b6ea3dcb57bf..683c81e4861e 100644 > --- a/kernel/seccomp.c > +++ b/kernel/seccomp.c > @@ -1221,6 +1221,7 @@ static const struct file_operations seccomp_notify_ops = { > .poll = seccomp_notify_poll, > .release = seccomp_notify_release, > .unlocked_ioctl = seccomp_notify_ioctl, > + .compat_ioctl = seccomp_notify_ioctl, > }; > > static struct file *init_listener(struct seccomp_filter *filter) > -- > 2.17.1 > -- Kees Cook