Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1069051rdb; Fri, 16 Feb 2024 04:39:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCURIuvzMBOkACRp3eE9qHLYEbqZuVjUtrBYyJ4BX8shO+qaDKhw/Iv1c3NRDBu2wgTYO7Haq25OqaqT7ZPkkBeAWv2C5Vvl3TXft7q1Vw== X-Google-Smtp-Source: AGHT+IGb8qEOKQ1g+XkEyarQt/lOKroXpJTMR/2MgEN1t24KTsYxm0ZO6dvblTqkYb0ez23GzqRZ X-Received: by 2002:a05:6358:5914:b0:178:640b:38d1 with SMTP id g20-20020a056358591400b00178640b38d1mr4775421rwf.22.1708087166977; Fri, 16 Feb 2024 04:39:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708087166; cv=pass; d=google.com; s=arc-20160816; b=kq7KwxyikAbMo56b2XnXssd0X1iWuLWPYnyit3pkmEsX8N3H2selcAUMglr5h2y2W2 aln4FrShf66YNZM9FNA2oJr954rXQQo8sdqr9tKCv3yQlJKPbnZM+CXZ47+5SIBFlYx0 addALRRBLq28T6PwVaahLnLOKQqxNXLMRAe0LT/As1lEtZEoLFQMqbWi5pLkISJUc2fn kqBm3QkF91Za6iAezb+0pJ6UmeEraYa8KUh//FB0he35eTSNHO2Gi/35MWml0cgG7WNK LmcKkF/E9JRsVCUp/DfLj+p3G69ytoOIdOotYSaYnVVATs8KQlU0s4go/xzlDv+7NZEF doSA== 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=MPtXt2SurdtwjJH/38lbpGNFcO8za9cqJSwJP9kl4XY=; fh=IYQtm2WfVYCRntjLQ9vaPJK4Yz7DCjR0KGEHw1nu0yI=; b=FtHOlUcJF0RouFWQkL/4VYUpTKTyVRm1ocoEKbXbW1r9Q1Fx+ExMBhrG2GHJlixt3D MzfZGj/QE8b8RIcd2Mgmy6+t1Niaz8cAU5+aqVNGZ3zdmZSqkuYk0CtCYr+hyRAYfRwr v48jcxMY7bP6jGTBhsvEjmIbeEZJmPdFSBfyTcOINVvuFxddwF4CE5G4W/PDQgDE0G9g S5oyPhd4kv5ZocG29ksVZX6gSacXJDB7klYyUnHl9hIUBzRKLZFjlBX3pF+RDm5esUFo ZKFEgcPs2ZFsGG8qdYxV81jvx7Llv3C262oNZdGVsyJQKO/raQRYKvTF4L8v2Yyq/gEz ytzw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="CPrTM/h+"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68585-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s7-20020a056a00178700b006e07f2dfe72si3065182pfg.263.2024.02.16.04.39.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:39:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68585-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="CPrTM/h+"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68585-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 10494B24330 for ; Fri, 16 Feb 2024 12:38:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F307A126F20; Fri, 16 Feb 2024 12:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CPrTM/h+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 205CB2E641; Fri, 16 Feb 2024 12:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708087079; cv=none; b=kGph4YGgJxQKSAvdYvDI2xoSF0hcPH7lGKGCbtXFO4xHc5eXUcJBRyA8RyMQHXsIdZ+kTrIsGLdafAkVbseT1MMV0Ax20KVcZV43eV7vFlM1ltdU4IJ1vhK1R5WFREgNKTB4/ClHIiSRAlMHS9GLpu4MRtUYE1RyNP/Jb/aRwSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708087079; c=relaxed/simple; bh=z1sBY58BDg/3llEaa4HysrUIoaHtRN+Da+kU9maVq48=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VmlPG4RDObaPlet77EoU+Sw1ZQI4OAjm0FpFg0YFZMd8RbpUGvBBU6omrrpefNvyykHhcCeAelKXm/OCfGAMnpdUmEEaoRhJQbb2QqqYbPM9ELfXBiZn/Xdo+MUGxYoCz51+/HieSOxYEktoVEzC4EYkg2e1GXSWPmovuTW9V1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CPrTM/h+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3AACC433F1; Fri, 16 Feb 2024 12:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708087079; bh=z1sBY58BDg/3llEaa4HysrUIoaHtRN+Da+kU9maVq48=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CPrTM/h+yr8xHtfln0FuJIAOEyKLdIc8Pf6BJzUa7cQooTPgF0aJEFzC6XSjxVPlb mHuQmcq0xfvHyR+XEEaYrxlfzssxTD7a/ZKH4l5E2+EHGe85jItdgc6JDGqzuifSCG D8bcspXsoxuyXEK3qqs7/nIEe0i85QGO/T1bqDBp/58WujNP45Wi5/dD+xs0N2HGuR pOTEqfa6kwSB3VUQfTxDcPw5IOAaNY3eQ7wGndWUEaXiulaZdWgoRqGNfjVDBNk9hf Dq2zMJMXEsungzU2tUGcyzxRDD7WSVfSQcgmxQ7eS+vOsOZgcUm3UDEDVf0hZSLRp7 8X22tPYqaK9Cw== Date: Fri, 16 Feb 2024 13:37:49 +0100 From: Christian Brauner To: Oleg Nesterov Cc: Tycho Andersen , coverity-bot , Nicholas Piggin , Sebastian Andrzej Siewior , Peng Zhang , Ard Biesheuvel , Luis Chamberlain , Heiko Carstens , Andrew Morton , Suren Baghdasaryan , Thomas Gleixner , Mateusz Guzik , Dmitry Vyukov , Tycho Andersen , Mike Christie , "Paul E. McKenney" , linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: Coverity: __do_sys_pidfd_send_signal(): UNINIT Message-ID: <20240216-polster-stopfen-7fafe753180f@brauner> References: <202402131559.B76A34B@keescook> <20240214090332.GA14017@redhat.com> <20240214090640.GB14017@redhat.com> <20240214175555.GC16265@redhat.com> <20240214191801.GA27799@redhat.com> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240214191801.GA27799@redhat.com> On Wed, Feb 14, 2024 at 08:18:01PM +0100, Oleg Nesterov wrote: > On 02/14, Tycho Andersen wrote: > > > > On Wed, Feb 14, 2024 at 06:55:55PM +0100, Oleg Nesterov wrote: > > > > > > We want to check the "flags" argument at the start, we do not want to > > > delay the "case 0:" check until we have f.file (so that we can check > > > f.file->f_flags). > > > > Fair point. I was thinking delaying it would make it simpler, but then > > you have to free the file and it's less fast in the EINVAL case. > > plus we do not want to return, say, -EBADF if the "flags" argument is wrong. > > > I also don't have a strong opinion here. > > Neither me. Or you know, we just don't care about this. ;) In any case since tis is a false positive it's not urgent in any way. If either of you cares enough about this then please just send me patch that reorders the checks to please that tool. The specific way doesn't matter to me as well as long as we don't pointlessly fdget()/fdput().