From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 631C51332A5 for ; Mon, 15 Apr 2024 18:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713204006; cv=none; b=PKSxxOv1t5mJqXu0cLEYT/mqHnf823DuJjSnsAVyY0xWzdNalH/EMRiQnAXE/257T/f948ToFyY6ApJbiHVZPjatFXxovE32DibzFK+nDCVwFNStM4+IisiMgxilfv9rkfWXX7hQDcVxq8ORDSGTeNS9QpT3i7ch+3uT+KgCG/o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713204006; c=relaxed/simple; bh=A98/eAhGTQCK6s+GGBglhtfnS64Hw4WPBO/AZQdkm/Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KMNUJzyANhkF0vOpOEt/r+P/KmUZ0cftMM3eEtWRseCuELXjSu/kGGXXfR0/iPGlZ+ff7nmQ+WVu6NzG59ac2qJAtGEFq6cbtp/R1p/ge2ZyytZzOR5qbPLXSHDBLOE7E34aTeLBPrQrGdHJ8cQjd4NgaZkWvEgDu1Sr2c80sKA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Y8UOKUgH; arc=none smtp.client-ip=140.211.166.133 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Y8UOKUgH" Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E3EBA40461 for ; Mon, 15 Apr 2024 18:00:04 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.101 X-Spam-Level: Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WPJLIEnj_sTT for ; Mon, 15 Apr 2024 18:00:04 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::430; helo=mail-pf1-x430.google.com; envelope-from=keescook@chromium.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org C455D40199 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=chromium.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C455D40199 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Y8UOKUgH Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by smtp2.osuosl.org (Postfix) with ESMTPS id C455D40199 for ; Mon, 15 Apr 2024 18:00:03 +0000 (UTC) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6ed627829e6so3872049b3a.1 for ; Mon, 15 Apr 2024 11:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713204003; x=1713808803; darn=lists.linuxfoundation.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=MrTvR9L0VIfigSdISGbBtTJhGjxVLOhMdckQkQYBV80=; b=Y8UOKUgHbnqLhYhFOsEsegmKLmbO2I4BKu6yjaHyZYNS2eW9KsbvWIhtY9ZU1v7E3+ JfDjgNEf1m1+Wv8201aD9f9n8xXBcMCWAg66aWtNJd50W9bA2GjuzA9Ab/LPwzaIt6bb iATDW3oNuQKBgtFk52sq1HhyXlyGKm+5Puy+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713204003; x=1713808803; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MrTvR9L0VIfigSdISGbBtTJhGjxVLOhMdckQkQYBV80=; b=PFBL+DB/mASuhjDjQBpmYjNSlSRieElBmUHoOYgb2cHaNSQeSe/XcFhHpqK5t6OKv2 +JI0HxaHZeeaUdF4VfdlFJw1eGL6nJmWE1qiNW3+qs0WXxNhpQHon7E6cFIaJZdml4MD OgMFoMdnRFmISwpY34GVsZx87ih87+CNqVNP9tc0/vrbNyu+ucsodcNWDwyN81uH/y8u ki4hH+q3rsqkC9FvWYQ0UDGakublucsijLY2wu3bVW1GyQeoPdQL29gjZ+CCGKapCnMs +p4vLCIFROVwWM2/sOPxC/8Q63wSqSyiPxe+EapFFTt0LBUXM66KbAtDSqxcZslyY33z JJ8Q== X-Forwarded-Encrypted: i=1; AJvYcCUZYqU1vIrDVmD/vPryMPllISDrEU2pc2403MlFTNp1c+5FKMi6ZBfbqVDiEbVqVRPnVoSzmvX1hRO65q8f2ve6gfPlubcZWM3MQ6SxBd4rmxMVTE/pOpX6n43x+A== X-Gm-Message-State: AOJu0YwrSJqHDQvwJdA8qPiIrl+WQtjs5LlIAi9vFrcV3PPtIPJihrlA lYwDXvnjlca29nJH9iLlbhgrI2Cbq/qkaHpvsR5dsgqSp/XDUALnrupADanynw== X-Google-Smtp-Source: AGHT+IHXrJtqxg+WwkrcnWg9hLXFWjWELDvjvIFSzwF0X7TPT77TaK/uV3BBero7ulpv+q0JyIP0fQ== X-Received: by 2002:a05:6a00:9382:b0:6ed:def7:6ae2 with SMTP id ka2-20020a056a00938200b006eddef76ae2mr12548156pfb.6.1713204002994; Mon, 15 Apr 2024 11:00:02 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id gx21-20020a056a001e1500b006e72c8ece23sm7533451pfb.191.2024.04.15.11.00.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:00:02 -0700 (PDT) Date: Mon, 15 Apr 2024 11:00:02 -0700 From: Kees Cook To: James Bottomley Cc: Vegard Nossum , "H. Peter Anvin" , "tech-board-discuss@lists.linuxfoundation.org" , Michael Ellerman , Theodore Ts'o Subject: Re: xz meltdown/Lasse Collin Message-ID: <202404151051.90B786EE85@keescook> References: <8205E91D-F15B-402D-9398-33E4FF4E4E62@zytor.com> <030a96cf36719d8a7ec702b9303616f89daed4bb.camel@HansenPartnership.com> <872f9cfd-5c19-4a82-bf75-6256265e8f8a@oracle.com> Precedence: bulk X-Mailing-List: tech-board-discuss@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sun, Apr 14, 2024 at 10:45:30AM -0400, James Bottomley wrote: > On Sun, 2024-04-14 at 12:21 +0200, Vegard Nossum wrote: > > On 13/04/2024 15:16, James Bottomley wrote: > > >     2. We need better build artifact transparency generally but  I > > > think > > >        the kernel is fine here: we still use make so don't have the > > > huge > > >        build artifact issue that allowed the exploit in and we have > > > a > > >        documented signing process for our build artifacts (kernel > > >        tarballs). > > >     3. The indirect library dependency problem doesn't apply to us. > > > > While this is technically true, there are many other ways to > > compromise the kernel build process: > > #define injection and environmental injection have to be done on the > build system (I mean so did the xz payload injection but it found a > carrier in the autoconf files). We're getting better at hermetic > builds and other things that make direct build system tampering more > difficult to pull off. Hopefully, one day soon, we'll get to > reproduceable builds that someone outside the distro will be able to > check every distro binary ... and that would pick up almost any type of > build system injection attack. The kernel has worked fine for years with regard to reproducible builds[1]. I regularly inter-build binary comparisons[2]. The main thing needed is keeping these build variables fixed, e.g.: KBUILD_BUILD_TIMESTAMP=1980-01-01 KBUILD_BUILD_USER=user KBUILD_BUILD_HOST=host KBUILD_BUILD_VERSION=1 All this said, such things would catch a malicious build host, but not malicious build dependencies. For example, the groundwork was already being laid[3] by "Jai Tan" to inject a build-time attack: +eval "$($XZ --robot --version)" || exit Any tool installed on the distro that the kernel depends on could manipulate the build environment. We could certainly enforce better sanity checks (i.e. sh-lint all the shell scripts), but defending against obfuscated backdoors has always been tricky. -Kees [1] https://docs.kernel.org/kbuild/reproducible-builds.html [2] https://outflux.net/blog/archives/2022/06/24/finding-binary-differences/ [3] https://lore.kernel.org/lkml/20240320183846.19475-12-lasse.collin@tukaani.org/ -- Kees Cook