Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp11689568ybl; Fri, 27 Dec 2019 19:55:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyW6dhRjx49Q3O13cvWbTQpT4onb8hdnaK4YKJX7b3jpj1/lC2yvGDH9bUh75J+XMXmoEPH X-Received: by 2002:a9d:6d8f:: with SMTP id x15mr52277207otp.322.1577505323528; Fri, 27 Dec 2019 19:55:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577505323; cv=none; d=google.com; s=arc-20160816; b=XrmCKMbssvHEdnbzWcp0h+/DSqxxHoZe/D0LW1S4TZbvHF2iWAo1A3ZhHvffp+davY mHLjMw00O3Y0FQerGMCAyqtx0l1kBRAQxDhRT2Ygzf5NFzORX9ZUkvbnLjVNxTjbval4 ulYsRyoArSKKQ7L+rdae/dtZGA41KSKCiFs8r23bt4vHnPRUCpz6UxI06a8aSQgojtGZ MyRRYP1NQPUGmBmiqmo2ZheXGSE8muT1jBlK/lpaLr8k0NzT0wZL/R39rtQvfGLD6Bj4 yFfJuFfY9jT4ScwuBzbIuuzr8XJ4bE8L8Fa3KmqVj162l7ynwvJDMzJSdzTxSBtxWEj/ i8pg== 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=fW4oSj2ujLoinwXahbBj146hJbvQqiumz2p1q9AEvF8=; b=BoBcXEXSmIHH6OADiF62NfGFUB54mgtlXsFwHBvGmIFpy98PbOSQJk4dveH5wVo64s T4Amw3BmPjDSGFdvtm0AIkvJHozqF0B7hZpy7rSgrVP0qfBW1rP0fW0QRaB+cbZ2ICHC Pv/Gv7QjQDTiySe8YKf7moI8s58gmIODYOxfMM9QwEeHCDHU1OxFW2+YkrChgS9xfwid XVYW631yyUj+T2tN80YXOQVY7wX7w6dVDlsvSU3eRtC+hb+YYYaHNpR9lBTqHG+SS5/m P512eWcWcuVwcmUltg+HGUS6C3iE4YW1eorRkUKztNPr5wQdzpcSBQh8UtBRfXgwWnvB nIqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=mVYrxfdc; 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 e22si13652521otj.38.2019.12.27.19.55.01; Fri, 27 Dec 2019 19:55:23 -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=mVYrxfdc; 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 S1726234AbfL1Dt0 (ORCPT + 99 others); Fri, 27 Dec 2019 22:49:26 -0500 Received: from mail-il1-f195.google.com ([209.85.166.195]:46099 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbfL1DtZ (ORCPT ); Fri, 27 Dec 2019 22:49:25 -0500 Received: by mail-il1-f195.google.com with SMTP id t17so23727616ilm.13 for ; Fri, 27 Dec 2019 19:49:25 -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=fW4oSj2ujLoinwXahbBj146hJbvQqiumz2p1q9AEvF8=; b=mVYrxfdc0XAsVAFSGNI6GvI3HPDntzPtAlQuuhh9YSh3zsttcIpdX6ooe9UlKCINN8 AEoIFpNDQV84RWnPnUpPbSAvp8ZCumCj4pSsOkDbGMcrUCV4y2Vw/gPl5NKJw5Rqdb/b 3oAKiXd3Fv07EbDXpZEOAqFGewQpY4YlPsV5O0fDATY9kdrTpkZGsaqFEn0+79hZlKF+ q2+9BmF5MEqQLeaCbXIWlBTGVGixnH74iDFoBhKpQh4mA1GaocFvM+QoMzqXbmN4FnZC jyWA2UsSqlvFRaQ9ALjvT6R92RMl9kbIEPgPIWjjvOyGX1miDAubAyOztZsFGjfyTW+N 84nQ== 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=fW4oSj2ujLoinwXahbBj146hJbvQqiumz2p1q9AEvF8=; b=ka49rdWH6jPgEIfnh9J1qdf8snX3bTdg2yypQv9jeFI0CIKVYHGISt179Om4m7ew5W wP29fB4CG+/i3CZw1XkdeUzUJZncTiBhnoTDDHT+tCAkpTKhbbO5vrWexQ0TF+YyfEbA 3dviu+rCHhQKERGgKJxp2aAyj7uuFPqPZ9q+Yxo9sbRcLupVeA56UrzmeMTgdHinPW94 nMIXiwSJFRJYgRAsXx9P/j1l49xVzQzdJacRnJa98sQOyb+2+M1Wx4zT5MSz7lqwdU22 fW8TLU4hQbD2zS0c2aFFTT/9jM4ptC1wgRrE1Z7wpYhHP1c1ZcSvhA4kfJyOcYxGTlns Co1g== X-Gm-Message-State: APjAAAWgbUhfuH5Lq79PxNeEmrMXmZLICvVS1soT4OriVdbIEKF9zX3a Iw9ZdJFHv/OJtwtdW+MbEONtKg== X-Received: by 2002:a92:88d0:: with SMTP id m77mr50028181ilh.9.1577504965068; Fri, 27 Dec 2019 19:49:25 -0800 (PST) Received: from cisco ([2601:282:902:b340:f166:b50c:bba2:408]) by smtp.gmail.com with ESMTPSA id q22sm9864425iot.39.2019.12.27.19.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2019 19:49:24 -0800 (PST) Date: Fri, 27 Dec 2019 20:49:21 -0700 From: Tycho Andersen To: Sargun Dhillon Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, jannh@google.com, christian.brauner@ubuntu.com, keescook@chromium.org, cyphar@cyphar.com Subject: Re: [PATCH v2 2/2] seccomp: Check that seccomp_notif is zeroed out by the user Message-ID: <20191228034921.GG15663@cisco> References: <20191228014849.GA31783@ircssh-2.c.rugged-nimbus-611.internal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191228014849.GA31783@ircssh-2.c.rugged-nimbus-611.internal> 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 On Sat, Dec 28, 2019 at 01:48:51AM +0000, Sargun Dhillon wrote: > This patch is a small change in enforcement of the uapi for > SECCOMP_IOCTL_NOTIF_RECV ioctl. Specifically, the datastructure which > is passed (seccomp_notif) must be zeroed out. Previously any of its > members could be set to nonsense values, and we would ignore it. > > This ensures all fields are set to their zero value. > > This relies on the seccomp_notif datastructure to not have > any unnamed padding, as it is valid to initialize the datastructure > as: > > struct seccomp_notif notif = {}; > > This only initializes named members to their 0-value [1]. > > [1]: https://lore.kernel.org/lkml/20191227023131.klnobtlfgeqcmvbb@yavin.dot.cyphar.com/ > > Signed-off-by: Sargun Dhillon Acked-by: Tycho Andersen