Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp40437lqo; Wed, 15 May 2024 20:25:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVEQ2d0ZU8yVsPSnp06ENrSK6mGlzrbC0po3/R7CydELf1sFbDpn+QfQhAOLOTI4zStLaCz16hgJ0jCMMGv6pd/NlCu9kgSGeYd0CStxg== X-Google-Smtp-Source: AGHT+IEQitvgXp61m/LsmafHVDMWxeldW7lpAyymuQffCabXLSr0IwWEBdimHoeNPEl0JHHs4PPi X-Received: by 2002:a17:907:747:b0:a59:a3ef:21f5 with SMTP id a640c23a62f3a-a5a2d65ed16mr2265461166b.57.1715829936626; Wed, 15 May 2024 20:25:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715829936; cv=pass; d=google.com; s=arc-20160816; b=lYuFjUj6zq9rFRYR//Rqjpu8fw7AKQbPfTBEo+cLBtE/+8U0/JUbBowclb9IA+eWPf oZBlAYSt4Pw/zx6LF00fo1oaBeosvcoV0/JIvScYIQuOlhV27KgG1XChSgDPO1wjqB20 q9RAbYWGnuY2vYmsjsbw7R5zMNLh3x9MlTkNroqJtWLDOC2AmPNjL1dP8AhaPUAnJhN5 M/3wKBFCr4QrNw1pmfrnTPySKNIQjo61utcBKmWbOn6I0EYDhdUlFoaIlidqNurf98kI 4ifEndGICfeMwvfuJ70QMWZacpDXjYqfivtC8KRbzh4PMhu0PetmvFoLl8dLpwoS6r7U 8q2A== 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=GvhInJ4856b1IIVjw0V0q2o2QfuhRdBKnXnI7msgx4Q=; fh=/tCJpCRjDCl3aGzNBSrjqnRMirCpz/qGIejrS+SxoB4=; b=Gb7eHnkyN8KmnnxIUXgsjn5Pngh+mj3Sw01bhi7cen/csGHv9GM52IfzGROwqx6xU6 Z6ZuHuh0a7yi6aNkDQ7/lgxwqaAS+fbdjVmKX1F7gilwDxn0h8dQANnOmHQLeMEDUUDd FdPkg4Zq77P+YuGijvBsBQ5nyzk6zW9YdWWMZ5etvi/jXprKxV3skbaGKHFyUm7vF8u9 FWjQZrJbEC9JB9ZC76G6dxCW/LbUG3sGo62e6U5wx+R26cQfHOw1WpVKCHonRiCFlrpW fdrxrMvQhK6y4BpHZKmeHj35v/Pc+8ZkxWJ7WcIvW8XsSQVOY/2tFo8kzkB4XcqYQDZt gr1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LIQXWnrd; 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-180599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be6be3si810395566b.808.2024.05.15.20.25.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 20:25:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LIQXWnrd; 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-180599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180599-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 602EB1F22772 for ; Thu, 16 May 2024 03:25:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E3FE4A1B; Thu, 16 May 2024 03:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="LIQXWnrd" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 570FB4A11 for ; Thu, 16 May 2024 03:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715829896; cv=none; b=jAk8ZaV4HQQETFpa3ePFlL0+587NF3WR/WM5efFuGQq3ONzbSE6iEQd+8OCUSyUzdeLXiI7I32DlOToChRqfZSncEMTgM4gUmNPcXZA1nZQ2IYPz1vHbWStGpKPtICo5hc40nqq+3xYGU8CWAeW/z2H0s4r6IMcnGdc/ZgzBM5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715829896; c=relaxed/simple; bh=bMJn9NymWE1wcW9+pBYiAojx2hakxFodH0+3w3Nt+aM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eAmzXa0/HAr2jt+Rga8iBgn3b8pAyRAv5uu1VSdkXklDAFtd/3cLYdXngGP2pRwCcOnIo+I9WZ56yzv9gJEadcSiNSsqMbOpOL868EUgyZJoQ+M6CAXZ/97QmpAkYlCnnxqEIZWGziD7q22CAiEflWYSstB7z/Yr9PQx3G4AIZI= 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=LIQXWnrd; arc=none smtp.client-ip=209.85.210.173 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-pf1-f173.google.com with SMTP id d2e1a72fcca58-6f44390e328so6996829b3a.2 for ; Wed, 15 May 2024 20:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715829893; x=1716434693; 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=GvhInJ4856b1IIVjw0V0q2o2QfuhRdBKnXnI7msgx4Q=; b=LIQXWnrdLSbyp6ugZTKgY4vrs9zaU8nTWaQwVAqclcQeHjZ2ZgD6BVq/NDcPhJDm1u b0z+k6OgSdOrfD5bQ3UVh/xQw5UOjZbl9FKEjuOwIHjVZmqM7RsiwOBjJW5pMraB8mJO jXtCx25TZBoTjpPKyoqp1VhSXaps1HGsFijxA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715829893; x=1716434693; 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=GvhInJ4856b1IIVjw0V0q2o2QfuhRdBKnXnI7msgx4Q=; b=erAsS897TNhOxcDmZdDAzCanu1M/Daf/9jegkDm3O3P4S/NNkCXqtJXMxD+WCBXaCd 7oWcgya4EcOKURG8OExiNZRmQEACTNXwSjTOrfpeQavaoHTF5XbkSk6l13Pnjtiizt9B mgs7fis7DfkDUg65qgMY11IbSVH0RVOC7V672X6QW1JY/Ejt3nUIcYGJeDXV2Xz7IAuz zuW+VUOEJr5ozLfE0D0UOnQ9337DyciZsDQB0Ccxn8tpxGhACPvYpxu/E50A5e4e2waJ Xpg1xzHXJVVCrODAi0oCu3fqbibVedkN6DCAt7RlUDI3fcphYRLIvkEMrBWqH1ySmqPd C4Fg== X-Gm-Message-State: AOJu0YxlazvjyB0KxVgZ6HrF5/MN7OPfE2iZUVZbQ5ObVKroWNd0h9Fo G/X5UA4MzT1QPKbzjc44mNcBgLcjbFsWYK9lQXo6mRBezlxvz1ZWfPkbdX2FTA== X-Received: by 2002:a05:6a00:4b4c:b0:6f3:c10a:7bdd with SMTP id d2e1a72fcca58-6f4e02d36a4mr26254518b3a.18.1715829893603; Wed, 15 May 2024 20:24:53 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2af2462sm12346867b3a.141.2024.05.15.20.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 20:24:53 -0700 (PDT) Date: Wed, 15 May 2024 20:24:52 -0700 From: Kees Cook To: "Dr. David Alan Gilbert" Cc: linux-kernel@vger.kernel.org, nathan@kernel.org, luc.vanoostenryck@gmail.com Subject: Re: thoughts wanted on dead code hunting? Message-ID: <202405152023.67ED1BD7@keescook> References: <202405141706.1D5D26C@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: On Thu, May 16, 2024 at 12:40:40AM +0000, Dr. David Alan Gilbert wrote: > * Kees Cook (keescook@chromium.org) wrote: > > // Options: --recursive-includes > > @find@ > > struct to_be_removed INSTANCE; > > struct to_be_removed *POINTER; Oops, I missed this line: @@ > > > > ( > > * INSTANCE > > | > > * POINTER > > ) > > > > > > (I bet this could be improved, but it should be a usable example.) > > Hmm, now if I could use coccinelle it would be more tolerant of coding > style and slight variations than my script. > However, trying that tiny example, I get: > File "play.cocci", line 10, column 1, charpos = 141 > around = '', > whole content = ) > > so it seems to be objecting to something at the end of the file? Sorry, yes, missed the "@@" between the identifiers and the code pattern to match. -- Kees Cook