Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4148470pxk; Tue, 8 Sep 2020 11:54:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfjqQVgK0a6wt6hAFp4IRebYIOQ6/HNc07T6BacXZpyvhW/wvMoD38XTwA4IgMJU+IBG5I X-Received: by 2002:a50:8d4b:: with SMTP id t11mr404628edt.5.1599591272645; Tue, 08 Sep 2020 11:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599591272; cv=none; d=google.com; s=arc-20160816; b=PReXnyuQerxz2IU84GA996ogXfJHLPdtXF+xZnQ+yHxAshjI5t6pBEgmXtsUnV82kW Vf3VHJE6P1/1y2/676HoqiN6oBme6VPsL680Tga1YsejYauROjrzU1EsCxjW0Wu8NnD4 4olOF5M4T2rfOa0Qz9rEChp3ENxeeQFoLSFZl9dBFyBvEcaHG0L6Bt9P8NXNZXEqbjdu tu5y7f/cZ7heq61UaGb5r1u/zXls6SqHK5H22oFr/y/J6v04xhihcx4TyQXiabPOAt3l tiMZoJHQy4DfCe6ImyVVnKYXujKwPynBuhLlXGLPxNmqGYYYHaZ1DBdHt0+dGd8UhqC+ GEVA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HikxOknzrc1XVTFwFB+7qtr+uDYCyFNi+S2PjioEX08=; b=jr4UPrLBSNhIs3PBJrkjiUkQrXl1CPfx4OLKASdHLB/yEftSLeBgfhToX5bm2Vqjvl JtF+xU8IxiCSxQIajQOMtsA4ty2xlNAmlCfcvqrrBcYziVbKArrAMf14sNsJRhYMlQZR pKpSFk4vbittePA74oGq3vDHTS5anUQtMAm/gRCVcTLxB8FxM+3ynNNJ27gMPUFZGQaA w48ziAuS9kebNhUV6lXpXzO7Wb7+YtAqnGGkezXU+1fmvcXaJM2rMR8so97JpGdG05VC Zz1ESPrSVIucgYo17HNhZEJNLi/0rUkdw8cUXWndBIGIbKvbf7uwZadRfuAxNmmCj/Hu lVoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AaOjm4P5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id s23si12062623ejd.95.2020.09.08.11.54.09; Tue, 08 Sep 2020 11:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AaOjm4P5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731373AbgIHSnc (ORCPT + 99 others); Tue, 8 Sep 2020 14:43:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbgIHSm0 (ORCPT ); Tue, 8 Sep 2020 14:42:26 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10271C061755 for ; Tue, 8 Sep 2020 11:42:26 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id w186so170021pgb.8 for ; Tue, 08 Sep 2020 11:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HikxOknzrc1XVTFwFB+7qtr+uDYCyFNi+S2PjioEX08=; b=AaOjm4P5hKS1xhOSqH9yvXniWJjm9ZqhdSjJpI4Iv9dya5zqq3koHZQ+HH1qafFsEy EQT0HLLyCHqNgh877jz5ApbjUHFUZ0c4EDB56EIB1NZVK5BjQQaBF4vvKCmcu1NfK25d DjvQcaffCJuZQ5Epc3wgEpqoZ6Wx6dzLsCU8o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HikxOknzrc1XVTFwFB+7qtr+uDYCyFNi+S2PjioEX08=; b=O5aQddR94PjuuSstMnUkgoxYVadRVf3aiXN3k1pINA+qCg4AyB1cckchIkGbdbuIRl JAQV/v4mFjTjPiy6or3bIHy7Qipf/+iEX2w7MHfsXmVeTRvFGjQgo0a/05HFbyN91B9+ iJitwqvpqx7imSh4Hldz7n9gzQz1Lb9wAiUi6jSI67SgNpwfEKxeQTd+dZiTuavRIMa0 nrgXf9S8qXKqmk9YHFVdfSvaA5FGPMgtdOlWh7S55CWYi4joY6ZoYys9uAlOweO1CU94 G1UYjzdlf0n7QoPly/+N0fCp4YgwOcRMoz3luU1A191a4cWXeD0lffjUSxcwvJZ7Dy8N Umpg== X-Gm-Message-State: AOAM533vNC7GA8mTiE3vP/harZljhnO2c5pDDp47cI0I6em1QpgTNXzv wLHImgq5rtbfKZ0e2cTRCMORnjHkw36pvQ== X-Received: by 2002:a62:b608:: with SMTP id j8mr132926pff.126.1599590545650; Tue, 08 Sep 2020 11:42:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q71sm37722pja.9.2020.09.08.11.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:42:24 -0700 (PDT) From: Kees Cook To: Tycho Andersen Cc: Kees Cook , linux-kernel@vger.kernel.org, Christian Brauner , Christian Brauner Subject: Re: [PATCH] seccomp: don't leave dangling ->notif if file allocation fails Date: Tue, 8 Sep 2020 11:41:54 -0700 Message-Id: <159959050861.1264035.3217861807726166263.b4-ty@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200902140953.1201956-1-tycho@tycho.pizza> References: <20200902140953.1201956-1-tycho@tycho.pizza> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Sep 2020 08:09:53 -0600, Tycho Andersen wrote: > Christian and Kees both pointed out that this is a bit sloppy to open-code > both places, and Christian points out that we leave a dangling pointer to > ->notif if file allocation fails. Since we check ->notif for null in order > to determine if it's ok to install a filter, this means people won't be > able to install a filter if the file allocation fails for some reason, even > if they subsequently should be able to. > > [...] Applied, thanks! [1/1] seccomp: don't leave dangling ->notif if file allocation fails https://git.kernel.org/kees/c/e839317900e9 as featured on my Twitch stream! ;) -- Kees Cook