From patchwork Thu Feb 22 22:00:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 205081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp233468dyb; Thu, 22 Feb 2024 14:02:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWFUfH0MwWhH9gigLLropsQnOdo1q87ysP1BoRORPdt5Rh0qu5gdS72dMbUuAErogqR65w4aYxPwsXlhUt88ykrJ3hr/g== X-Google-Smtp-Source: AGHT+IFymR29EqLfF4D7CUI7xUs3YTGxrvma46SgJeP5MVRXpJUOO0VlRZmdHivbDa+gsFJtVEA4 X-Received: by 2002:a05:6a00:2d04:b0:6e4:68fa:7e10 with SMTP id fa4-20020a056a002d0400b006e468fa7e10mr196501pfb.9.1708639335379; Thu, 22 Feb 2024 14:02:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708639335; cv=pass; d=google.com; s=arc-20160816; b=Ovl8rPJ1CD+IPbIvYb+7EWHyXyuW5gb+BrWmCqJV9LcmCPjCmR/x0lZNSbpWdkttD6 yRzM4t8scmqH43RqWaMcpVtaImb92d4o29RjEt0sA41wIrP5zixb2fHhCMH60sxgSNOZ w69p9hnI1ArJ49qyOpWpGrZG0KrYSdQ4I4NnA8b8zRFLZRf93iZIF8L02Z8cC2bVTZdf reaS+Ak5A2yk3Vd6aOmAt3lkt39pT4cfBtIsb1yFRw+JJTILFnJTS4hXTZibhlqYsyZD orkWbh9ELN1jVFU2aFVQpSAc+JvYO7giOc5EOLWPkoGAb6zgurD8BHkiwdWY0d206Buc 4N2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=l7U2tjc40/BAOXSRwNIhZS6QrofSS9z/mAZ0ltWiA80=; fh=YLAgbO7YUGN+DmcQQgdmDpMlIIkN1+F005PyMEL/+aQ=; b=erPZ6wlqow+ABvNqndW//lGmGQYTF1J2eI+gKyTG4gIGCU1b0J+gpupP2H7P3/HuPS KGYP6ELoq6N89PEnvKVoU7cHD7WOhYGVRnVk5VM9W6sxT0+EQ1yY52H0VaSVz56CPp9t LblWh1L/qpIfu4Rw0a5emr8S2ZODoz7LLuyXuDaa4r0/eiHWNxQpfx8ZxNPtt8jWbo+T qEDwDPRRxBdaR7Frgf2BvHcAUUfbY0wxp8Wi2GK5RpM7uG9qGVGkbuQcKlJCDagm3z8S Z327pMVgPyrHmd2dpVEH5V/PRYWdgvp48snMcXPrWshtsASvDc0d3meVCBYd2RVCiUC5 ns0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XQlrXfAN; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77433-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e25-20020a656799000000b005d6c2958481si10865776pgr.639.2024.02.22.14.02.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:02:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XQlrXfAN; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77433-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 280F6289A2B for ; Thu, 22 Feb 2024 22:01:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32732137933; Thu, 22 Feb 2024 22:01:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="XQlrXfAN" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A11CC12D211 for ; Thu, 22 Feb 2024 22:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639258; cv=none; b=JFhQDEbk+3djfDjgz1OE5YUsnKS7/pXWpcXOfkJQJoIauEcaIuhnhRAUpR6esvW7VgLcq3re1/kgV5OvBEMnJywsEKINHbUCYpxiFWT60u/hn8uQRRPS+vRZ8rTqZJZ1Jzla9fqIscuRsjUmKqiD3vNZPRMoRT8YdNmIzSnB+qQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639258; c=relaxed/simple; bh=/0jZgqFV3QHFwXdwQjyOlzwZPiSes7vDjViaGzmwhVo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bHbtuTniiE4v+Lxd7jKghpLdRM+AdpyRWU5XWGUuM9TXPzeocRWJy69KDoy+pUjCit3/covmT1aKhbvG77FvuJNGUB5PA/mqDoOPpPN6M9+pI8BeBY1Cu85xx5/X5+euJxAGvRIUQ1G9GfSs2e+H65KkOekAkzSQuXCNdOMLrfk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=XQlrXfAN; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1dbd32cff0bso2801675ad.0 for ; Thu, 22 Feb 2024 14:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708639255; x=1709244055; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l7U2tjc40/BAOXSRwNIhZS6QrofSS9z/mAZ0ltWiA80=; b=XQlrXfANKAFX/0R+ZH81Am2eORBegGANg5R5hlUcFpf02tdb51GlueMksGS7WQ/0au yZGLlxYczA/be0Ly0T0hiO/uRUzhaty0KEeXTwxwf820+EMccDPev4ZuDYBoFKiwOmS5 ntdwRZ8AxjsYoz2HpNdGzEkFseseMQ/ZpKuq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708639255; x=1709244055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l7U2tjc40/BAOXSRwNIhZS6QrofSS9z/mAZ0ltWiA80=; b=qV+O9DMJQ4bJ83vLWg5N6hFMUJcN+Z1XXOcsVkDXP9by5SHVuVc2cVjMMwX1k3PYZa cjaGccL7YTG6n0jgv7gbmtxmiVDLBfZejaHi01fKMiZgelDOPZK2MWNaoIX2eRtOf4hq Za+BJE1uMN6+m5WadY42tBwjyy5f94XtYP0OqWEHsI/PwUCmRxpOad0O3+K53dlkueYq OzvILYB0AX0tvYYcChJtOZmamHXIT8esN7JdaIKEm3iWXU7YxM7gtInkiOcJzhSVpA0r dJAHxFat6tcW1zaIOZSRgFzffq5O7iJL8Kmhs0TyEyuCrsN+U5QJFZXVmIKFAxuSE8Ue WP5Q== X-Forwarded-Encrypted: i=1; AJvYcCUIlqh/tLSeCaEuwblop9oM+HUAyKzvAPjy/2EqxFZaeK1ERGStqTHju+R3aR9A4wxQUpiJ/dN+E+62wFjcsacgmBf3tK7OsA/Lp5oO X-Gm-Message-State: AOJu0YyS/bTFRMHrsmnk4vmp+B6eA3swvnYrvjrNzjolqXWW2+F/6u+h TxBN/SC3ZYwO+bdGdE2+qa36nGl5N6/4n/wekeOTDG0S5Rl4dKRZf+02NuIrrw== X-Received: by 2002:a17:903:2291:b0:1db:fd4e:329f with SMTP id b17-20020a170903229100b001dbfd4e329fmr158789plh.15.1708639254752; Thu, 22 Feb 2024 14:00:54 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id c6-20020a170902c1c600b001d717e644e2sm10357386plc.247.2024.02.22.14.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:00:54 -0800 (PST) From: Kees Cook To: Tycho Andersen Cc: Kees Cook , "Tobin C . Harding" , Greg Kroah-Hartman , Guixiong Wei , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH v2 1/4] MAINTAINERS: Update LEAKING_ADDRESSES details Date: Thu, 22 Feb 2024 14:00:48 -0800 Message-Id: <20240222220053.1475824-1-keescook@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222215755.it.764-kees@kernel.org> References: <20240222215755.it.764-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=962; i=keescook@chromium.org; h=from:subject; bh=/0jZgqFV3QHFwXdwQjyOlzwZPiSes7vDjViaGzmwhVo=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBl18QSYDlmaz4o8wEpSBDere7LZ8YHox0i+LD6P fFT/CbFwrGJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZdfEEgAKCRCJcvTf3G3A Ju6MEACz0ztHen9/0jUIZ4S7P1C/KaEPNBQFSTxxU4ebUBIeSf9lR+aMLQgkRqYPHkNhKUwMyAe 0kfKRj+c2d3kl6WLlwolO6hDU8L2KJgSTIH9YUvw6C4dZm9qjGPBbP+nS+KNwjmZaP7mbr5olEz OeZlrWDukYeZGGfH0Z8HnfKZy90SSYZFpr/NN4278Hf23OnzxJcQhdIhzHkpOhyNzvB/NwSTf2w FeufXgd72gxmzIL9Ezf3sxn5HL0FbSNqrgoJ20bXnawW/jKSSZGQTCtOkm/raGNNycdBYLxG5eb 03FGXYdPXmw6KgOkEnilYPbjPRlKODOP5kSfmcHZycfRGD5sXzauQ1leB5cVRfzZINZdBMixOVz G2XO5A1+2WUxc3lP4vr/WynIHOpXwAww7lWeRQMQ7iBuxCLp3A1QDoOoR6j0bB1OHQw+VEUJ3fX QFXW5jWdlTX8hxYc/gs7munqdYDOguFquGU/Xn05okUzK4XheQ4CjO8LbMD8np9L54W7LPOEI45 o0EkGDwQwdazQn8HJPJ6rsGhnV/rY2TRIykGjLSA30uVhsEFRhXaF6vD5TDGBTMWZT57Cm7F2kl eH3d0gUmCcTu99DiFdfztZH1+hODUAEbwhtmk7EZsV/sKv8N+suvdM1C6vwnkLq6xAuJcclwBJ4 Sb5oeiSWhU8Z5sg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791638199726057069 X-GMAIL-MSGID: 1791638199726057069 Tobin hasn't been involved lately, and I can step up to be a reviewer with Tycho. I'll carry changes via the hardening tree. Signed-off-by: Kees Cook --- Cc: Tycho Andersen Cc: Tobin C. Harding --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 216d02a3fed5..cd651c4df019 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12154,11 +12154,11 @@ F: Documentation/scsi/53c700.rst F: drivers/scsi/53c700* LEAKING_ADDRESSES -M: Tobin C. Harding M: Tycho Andersen +R: Kees Cook L: linux-hardening@vger.kernel.org S: Maintained -T: git git://git.kernel.org/pub/scm/linux/kernel/git/tobin/leaks.git +T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening F: scripts/leaking_addresses.pl LED SUBSYSTEM From patchwork Thu Feb 22 22:00:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 205082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp233821dyb; Thu, 22 Feb 2024 14:02:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU12AjTJWTgp7VgCWs+wKUw1ssto9jO1A3KfKfVhqQdPRiHH419DYlP3qOUsWrrZuw5yZHm6gmVgwiXTt7EWTfcfWNARQ== X-Google-Smtp-Source: AGHT+IHylOy7u4UJoihflbn4KGIirsgqyIJyaPC6atRH7pIU9LYJGvqRDSUNllm9CwhNSOBvG727 X-Received: by 2002:a05:6358:9216:b0:178:950d:1175 with SMTP id d22-20020a056358921600b00178950d1175mr98164rwb.13.1708639368517; Thu, 22 Feb 2024 14:02:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708639368; cv=pass; d=google.com; s=arc-20160816; b=zQ7U+b3VVw8v/q/19p0qbEA8706lCy52PwEFmgR7DXtRJRDE26o+ArDCPLPqYk8XbG k3QNiihkDlpBKkqujM6K9LzEYkBYQhTxfDCHVDvWHtFYoJRrb0s/bF/xntsXSKxZ+zEv SPIdNLkFhIh2z6fkIPiF3K27fwXBHW0G1E/I1Iury+ZSe5qpoZb7VtgX92mc08hK75ZS rBGOfgF+1tw3aNAla5PrLTp5zVnP/CEKw6YF0RyyNe9qEyDA01ivrdb5bWSE68r/jPZH 58PV91vKq1hBWUn+kmoW4l4wrnzMVZK6m9aaoc8GRg3ejtzt6hQln+SG/RqwoBix6Gqt Bh0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XcbwdGDEaXBLUYjumpG+gsDxnRVJcIomd9ygoS90Aw8=; fh=6gEpidsuIYo84wolMjZLUPphjfsM7cnsdtPNRYhEd6o=; b=f+ngFzbZOdb88KlOpyIlcWAchAeB66hwUTgM3GmmTszE0fPcr2lbde8vACFnxUdwpM HZIeM2lMpP6XNfx79Cu/xAZuMKfPOx7uFRl8jD9lNl63+1uXcXIbetAaW1cXLWcDv35H gxbRlnBixDUaJszmh4qDNB+foGWNgPBeSg7pO8D2oV5Cc56fTnOR1Ptx1o+EVWNE97QC ipiT9h7mSWFByLOg1ZpuDYWNDXs9PJcE6WuNbsODoRpryNQ74SZ58wZpGpXSiEIbYYKw y0m+msIi9lBRFWDRnndDlH0RrpGuEGs2ZU1Jc6q3qggKd9iO+vU7E8L0Nu9QGdUJtQkh BZwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="JGOW/mVS"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77436-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77436-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s24-20020a63af58000000b005ce00003530si10988237pgo.562.2024.02.22.14.02.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:02:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77436-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="JGOW/mVS"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77436-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77436-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AAB69288F8A for ; Thu, 22 Feb 2024 22:02:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBC7B140365; Thu, 22 Feb 2024 22:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JGOW/mVS" Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5A8C12D21B for ; Thu, 22 Feb 2024 22:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639262; cv=none; b=ip0CaxKLh5MhLWZokrONxeOgFfS+g0njsTRByNKAaCgKl2eYjRBSon4WwhlvdR/gYZEFIDpDEWz6UBm6ei2HcXuf2hIYF+qUuuotVPAZinNOyBIva2RGwcT9zLr+937e4zZLZNqOsxEPlZ9EGPUrUsHa7QhA940Nd2ebkcmclhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639262; c=relaxed/simple; bh=uhlU0x25jSC/q8kWZ2CYfZhoRlBn6ETL7DGvp44hrLQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JjKysw0rMSFg9/wDMnc7au9Wg7G50NhaBxSlvDcer4/i+1n/rrjjz6HAT9Gjk46ylWK2aGDpRSL72vuI/F66N4pstQiF1GA9ggNz6zIYt2zmYekk5ZLdWd+ZMiBs30GMxm5LywRAD7BGZmm49NYsNcjfFnYhVJBdO1SoQs8Osec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=JGOW/mVS; arc=none smtp.client-ip=209.85.216.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-299b92948a6so218970a91.3 for ; Thu, 22 Feb 2024 14:00:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708639257; x=1709244057; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XcbwdGDEaXBLUYjumpG+gsDxnRVJcIomd9ygoS90Aw8=; b=JGOW/mVSDOwED/5uKl5hS/1fbO18yhoJZjlAl/nKaWC9D3onMozCO6z/nL9HZR5WwY aLqOFBzPw9h6r1FqiqIA4lUOHUhlSOHS8lzv896X5ZlQvTatqET6i1e2bGCRzeg5+8ZE RBuUdOeY8uj/x05g0cLgzKhozGJTZcLWtTObs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708639257; x=1709244057; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XcbwdGDEaXBLUYjumpG+gsDxnRVJcIomd9ygoS90Aw8=; b=IUP+OBJEJBARoxgpioFo1/0Su4Y+B9GqM2FqFBKthaVGiazWruZKGukXC/bHU3x4AS kYWx+rS4KAcsQF4M3yTD2nRlPtaa7nvqn+al+I9wCfsr/4khI0V7eG9XqFFoQWNNZIXm 8gmOHQIzLXw4xIMMdC/OhuyrANx0/ny5rPf4QA7RBp7l9sDH50LPtsPdS+2Nznm4iwhr AZjn37h8gmt/nG5VmYyyvLRjTFrKAlx/WnEGmLRM9yBX0xYPQ/3z239am6xVMJGpUwGr PDlE9J2G3/ObHMeRIFbOdv40sERkbhQX/t8dJVZMBob443plaLg581IqYpJfIwNQizHw c+JQ== X-Forwarded-Encrypted: i=1; AJvYcCV/495tUxbhmZcl6eb2NLy4c7zq2f8KdwMUSL5fKgEv7kofifD7CqH/rt+o/irRI0l5nYtXgDZc/u1kH/wn2kKfWnjdLA/wK1G7NOsN X-Gm-Message-State: AOJu0Yy+KMK6pTH23bsZRkc15wVpMgkSPGL1MTFtidL4NTeXiUdGCmJ9 ARLfSTrQf64S1WPhsIWs/zZDm22EKKUiZkLpVgWbjOZGOBjg2j6AdtTDRTGiDQ== X-Received: by 2002:a17:90a:d504:b0:299:4f5a:62d5 with SMTP id t4-20020a17090ad50400b002994f5a62d5mr105371pju.18.1708639257389; Thu, 22 Feb 2024 14:00:57 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id qn3-20020a17090b3d4300b00298f88c3e48sm4527739pjb.11.2024.02.22.14.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:00:54 -0800 (PST) From: Kees Cook To: Tycho Andersen Cc: Kees Cook , "Tobin C. Harding" , linux-hardening@vger.kernel.org, Greg Kroah-Hartman , Guixiong Wei , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] leaking_addresses: Use File::Temp for /tmp files Date: Thu, 22 Feb 2024 14:00:49 -0800 Message-Id: <20240222220053.1475824-2-keescook@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222215755.it.764-kees@kernel.org> References: <20240222215755.it.764-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1548; i=keescook@chromium.org; h=from:subject; bh=uhlU0x25jSC/q8kWZ2CYfZhoRlBn6ETL7DGvp44hrLQ=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBl18QSRxHv+PncBp1jAJSRPYWJFFgg3pzsNc/fN mCVDwrb19WJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZdfEEgAKCRCJcvTf3G3A JjY1EACmTYoMq33mIDZg1J1ccpxT9rC05SHFddeTqn6AUUuJ2ooqezEOEfFFA27Ddk8ijg1xGM3 pp4Tl54ejn2YBtA10Jgllds3r5mmkKrfT2GkefLJzqOrNQSrWvohbvcv8kLDmDMeO+xEGf1hHr8 eGKI0ugKLeqPQ6fsCshEypj7+DRbcGmGjdU3/8yWhetBF2iD9R549t+vGn+CWEPvfiM6xTCq+ys doU62myz1PWLLntN8N5b09Hn0H2+ab4U+n8TOmOFV1eqNeIDI2jZFhRs1wBbfyCWdpanhHeOmse KboyhOh0Mw6EyT7FX/SC0uWN8lhCosFPLHScOu+HjwQTdn1b7jfZHCbLzkelij2t+00aZ15bMno G9Pxpi9NI7Wx4+K2iXkxDy9+wRcXr1ThOzZWrFDR1MB6PJ5YUFR2WT/jg+LgNmm8KGdcQyhRimt XVfXyHjAkkwmjJNMQpC/aJSXPiI40cTx2Lilx477BccSMsaiCjxbu6hKS91lNIiTikPOeZWZXo1 1ipvTqdK/uI7PP6reIDKhBHaqDKX/o6RRO5K1bOyGN+HJuBJPCvZUW1iwW8eyCaNQYSffKr2Z6o Bm1ejWbbi9wdH5jfO5G41DPQL/oKjxnpQ+fEnMvnE8obItWSmlcsJbRlTR8kolHtrcyAH1fapd1 8SXzHvi1BdKbcLw== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791638234640502446 X-GMAIL-MSGID: 1791638234640502446 Instead of using a statically named path in /tmp, use File::Temp to create (and remove) the temporary file used for parsing /proc/config.gz. Signed-off-by: Kees Cook --- Cc: Tycho Andersen Cc: "Tobin C. Harding" Cc: linux-hardening@vger.kernel.org --- scripts/leaking_addresses.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index e695634d153d..dd05fbcf15c5 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -23,6 +23,7 @@ use strict; use POSIX; use File::Basename; use File::Spec; +use File::Temp qw/tempfile/; use Cwd 'abs_path'; use Term::ANSIColor qw(:constants); use Getopt::Long qw(:config no_auto_abbrev); @@ -221,6 +222,7 @@ sub get_kernel_config_option { my ($option) = @_; my $value = ""; + my $tmp_fh; my $tmp_file = ""; my @config_files; @@ -228,7 +230,8 @@ sub get_kernel_config_option if ($kernel_config_file ne "") { @config_files = ($kernel_config_file); } elsif (-R "/proc/config.gz") { - my $tmp_file = "/tmp/tmpkconf"; + ($tmp_fh, $tmp_file) = tempfile("config.gz-XXXXXX", + UNLINK => 1); if (system("gunzip < /proc/config.gz > $tmp_file")) { dprint("system(gunzip < /proc/config.gz) failed\n"); @@ -250,10 +253,6 @@ sub get_kernel_config_option } } - if ($tmp_file ne "") { - system("rm -f $tmp_file"); - } - return $value; } From patchwork Thu Feb 22 22:00:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 205079 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp233220dyb; Thu, 22 Feb 2024 14:01:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWd/jH6ZFOOL4VXdBAFbXWWvkz4no0/XOufn33kqcizZAAGypWrqJeGnk8h/g8mNcu32LEzvi+CiwtU2uN0QVrq3sDNeA== X-Google-Smtp-Source: AGHT+IEqCaUTlAd+Au0pUugntQ6J/3l6iijJY31ynC/2rOElVXorRPhZ3jJfkypZfm3ffRKJpIMb X-Received: by 2002:a05:6102:ccb:b0:471:ac66:61ce with SMTP id g11-20020a0561020ccb00b00471ac6661cemr409660vst.0.1708639310310; Thu, 22 Feb 2024 14:01:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708639310; cv=pass; d=google.com; s=arc-20160816; b=LR9j8BHqYkzezNjp0TvSrpRh9tZ9qNUpMsAlP2eoHAiI0xmFQxLbNqw28FZKU+rpzj 16RmRVvLHGOp6qUPpEDowG8I6oHYYCZBvG+WoU5QuEE1/vjoAZkY3E0zVq5fDUlXPTl9 eOr1Y133XHwBE/Ba9wVWIOSuWveht83gt1upaKA1PdCVgLnKHJHDl8/jSkxIoaoO7lgw zbISaIxKLz5DszM1kWRJpSxR1njXKWXuHGD8V3vYxZ1f/qV6/6wO+gTjoLm6Cja5jsSL K42J4BMfjy156CrYaFQuohBFw48e/QhoTEsuL0/ttaw5AyOGKw/Iu8k5b1RbczR0+1X8 bHRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3huveT0qUmlhJikw9NWYKFn9utf763+YTzbXHUOY1cM=; fh=hCietRCEpqLqNhCV7yNCozg8zkjmaBVhBtZQ81O31L8=; b=jNPyFzhkACZc2L8pvZKniUZhACIAnIgHpuGLo6E9xUP0eATgMp6AjKy38h2xaKRrq9 w8Kdv217FgJrSlQEqZH8JMQe0o1IJ6YKJ0Fj6oQTnaXfahO4B4x4NwCuGm7x0eMbL67D XT4eoTxTQ6bWk8lWqI1brkn8C7cLx8GT97456lSBzLWPJSWgqrSIuJRwxqveAED8GNl5 9pwOP8TlTuoQpd6UMH6eey7I+nK+NGr0WVE52xKHtfq+EEal9TMUWeKfqRzKylgwzdxZ VE57G5vCxm42ondoC2WHiHhnnn0LuuVVgo+c7EYxtaaReLlR87xm9um5tJtx6pY5PQhC 4zzg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d+p407jN; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77434-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77434-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id hz20-20020a0561024a9400b00471ca121d89si11650vsb.183.2024.02.22.14.01.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:01:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77434-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d+p407jN; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77434-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77434-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 091451C23ABD for ; Thu, 22 Feb 2024 22:01:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F226D14B81E; Thu, 22 Feb 2024 22:01:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="d+p407jN" Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D988B12D20E for ; Thu, 22 Feb 2024 22:00:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639260; cv=none; b=NLiw4+MB1nBxyzSCaJ1n++BwEbhhyC60m/0oYmqifABqqF50Swp1AXZZ1q7P6eN5Io/M5LtzKQoF9enVl3/aeCNYTuEZkwJAKN13k12jmVv3mdt0mvSpAZBbz9V5mkkUp/wDadIlRzFigjCwAtIc7K1t9W42NgNtRZGBXPi9V/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639260; c=relaxed/simple; bh=UGxgHq7SGP8k5JaOrHY0DZqOtzZutiNCD5ult3MMLBE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=unUwIiATtAXeAT4SMsvJ4MLKeQVYkq5lWYwBejOs4NMYBnOzWq7xK4e/5+zNYXDSyIDdrrxsechllkKIXLRdq2uSt0J5EEDzUDk9xDdwI2ucyENNg5NddpF4TXv9zNQ/gAPPuZY2C+QL+coAA75FXW4Eqr5QVqiEHw3Vf+CXSWo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=d+p407jN; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2997a92e23bso239721a91.3 for ; Thu, 22 Feb 2024 14:00:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708639256; x=1709244056; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3huveT0qUmlhJikw9NWYKFn9utf763+YTzbXHUOY1cM=; b=d+p407jNS/kXodWtcM54K9gicgAo2RCVlOeK7QBkwt5cc4ax9oP9QPaUFKeIlbaapW 7kIl7ee4qPQDOpjAfFaiKt0XtvOBMK3TK+YrruIzdrGJ9w3Te1GGKH59lvwYM4rsWZk2 B7Wbu5hk3B0v+xCcHEDOvTywvBhsmg5Tm+0Z0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708639256; x=1709244056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3huveT0qUmlhJikw9NWYKFn9utf763+YTzbXHUOY1cM=; b=UIYyGi1Byw11jU/B0APX8cGptyWSe+/R4u6z9zVPDMQMGc6Z3bg2ABIdJ6jCC49UjY OnKLBIVTb9/T+8tjDqqSHyitaCCmpHVv5IDpBnGLJZZaRMJhXNRU5tB5TnLsU0UQ8Mxc tks90Wupg2WeDXcW/PVRvLOqzugJC2zZ+xd7GYjplotjSdnqngogoIN4XtNIpcBijodu 2XWM9MUnj4ogzLejz1T24CLCdaVZBVjFoUeHyI9F//Xp+9zFOorqnN/3b4fR13r0E1Uo 6Nm6gQEcDXkpSWIy2rgkj+oHlDhcE284mWzaTq5EmdMWKdwdupwkMtuAz+GroYQSbyte FlwA== X-Forwarded-Encrypted: i=1; AJvYcCWsxRKiwGSLlG5ml7IFY+VAsOFvwoST9JIanJBK8O7ZTi9Vj+5ZamB6ptNFJqkaotUKNRc47Xf3xWsIK9FeFjhJNYuZIpeD827EgMX+ X-Gm-Message-State: AOJu0YzeLZVNrivNmdqD3EyMz0FtNun3bVkNB47a6Yq0gGvKFnqtIvZW twk1TYVFX7DJrkUJyLjJU8BiD/uAYdGKkdil/Y+01+QyEx7y4XgCvhyQywMfM6rdRXpa3hWVMXo = X-Received: by 2002:a17:90a:e98f:b0:297:17fb:4d79 with SMTP id v15-20020a17090ae98f00b0029717fb4d79mr101708pjy.2.1708639256048; Thu, 22 Feb 2024 14:00:56 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id z19-20020a17090acb1300b00296e2434e7esm12555123pjt.53.2024.02.22.14.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:00:54 -0800 (PST) From: Kees Cook To: Tycho Andersen Cc: Kees Cook , "Tobin C. Harding" , linux-hardening@vger.kernel.org, Greg Kroah-Hartman , Guixiong Wei , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] leaking_addresses: Ignore input device status lines Date: Thu, 22 Feb 2024 14:00:50 -0800 Message-Id: <20240222220053.1475824-3-keescook@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222215755.it.764-kees@kernel.org> References: <20240222215755.it.764-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3371; i=keescook@chromium.org; h=from:subject; bh=UGxgHq7SGP8k5JaOrHY0DZqOtzZutiNCD5ult3MMLBE=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBl18QTepsFkxDUunQkauTY9LXl/JFwdo6t+IYy0 EMBYfndTweJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZdfEEwAKCRCJcvTf3G3A JnjMD/9yj39MZOjlEWxLkUIX/oXvqJMpGF2DoPIdz9/TS7bx9UjR3LCLoODWqkCnMrlzZJXv0Oe 1UMUwpCnebB8xkbHXRWVMS/Trqpct+hMHW5BcTDzCPa6k3/f5mNIi1McaCwn8GPOjGK2sGMYHBc kzJp8uW5a1kO7Qlj3BWzi9H7vehUf2olWjn7lwLZsQFQPtaMWEEgjvfgdNV/HV4EUdplSPue8KZ 2qA3HNR+Pwo3qNsaz3rMw5yTM1wHK/AmgcPpnnmejB/MJ7DStG4o1xIaN+jIKV8AlESI2K8/OhJ +wV13iKTocEFZLjnGkfYN2MBcrOwCLZGBmK8gofm5lTvFw8wSkpPMPPUhc9+lccM4bfd3a5pwJN TwwaS20rYLSbnk08V5+Bx72SQ4cyYwqb6OQthxH8VqZF40vmlwu7Y0SPC1wTGlWDlBcWKXdVcnZ S1IwH67y/0MMbNJjqf8P2NWIl0SpoMILxBtGV2B6tzqUxuY2lJTTGNpv/1PNkC9hNOT4SD/+xqr M0ZJClQciikw3Tx31XnjPYOi4SSfr2vGip/ohsMVMMGWzqwVJe8kEnUF4WkDzU9nzXBDwKNOatm auwhPRF49kzemOIeLhzX2GpMO4o3DJn6VeZxqEQCu6ahfpc6KsHkuI8f//D8hV1RFzGPIIzPlzK enNnq/xE8BfARww== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791638173033694354 X-GMAIL-MSGID: 1791638173033694354 These are false positives from the input subsystem: /proc/bus/input/devices: B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe /sys/devices/platform/i8042/serio0/input/input1/uevent: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe /sys/devices/platform/i8042/serio0/input/input1/capabilities/key: 402000000 3803078f800d001 feffffdf Pass in the filename for more context and expand the "ignored pattern" matcher to notice these. Signed-off-by: Kees Cook --- Cc: Tycho Andersen Cc: "Tobin C. Harding" Cc: linux-hardening@vger.kernel.org --- scripts/leaking_addresses.pl | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index dd05fbcf15c5..73cfcc5c8854 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -284,9 +284,10 @@ sub is_false_positive return is_false_positive_32bit($match); } - # 64 bit false positives. - - if ($match =~ '\b(0x)?(f|F){16}\b' or + # Ignore 64 bit false positives: + # 0xfffffffffffffff[0-f] + # 0x0000000000000000 + if ($match =~ '\b(0x)?(f|F){15}[0-9a-f]\b' or $match =~ '\b(0x)?0{16}\b') { return 1; } @@ -303,7 +304,7 @@ sub is_false_positive_32bit my ($match) = @_; state $page_offset = get_page_offset(); - if ($match =~ '\b(0x)?(f|F){8}\b') { + if ($match =~ '\b(0x)?(f|F){7}[0-9a-f]\b') { return 1; } @@ -346,18 +347,23 @@ sub is_in_vsyscall_memory_region # True if argument potentially contains a kernel address. sub may_leak_address { - my ($line) = @_; + my ($path, $line) = @_; my $address_re; - # Signal masks. + # Ignore Signal masks. if ($line =~ '^SigBlk:' or $line =~ '^SigIgn:' or $line =~ '^SigCgt:') { return 0; } - if ($line =~ '\bKEY=[[:xdigit:]]{14} [[:xdigit:]]{16} [[:xdigit:]]{16}\b' or - $line =~ '\b[[:xdigit:]]{14} [[:xdigit:]]{16} [[:xdigit:]]{16}\b') { + # Ignore input device reporting. + # /proc/bus/input/devices: B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe + # /sys/devices/platform/i8042/serio0/input/input1/uevent: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe + # /sys/devices/platform/i8042/serio0/input/input1/capabilities/key: 402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe + if ($line =~ '\bKEY=[[:xdigit:]]{9,14} [[:xdigit:]]{16} [[:xdigit:]]{16}\b' or + ($path =~ '\bkey$' and + $line =~ '\b[[:xdigit:]]{9,14} [[:xdigit:]]{16} [[:xdigit:]]{16}\b')) { return 0; } @@ -400,7 +406,7 @@ sub parse_dmesg { open my $cmd, '-|', 'dmesg'; while (<$cmd>) { - if (may_leak_address($_)) { + if (may_leak_address("dmesg", $_)) { print 'dmesg: ' . $_; } } @@ -456,7 +462,7 @@ sub parse_file open my $fh, "<", $file or return; while ( <$fh> ) { chomp; - if (may_leak_address($_)) { + if (may_leak_address($file, $_)) { printf("$file: $_\n"); } } @@ -468,7 +474,7 @@ sub check_path_for_leaks { my ($path) = @_; - if (may_leak_address($path)) { + if (may_leak_address($path, $path)) { printf("Path name may contain address: $path\n"); } } From patchwork Thu Feb 22 22:00:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 205080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp233260dyb; Thu, 22 Feb 2024 14:01:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVjEgHuKmsv2mA2LV8E3S6wz3BywuGL1wf8PFu9LKD59CCOeVv4kAMhpCAVGUMQf/d9wSs+lwOsoo3YwmByeqsL/xfXUQ== X-Google-Smtp-Source: AGHT+IHujeZzN326+gQXViHYc23vpJp8In7UJZRlwv28cGv0J7JrMI7dRUIb+HTOyUCnX8YlM2N8 X-Received: by 2002:a05:6102:c08:b0:470:7a7c:2d2b with SMTP id x8-20020a0561020c0800b004707a7c2d2bmr236764vss.10.1708639315149; Thu, 22 Feb 2024 14:01:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708639315; cv=pass; d=google.com; s=arc-20160816; b=Z9s5LFxEt6qsneZjhJekGneple4mTaewhfnAzTY4QSvbFrTxxp8jTSFUXcyPW01kwc W+lWUOYd1mihKW4GQyOIfuJCEzdV33ze8U7lc3In+8BNPnhhLx2fbhCGyNO+t1neTPpQ p5HHhPFhJzrHsBJdvnOFDo3BhlwaRUK2s1hi1J9KHMbB52nvL7ez+WY31HeScC9gfy9+ S1dqKHO6CEIaqq9LE21F7o91wiDtKUnBTdrNNy+3vIWYA/Z2wB723ORZqL4d5QVxzJGz pa9qgievBrBN1Gjbz4JIFbQR7p2gWliKFqZTfuHuJUoBNB7r3FM3I1/K6H9K3RfswN/T ItTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xe2gLkj39s2Uoixf+agRWlsso1N0pC35kqHZ8X47pOU=; fh=eT7jnWFSWRSuZY9V2ztipw0HMceshr/Uo5tKnr7Wl/A=; b=kRh8+2NYgL0U5Dpouy/RnlkcY5V0EuT3bbxut+pAYRjFCNrX9OvrplzmqMm+2duYrB PbM+QyHl9CGGCin3UlRCWfVwUi4KJU9m/vDY3BD0avJuVLMBTdLC+WeVyuKzn8gnwsqY z8Q170M2oULAXFTR59skTtUjmJTZc2ULaYoC4+RFatbQhTsxk67vFl3hPWV+BMBzbvKH Bl9Q8Dg6e+E0Uu1/cn9ef7RzwwrZADPUTkprqQ11wZp0Q34CbBxYgTKI8WuQnSAfc1aH VvH87rEy7hkVT4QsOCdlmappIVmJJtVexNWHTjxWHXEkZkSMSa4a+2Zy+NAsE6Dx5LqG Qgtw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZhiddbWa; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77435-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ji21-20020a056102189500b0046b61e8d294si1947902vsb.472.2024.02.22.14.01.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:01:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZhiddbWa; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77435-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C5AEA1C20E2A for ; Thu, 22 Feb 2024 22:01:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42F6B13BAF3; Thu, 22 Feb 2024 22:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZhiddbWa" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC48612D21C for ; Thu, 22 Feb 2024 22:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639260; cv=none; b=LV1uc5aoCLxkOTZ5e5elRJvnsvjY/ry8IGDX9pSuhnPOAaf8J0DIB5ED6ojGHJ3fKrEmexxnwKjH6d2U5SSWmZ91ZpAeVeDa8GCjzBpZQO+X3awZNZ5d0WKNqZxOxG20I9zhGgGU1jhtpbJono98yDxsdYbwzDoTJWK6I8GgtTw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639260; c=relaxed/simple; bh=ZM2GR6IBtwz0kQ9xgCjrTuxbIaOuzN6JpSMqdXS7f9k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BaY2JTJ51CmnMlMvPk4S40bC91DD1I1+eqRyp2byRvBn9Cl39jM05/r51hWtJ64fEU8O0I5EZ0saP5Ie7s4DXNUag8qOJ13lmCjEymrkOQ00v9130MPpS3WBm/gon3BQClqmr4Cd80Fu387AnkKaTFqAqA4QZguSYXxafHgO8ck= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ZhiddbWa; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1dc1ff58fe4so2780495ad.1 for ; Thu, 22 Feb 2024 14:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708639255; x=1709244055; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xe2gLkj39s2Uoixf+agRWlsso1N0pC35kqHZ8X47pOU=; b=ZhiddbWahVMWtvB/rz/K+UZHACbjzHHGxkuQFvwrLlK/goGZmLWHuuZb0QODgXUUM8 M3860+sM4Vhfa39xhF/lw9tcJvFVRiuHjjZ8MMampG6zh3JpLSdlYbqVsuFdvr43o3L2 u9SW0ydQziNCrbawdW7hlYKjrvPVw/sX8hWRA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708639255; x=1709244055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xe2gLkj39s2Uoixf+agRWlsso1N0pC35kqHZ8X47pOU=; b=jUfkdJsbWyu0IZYlJvxG6VPpP6XxRIFLS1hcZA+NgjU8glSW1eyiV6oOvZa3iNyl84 tcTbRE63n5Bvh6vr+4lHet/Ws7T7j8XbkcPiY3G2HZ+W+9cOGLsbANoW8rrx7ajECASW 0Ietg8ShFiZHRGDxCa0WI2Wspt0Ld22jdPQvB8Thm8pU375n4pmRnl+gpzvtX8ec28wj RjZL+vc2RH3o40ARp7ZYP6Lm8KACmRK8uU/fIN79lzvGjNFvf0KOVWi8d9o/DsXv4kV7 Pk4BxSH4EZe8wAvnCXO4hMGoS9+bQOetq3IMTW/KSY2vM3MrgtCKFby22zJ1YzdfeU/M doTQ== X-Forwarded-Encrypted: i=1; AJvYcCVS4azMx4pQp0lTohSbiKawh+lKmBuI2eaqXNKgfRCJ+Cp04aprMTPQ1LDtBZNOBF1C+az7vC+gSHv0apvOmAmgpO3MiouWpZ5bffNk X-Gm-Message-State: AOJu0YwjL31/4Xkr0UaeFJS4wpJz89WUQBHpiMyHTAnLIWHd43GVgYDe JlWilUJYjRaNPNy85vXXzani7hLxvsJ7VuOdNetAJrjE+/B2uhN02PebMNj5Fw== X-Received: by 2002:a17:902:f690:b0:1db:e9ea:31 with SMTP id l16-20020a170902f69000b001dbe9ea0031mr136788plg.62.1708639255087; Thu, 22 Feb 2024 14:00:55 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id q18-20020a170902c9d200b001db9d2c1874sm10441463pld.29.2024.02.22.14.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:00:54 -0800 (PST) From: Kees Cook To: Tycho Andersen Cc: Kees Cook , Greg Kroah-Hartman , "Tobin C. Harding" , Guixiong Wei , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] leaking_addresses: Provide mechanism to scan binary files Date: Thu, 22 Feb 2024 14:00:51 -0800 Message-Id: <20240222220053.1475824-4-keescook@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222215755.it.764-kees@kernel.org> References: <20240222215755.it.764-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3757; i=keescook@chromium.org; h=from:subject; bh=ZM2GR6IBtwz0kQ9xgCjrTuxbIaOuzN6JpSMqdXS7f9k=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBl18QTRS+OtPCzXuU3K6f0NRCmSrNpfZm2QSXVK vx4OP/dXYWJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZdfEEwAKCRCJcvTf3G3A JnYhD/95iRSTT8PrBCec5gNuggTGafSw4zAl7bfV4degmG5Ys3xBX/fiYw7IYq9ewTeT2l6TwmC zN5t7qF0GMvCgFG5loC0zmyhrPmM5A/FqeuBsR02nSJgA2OMagymx4uHYclFUlDsKICsPfUKpm4 LtA0T8KCdB9qkmf+k+yqYfP/CQDJVY8bVkegNoc7U9WbSME94EAIDXQe1yZz9F55/bwOUPtci+X R55bhbhgxacEm+i2299Pl5WruZ7YDAcHVYXp/tMAXowh7gGqhZYFstwIl2Cf1YKBfF31LSt4KXz ahC/wRGevY09cLB0cGNusBlSypdD3/i+NPRLxL3QZ+/q4CLnsq9qKitVrCzSE/xC2HqtkVasQGm 0Ju++VXbp18k2ydPKN40po7JQp3zofvqyD0TQCAnb8wsojY9RnFhwewgKXu78tZrO0gtyZtgWwx tDMiAT14TNl3NBv7Omrxmx+M+8oDliUXUD3ODZqkglCggskDHkLfgO4HLQlLbvDi2SEvDsTDZip ZzgNKpEdBdArv7qWxf4VGELv/aSVnl+w7THW8Y/3l+pqufGutRKEfCd45podywPcuphq+SWSizr lNlwM/LCYVOCVAtCIJCuOdZwzd/hkpvj1WWMf8Ggc/N3xxWSTEllF5UBOtc18k7Bn8bm9TQJgTh dH5AIHLCd39ufpg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791638178638905053 X-GMAIL-MSGID: 1791638178638905053 Introduce --kallsyms argument for scanning binary files for known symbol addresses. This would have found the exposure in /sys/kernel/notes: $ scripts/leaking_addresses.pl --kallsyms=<(sudo cat /proc/kallsyms) /sys/kernel/notes: hypercall_page @ 156 /sys/kernel/notes: xen_hypercall_set_trap_table @ 156 /sys/kernel/notes: startup_xen @ 132 Acked-by: Greg Kroah-Hartman Signed-off-by: Kees Cook --- Cc: "Tobin C. Harding" Cc: Tycho Andersen Cc: Guixiong Wei Cc: linux-hardening@vger.kernel.org --- scripts/leaking_addresses.pl | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 73cfcc5c8854..8e992b18bcd9 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -52,10 +52,13 @@ my $input_raw = ""; # Read raw results from file instead of scanning. my $suppress_dmesg = 0; # Don't show dmesg in output. my $squash_by_path = 0; # Summary report grouped by absolute path. my $squash_by_filename = 0; # Summary report grouped by filename. +my $kallsyms_file = ""; # Kernel symbols file. my $kernel_config_file = ""; # Kernel configuration file. my $opt_32bit = 0; # Scan 32-bit kernel. my $page_offset_32bit = 0; # Page offset for 32-bit kernel. +my @kallsyms = (); + # Skip these absolute paths. my @skip_abs = ( '/proc/kmsg', @@ -96,6 +99,8 @@ Options: --squash-by-path Show one result per unique path. --squash-by-filename Show one result per unique filename. --kernel-config-file= Kernel configuration file (e.g /boot/config) + --kallsyms= Read kernel symbol addresses from file (for + scanning binary files). --32-bit Scan 32-bit kernel. --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234). -d, --debug Display debugging output. @@ -116,6 +121,7 @@ GetOptions( 'squash-by-path' => \$squash_by_path, 'squash-by-filename' => \$squash_by_filename, 'raw' => \$raw, + 'kallsyms=s' => \$kallsyms_file, 'kernel-config-file=s' => \$kernel_config_file, '32-bit' => \$opt_32bit, 'page-offset-32-bit=o' => \$page_offset_32bit, @@ -156,6 +162,25 @@ if ($output_raw) { select $fh; } +if ($kallsyms_file) { + open my $fh, '<', $kallsyms_file or die "$0: $kallsyms_file: $!\n"; + while (<$fh>) { + chomp; + my @entry = split / /, $_; + my $addr_text = $entry[0]; + if ($addr_text !~ /^0/) { + # TODO: Why is hex() so impossibly slow? + my $addr = hex($addr_text); + my $symbol = $entry[2]; + # Only keep kernel text addresses. + my $long = pack("J", $addr); + my $entry = [$long, $symbol]; + push @kallsyms, $entry; + } + } + close $fh; +} + parse_dmesg(); walk(@DIRS); @@ -447,6 +472,25 @@ sub timed_parse_file } } +sub parse_binary +{ + my ($file) = @_; + + open my $fh, "<:raw", $file or return; + local $/ = undef; + my $bytes = <$fh>; + close $fh; + + foreach my $entry (@kallsyms) { + my $addr = $entry->[0]; + my $symbol = $entry->[1]; + my $offset = index($bytes, $addr); + if ($offset != -1) { + printf("$file: $symbol @ $offset\n"); + } + } +} + sub parse_file { my ($file) = @_; @@ -456,6 +500,15 @@ sub parse_file } if (! -T $file) { + if ($file =~ m|^/sys/kernel/btf/| or + $file =~ m|^/sys/devices/pci| or + $file =~ m|^/sys/firmware/efi/efivars/| or + $file =~ m|^/proc/bus/pci/|) { + return; + } + if (scalar @kallsyms > 0) { + parse_binary($file); + } return; }