Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp596374rdb; Thu, 22 Feb 2024 13:11:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWZ8m9d0Pyp4VJgleZPPul7IKI4HPs5FjJX3E4CajS1pDNxmIFgBi6WTqcJI0DqPGMoyZ7EkH5zsE05mFVjBvs8CuVwC0iNtmjNhA7cxw== X-Google-Smtp-Source: AGHT+IHdSlMSBxNEqUiS1nS2Lxs0sAao88hgxpJ+BU4TaVzoD5DcT9a8y/9NIdI76Ti3TmEumUWC X-Received: by 2002:a1f:ec83:0:b0:4cb:96d5:ac68 with SMTP id k125-20020a1fec83000000b004cb96d5ac68mr254052vkh.11.1708636277162; Thu, 22 Feb 2024 13:11:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708636277; cv=pass; d=google.com; s=arc-20160816; b=U6fSqAscFS55OJJGW2TNJnTrFUXpPs/Q+t3zjOUnPSoIwi0lA3hUq/FH/ad4KuZkF5 wxPA9j/MR4QYSwlQM3/tblleZ0c6oybfy83+HvA6NU8WJO6u9cjaoL87l1YvAxTYP6gX jEqyp5BJ3746HGzy5G9uJ+6TUCL786ztV8AoWBHkyVhWT9Jp+LSQUZDR1/vnQqejr9Vl jbyzGry4LuEoWMXiZ6sb9MunpFPskwgCOCUU6YJSY47/vBAUiX0k18GOEPKz42yQutI3 0+UW1DrS7yEidRywjcqh+bQxAoUeBPgNBA/EMjlIGPWTpX5DMfg2c9CG5Rsry6hkOjYj r7Ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VOezS8N/LfE8pkfky12K99tbz+EeBQVE3XgUFFXVk8A=; fh=KiGfarjJloZILUzcf4xg2Stv/HnbsT5bocfnwGEPBOo=; b=QVoaSzSgFggDcadAYPVygVq4h8aaCnNokpVgh34YJXZwxWxRqlRiqaJO6L++99QWgX 8SCL81KQ/ObSSzwGHIQMDgjFcBTx7mgnFE9xwkKOSFpW0KQHAVQcoGkSFZFSgTZzcKgk i7aV9VRvFZjjFt7pWkIJJYQah3w95cecbAYkHaYwLjV+kmbpdX7XrMog3RHvsLgKua7C wgLcICMnevbwXdFsC4mPJ54EIb6AGGpf4YlzZTsK43kJvY/U1uJ6Tsq1KQ+sjRwf9+Yc UhcU2+oZmiazXwVqdIZx1fHdFNC8XTIl7Hun+3aQAhn+k6+btEyJaCHg3cTpzuQfo9qO pjCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jbFYj0it; 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-77367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 2-20020a0562140dc200b0068f07fbcbffsi14975147qvt.43.2024.02.22.13.11.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:11:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jbFYj0it; 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-77367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77367-linux.lists.archive=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 E05681C221A3 for ; Thu, 22 Feb 2024 21:11:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3FD513BAE8; Thu, 22 Feb 2024 21:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jbFYj0it" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 A9A2C73F23 for ; Thu, 22 Feb 2024 21:10:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708636215; cv=none; b=fjBwG6eP8RdkVUBHXhLN7kb92UxpHFJWOOB/iaGYhpkTv6uipvnlOSyFtOd/FCgA/cWrbjeLOlYst5oD6yG7lUOqH27YQNbt1uqUUCJbAs2D2bqvkguGV7Y9tUSZ1EjBuqdNU6f4bbFxbEjY7Nan/oBdPVjzZz/d0VcmUqxwgO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708636215; c=relaxed/simple; bh=2wKUaHte55mMdugPouwLtNpZ3iu4duEXOyG89NHGuJk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AwnXy0rQlSwF6o3jfBVOHfW/O3mjg97OkpCxFovdgBDEtdUTK75Gs4eLHqkIrnfZKMo0CljkQoj3pIexwr8XWf9EfClfk5Qc3CrdXjP16aSQUCO4KjxKEpHvfJhnuetX3nmmjdB9l1JeNJmXiftDOMR1qvzYTCR0bjmtFzW9hII= 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=jbFYj0it; arc=none smtp.client-ip=209.85.214.169 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-f169.google.com with SMTP id d9443c01a7336-1dbae7b8ff2so1740175ad.3 for ; Thu, 22 Feb 2024 13:10:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708636202; x=1709241002; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VOezS8N/LfE8pkfky12K99tbz+EeBQVE3XgUFFXVk8A=; b=jbFYj0it3hlCjZKtuB7SBwoMeEYMvwGAMOhPjTLnCuKwM9eKfSR7eN28dgbhFe/pdH hsgzPfRSbYUJHahR3xAoUX2fBMinFLKcchiVL0H6DxgBuelOoLV+9IOYkozpKoddjmQf uj0t23/hVPd46EQrUamvQbo6L48H650bscF0Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708636202; x=1709241002; h=in-reply-to: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=VOezS8N/LfE8pkfky12K99tbz+EeBQVE3XgUFFXVk8A=; b=Y4Z7vk254EpnGx5HIAR4f7wdkaot/zlMQlkKjcj96HpQF8oW/vWndeBhK24wV5jtMm hiyXVg/VaJCiqqZ0clxndOcomi60HHFmHDouI6H7JBYBVyxfzpVE5aqZFVEdMCYAu0Kn VGGpO+sWNqgNLqpivk97P11T8x1kTdQ3vxtKGUiv03q229zxO5BjNjBUN4t3znvXQ8Zl xs0A798FTGArXXPArFR1GsXDjwXA0ujK2SbIwQU8Uo1IqrG/rlpeoho8nJ+LxTn2nwSY A2F2etEfVRjww1QXJcl9yyGselVpGUYLO+T0OkwBF2Z/TOG7pQldKosXa0XJL7zECT35 YMwg== X-Forwarded-Encrypted: i=1; AJvYcCXFRtGU756kklFSwXcE1q7cMN8q5h0hTF+5EVGrue5NGohN5aj3ILJBscOD++a3JKg/cLhctGcaTfpmho0WTzqqNB1D3TcMjndYA5UW X-Gm-Message-State: AOJu0Yz2y1HWMUlr+VtErEPInTYbr8rhR/2Y3Mk+DJXpMxkBJ1NUdXAS DQHwU8Qh46yKkvvSHfD+NHP8Pk7WadHeKkj62Ds7VsYcqu4NX2OeiYJRz69WrA== X-Received: by 2002:a17:902:6b87:b0:1dc:693b:4083 with SMTP id p7-20020a1709026b8700b001dc693b4083mr27378plk.20.1708636201651; Thu, 22 Feb 2024 13:10:01 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id x3-20020a170902fe8300b001db47423bdfsm10233731plm.97.2024.02.22.13.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:10:01 -0800 (PST) Date: Thu, 22 Feb 2024 13:10:00 -0800 From: Kees Cook To: Tycho Andersen Cc: "Tobin C. Harding" , Greg KH , Guixiong Wei , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] leaking_addresses: Provide mechanism to scan binary files Message-ID: <202402221309.79CE163C@keescook> References: <20240218173809.work.286-kees@kernel.org> <202402221249.FA17A8940@keescook> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202402221249.FA17A8940@keescook> On Thu, Feb 22, 2024 at 01:00:40PM -0800, Kees Cook wrote: > On Thu, Feb 22, 2024 at 08:24:02AM -0700, Tycho Andersen wrote: > > Hi Kees, > > > > On Sun, Feb 18, 2024 at 09:38:12AM -0800, Kees Cook wrote: > > > 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 > > > > > > Signed-off-by: Kees Cook > > > > Patch itself is > > > > Reviewed-by: Tycho Andersen > > > > And if you can carry it, that would be great (see below :). > > Sure! > > > This does bring up some interesting questions. From off-list > > discussions with Tobin, I believe he is not particularly interested in > > maintaining this script any more. I was never set up to do the PRs > > myself, I agreed to be a reviewer to help Tobin out. I'm happy to > > adopt it if that makes sense, but I'm curious about the future of the > > script: > > > > 1. is it useful? (seems like yes if you're adding features) > > Yes, LKP runs it as part of 0-day, and it's found leaks in the past[1]. > (Though its usage could be improved.) > > > 2. does it make sense to live here as a separate thing? should we > > perhaps run it as part of kselftests or similar? I think that e.g. > > 681ff0181bbf ("x86/mm/init/32: Stop printing the virtual memory > > layout") was not discovered with this script, but maybe if we put it > > inline with some other stuff people regularly run more of these would > > fall out? Maybe it makes sense to live somewhere else entirely > > (syzkaller)? I can probably set up some x86/arm64 infra to run it > > regularly, but that won't catch other less popular arches. > > We could certainly do that. It would need some work to clean it up, > though -- it seems like it wasn't designed to run as root (which is how > LKP runs it, and likely how at least some CIs would run it). This is wrong -- it's not run as root. It was fall over very badly. I'm not sure why the CI output looks strange. -- Kees Cook