Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14501900ybl; Mon, 30 Dec 2019 11:16:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwfAq202jG2T11WLWPtryT/fszV+j87eSKu79uoGUsMVAJrBZLKvJtYMHTynwpO3GvsTjCE X-Received: by 2002:a9d:6f07:: with SMTP id n7mr73511773otq.112.1577733376874; Mon, 30 Dec 2019 11:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577733376; cv=none; d=google.com; s=arc-20160816; b=G7z9nEh3bk4z0HVemrNriyuxdAfyF+BF+hsnNUNZlZXrQXtwCCO+wRtvxT/zuZ6vgM 1HTi5wFShGDDYiiJjnc+Rh5oE6Ajo4JEnoYCRjwbwX4YJppkxa0UQty9RijLWIQ/kVH7 pXJyvo1EA2g0nDHlr6D5qfChR0aSeo1VmVmm6pa5WdNIFVYcqmPuTAd0sMEeSuaEJ+AS F3gMgJtNKRfpKDjoyYm8BvxAJsy5JdB7Aoy/osNYwqbGvq5DwVhd+8+Lpt16dCAySzkl GTaIDAGcPhSsSd5BvInG/Y+bz9jXmsGIUc5Ca9YquxpRVIKv9wfmucwm/Z+M29lGzZtB Nyzg== 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=ZmjrGhb+wuiGVK6bOKXUfEcUa7KlDxwgv8e6fd+fEtI=; b=0gjuvH9rWoMYKlrTUypm2g9jKBA5ZJ6hfvKg3wWeNjoZZUOCB93mROYwH5HjCoNh0E +65JGwSKPpwdrOW6llduSv2ja5lTrxErF6oCbFqY1eUsiTa7zn+PGHji0L/dBVNAkrtB mAQ0irTwltQgpxFn5mAdMQ2SdEWffDJ6ccTuOEHs26viEDpNlW2zB+Bl8MsqEf86i1IS 3gFqutm5ClbryfnMmiWtF9DLV6129WRt+4m0Lw8H3vzHz0wVatCuXklYM8KkhQR8TF8r T3oqjz6/xhxAPKLIkseOuuMxYiXZd/0bM9+vbUmkSGiBrF/g+qSf+Lv35XYUF1vKQryG O8gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b=R5b9Hstp; 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 t82si20089830oif.45.2019.12.30.11.16.04; Mon, 30 Dec 2019 11:16:16 -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=@sargun.me header.s=google header.b=R5b9Hstp; 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 S1727668AbfL3TPW (ORCPT + 99 others); Mon, 30 Dec 2019 14:15:22 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41318 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727612AbfL3TPV (ORCPT ); Mon, 30 Dec 2019 14:15:21 -0500 Received: by mail-ed1-f68.google.com with SMTP id c26so33584043eds.8 for ; Mon, 30 Dec 2019 11:15:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZmjrGhb+wuiGVK6bOKXUfEcUa7KlDxwgv8e6fd+fEtI=; b=R5b9HstpwDK6KvfnJLkNr4KxEgBvgJWFezGyxEVM1/JaRLCRptf9hokCACxVV4ucqZ Ge8nllcRFLd7LuS6s0ynOAgl0UWk5ZAGfrHhuvsO+9b4OqRUCyjiS93S9byKtkCKq1Gm mG3jN1qMfq8sEykrTJq7CjMphgXQbvV7o78Is= 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=ZmjrGhb+wuiGVK6bOKXUfEcUa7KlDxwgv8e6fd+fEtI=; b=tO9Ueje1FvtHM7mShFaC4ohkEZaSKBXaNnOMoQmRMdKKCGgrcyW0+89e5tVoD77OT9 gyrW2c1H6iKxAl4GF5O4QIWOg1bvtzceKJMQuiaDyukkhWqoryhBAs3sYIP7Hb1yoK+G +a8wg7utkuw0P+5qLNxsrPn1LlAMK7qnhmsR73SQGTdUBH+2jjCSKqe3pYSBEUkQlRxj x5pIYMiLnVUKN/1As0EpKo8XLS1s6Sk6Q9q/E+qCaT4y/p2Pcdk3O6Q3zx4g89yIubvP 21U1j9x2BSx6+Ha/khrfKjnYD76iPFvMA6mzboF/UOzTFbX9PFjKSIbz1O9JZzVpglWP diww== X-Gm-Message-State: APjAAAWtE+9pnhTsFw/kWx9HCguo0rZ4Eh54T5rYUjdwQ/JCY+B6d6np AwG6YhnD4T6WJHDIx9dxgMHay//b+O3uLWYq+bqt0w== X-Received: by 2002:a05:6402:c9c:: with SMTP id cm28mr72516280edb.88.1577733319891; Mon, 30 Dec 2019 11:15:19 -0800 (PST) MIME-Version: 1.0 References: <20191228014837.GA31774@ircssh-2.c.rugged-nimbus-611.internal> <20191228181825.GB6746@cisco> <20191229001818.GC6746@cisco> In-Reply-To: <20191229001818.GC6746@cisco> From: Sargun Dhillon Date: Mon, 30 Dec 2019 11:14:44 -0800 Message-ID: Subject: Re: [PATCH v2 1/2] samples, selftests/seccomp: Zero out seccomp_notif To: Tycho Andersen Cc: LKML , Linux API , Jann Horn , Christian Brauner , Kees Cook , Aleksa Sarai 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 Sat, Dec 28, 2019 at 4:18 PM Tycho Andersen wrote: > > On Sat, Dec 28, 2019 at 07:10:29PM -0500, Sargun Dhillon wrote: > > On Sat, Dec 28, 2019 at 1:18 PM Tycho Andersen wrote: > > > > > > > > > I know it's unrelated, but it's probably worth sending a patch to fix > > > this to be sizes.seccomp_notif_resp instead of sizeof(*resp), since if > > > the kernel is older this will over-zero things. I can do that, or you > > > can add the patch to this series, just let me know which. > > > > I was thinking about this, and initially, I chose to make the smaller > > change. I think it might make more sense to combine the patch, > > given that the memset behaviour is "incorrect" if we do it based on > > sizeof(*req), or sizeof(*resp). > > > > I'll go ahead and respin this patch with the change to call memset > > based on sizes. > > I think it would be good to keep it as a separate patch, since it's an > unrelated bug fix. That way if we have to revert these because of some > breakage, we won't lose the fix. > > Cheers, > > Tycho As I was doing this, I noticed that the self-tests all use hard-coded struct sizes. When I was playing with extending the API, all of a sudden all the self-tests started failing (until I recompiled them against newer headers). Should we also change the self-tests to operate against the seccomp sizes API, or was it intentional for the self-tests hard-coded the struct definitions, and locked to the kernel version?