Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp236738lqb; Tue, 16 Apr 2024 14:15:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGegkevoHxgAHXtPXDF0LlNu+N+AUizJA6V5XTBqpPQXlaFBhIFuZB6dV1sDhvSdxx/fQm+kAWKRgBIEuzDU+CdPPaM+wYN0j6vBMZAw== X-Google-Smtp-Source: AGHT+IG6QKRTYBMIfkkTILwoMbv6//PWoXW6PGn36bGmkXqzxw19Ou5SaNHMmoP2S/lIWrnFMErj X-Received: by 2002:a2e:7e0a:0:b0:2d8:39cf:5368 with SMTP id z10-20020a2e7e0a000000b002d839cf5368mr12045820ljc.29.1713302117242; Tue, 16 Apr 2024 14:15:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713302117; cv=pass; d=google.com; s=arc-20160816; b=S7gdTwMLNhMTd5tJlaaX4fbcL21aP8wXWnMqBXs+OXkLspPkAZs8kdikb+qqhA9NvM M17SGG2dOEw/QxEBgJjzjEfGJLoNYPjZhDgZaOTaIxIR7Hgc1wuHEGziKNvuqrWfTFhC x5R/jAprv9OQODFEKoezMLvTW5hiKSQTVShHmAxhJ3W9t7wufNZNFlcWg8fcJOIyhR7m ceSIwBMLEbKVIE8lvLvW/BHFaB27vXW4UEsYHUF8gKyGhNCUwXPp8BjtXwMf+7UxG1IW kYlLgOkyiTekQnRgaf0Ou+oRJ/ZdyiK4AiJMyrl9aplKVndkwoxUqjUlvQC/0DT5CFN8 rxSw== 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=pTzXQk5cYMYr3uWvC+W6FdkM1s551/ydGHaU1dE8ImE=; fh=3cE73e+A/mKZdEDTs6RgLwJ2QYN19ghqKNKoK4Se9+A=; b=Kb7G14flfMffkJwLcJS60woOyc2VJP6OLcRc4naVk4Y4KIjCu9BSz+ZLzYPcGXYEy5 Hk+tRfrDDmwhjL0HA42XHkTyMi7yVSd51DFCin0yxZ4WY2M4vwe0HfJllycUsvxM1DEf SZL3L146gGrQbUQafX4/qeFPK4/o27Nc25qS7U68wTk3Run+vbPWHR7ntXFpJ0n+stlZ W3wx1tRmeRPGaVymb5KSNd3oisJB5V5ZXat7XdoltgWPQJrNElDN2LWcx32dpQO1Bg+F WWoIH4vILsixU48M6hVYv28PWjL3llteDqFDgIA4jK1A6X0/KCxXjH1FjWIlFpE9TRnC ztdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="ZZ/JlCMe"; 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-147554-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147554-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 t1-20020a50d701000000b0056fe55b5ccfsi6000871edi.364.2024.04.16.14.15.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 14:15:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147554-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="ZZ/JlCMe"; 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-147554-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147554-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 EE3191F237ED for ; Tue, 16 Apr 2024 21:15:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCCD85BACF; Tue, 16 Apr 2024 21:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZZ/JlCMe" Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 9DFB61E864 for ; Tue, 16 Apr 2024 21:15:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713302109; cv=none; b=rOFci8WOmAlO97T2xfIJKkX8HTgN29mSTa2sWYGZEjBwkiu4DSCbylPyF+xliO3BUw5U6bFxTDbu8VMvCkAl9GSroPp4SUhT27GzBl5GPwp5ptcF/jSbOQjeyp3SIQWPGxkEeVUmJITGymDdYPf2s6Zj1XX2kRGrKkyHDIEIvgw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713302109; c=relaxed/simple; bh=PjGLsefc9/tCgj7AApKQXcWQr179c0n4nR8NEB1dlyo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NhsIAeg+igyet3DGPGeLVqmGmaBgnqls9qZocPowT2ftRwv1kw9QB8qWpIReTou2FiEDWlau77arikPnsWFpGM97/v3YnpaQ5vgq8r0dAxEfPi+g0KUjKe3kaKSfxH+whmhvdi4Ps8qwXFJEAKMWwrbEVPotxQr51WMlwcv3FJQ= 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=ZZ/JlCMe; arc=none smtp.client-ip=209.85.214.176 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-f176.google.com with SMTP id d9443c01a7336-1e65b29f703so23294895ad.3 for ; Tue, 16 Apr 2024 14:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713302107; x=1713906907; 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=pTzXQk5cYMYr3uWvC+W6FdkM1s551/ydGHaU1dE8ImE=; b=ZZ/JlCMeiqH/9W/WxQMdFT6WE7uexc2+m+Opj9KK+8IY3STgarhOcL2di4BJ4jLH6j V04+KdJDJSAfg0EJ7mKr2iLQcUUDtzr8BMXVt9nt3vZc/Im9GJOv3K+ln4hlEPUyTmxw EhwWJC/GRrsqi21wRLpEmlcaLA8hu1xINa0aw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713302107; x=1713906907; 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=pTzXQk5cYMYr3uWvC+W6FdkM1s551/ydGHaU1dE8ImE=; b=hYmBZFQYvxlaPFGyiU1QEhJnHgtEqT7YlyeXl5E9mdqftN0teZqC+bnhWN8HwqsG0P KRXLZNcr5NTPYKbBuhNjVl9nxUZkVYxbQ5PidxsXFzvi+4hPQ2D/aFp/KbCBxhYyJhNt F7yK6xf/y2GIVDSrbRNv9Hlodp9nV+vuImI6bbPo8+0RK5598mbxugjPKDoyHneoNlFZ HJcZM2wDUfhsAWxrAV+/eOqoNOWUMTViYYCqeCgc1S/1ZbL7yCc+4pwZ2cQ5nD95A8iz pS5p+VjCeXPmsPYqyDIw1Oa8X75UnshWtxpN7IHUxHIF3KO0IFVdUWtLIkNPT4uViwKT 8wjg== X-Forwarded-Encrypted: i=1; AJvYcCVoKlEpf7x1I6jNbVK7iSYfl6N/V+X/ILUuE7ARa3WDAi2HPxnfGFRqhGS9Rn8tGObtRhyk28XGwMbsEvUxzpPT2crhOJYh6NXbY4jL X-Gm-Message-State: AOJu0YwItLSWPB7nFTkJ25/W0MubeynC9vJjK2GseiGGjKIJ1muRM7me ojZlj5HO9QGOchX6IW9/AbkwrIBWEQwVE3yaSh+NUcXlMJ36wTBvp6Jd37BzxQ== X-Received: by 2002:a17:902:ee4d:b0:1e4:ccf6:209f with SMTP id 13-20020a170902ee4d00b001e4ccf6209fmr11655360plo.28.1713302106842; Tue, 16 Apr 2024 14:15:06 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id ju17-20020a170903429100b001e49428f313sm10239724plb.261.2024.04.16.14.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 14:15:05 -0700 (PDT) Date: Tue, 16 Apr 2024 14:15:04 -0700 From: Kees Cook To: "Matthew Wilcox (Oracle)" Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/19] Enable -Wshadow=local for kernel/sched Message-ID: <202404161413.8B4810C5@keescook> References: <20220302043451.2441320-1-willy@infradead.org> 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: <20220302043451.2441320-1-willy@infradead.org> *thread necromancy* On Wed, Mar 02, 2022 at 04:34:32AM +0000, Matthew Wilcox (Oracle) wrote: > I thought I'd choose one of the more core parts of the kernel to > demonstrate the value of -Wshadow. It found two places where there are > shadowed variables that are at least confusing. For all I know they're > buggy and my resolution of these warnings is wrong. > > The first 12 patches just untangle the unclean uses of __ret in wait.h > & friends. Then 4 patches to fix problems in headers that are noticed > by kernel/sched. Two patches fix the two places in kernel/sched/ > with shadowed variables and the final patch adds -Wshadow=local to > the Makefile. > > I'm quite certain this patch series isn't going in as-is. But maybe > it'll inspire some patches that can go in. I was looking at -Wshadow=local again, and remembered this series. It sounded like things were close, but a tweak was needed. What would be next to get this working? Thanks! -Kees -- Kees Cook