From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CPrTM/h+" 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-next@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().