Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp27157rdb; Wed, 14 Feb 2024 11:31:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7UeOUjuWPShdVoHymMFV2dKm7+T1IO7lJB+Ahn5NLopiNwL2XQD5CkhjBh4eIyb/XT+rbV6bVYQAXb7vh50HqWuqXSn+mrj8+mZf93w== X-Google-Smtp-Source: AGHT+IEpE1yQ6Gr/Dx/YVyeCbpwOCQuu4A9a8kFHJlhF40ZXePU0cRUs2MoTSYLz7qRAqqnM2jPy X-Received: by 2002:a05:6a00:d71:b0:6e0:84d4:e009 with SMTP id n49-20020a056a000d7100b006e084d4e009mr2968558pfv.21.1707939104662; Wed, 14 Feb 2024 11:31:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707939104; cv=pass; d=google.com; s=arc-20160816; b=JBbHLC9R1QCZm/txPjDyUhx30hRLESRRI7iLVf55ItHNLFlMXPDwTBf4KcffzQF1Mu fqw9llZvfEpXo8EgknFP73SzOy9eq3SpXmsWofaGbrsAsaYQcLDSr299B9iRNJGTFw1J cuRAA8jY+9/E+jBHt9llUEc8FXMZ4CtxXZ49aHMn2msOX77oeACExvlt8sgdFUAYgdC4 TKmVazCY646yIuQKUccc2IG3Hku4EDyo3ppYqfN4kK+y6Zg/bEuslCsMyTOuJ0tcvrfe 52HoWDUK+gliVjyEYImUctZhk962K7T+zkZDc9DWW9CQQD12j6eGZtyL2PQOiAYgq/w+ 80Xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent: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=WddP6Rm3FHbSkDJ/3e61+m5VRjT87hVk4bJfICjjttk=; fh=qUtDRynlodE5dzg9fdQEsuM+FiLTYE0qeLCE3Jk1N/0=; b=QIg83p9bsYgTxlRShcOqAXeVDS5bDJIPtaE/Gtyh7O0bzXpwOgyhFxCJhsZpnuCq/Y zSqQ7FyX8TNF9e4cqglXr3zWWr9Qg/lhFtPYXdM4b+CFFBoYYKEcUWiWYkERqGPWukn+ h7aDKdC5d7pY0sGHiA9APmFa/87VrzyC/GTB08VvBc1BR+6LMQwkaE9K06ykTHhc8zbj KPTmGMjWx+BbUvX2HGBP17+IZ6r4z3KRk8w7S56BZwgL4yawQJURh2kqSxyAVpasYupO NCyqG3mUCusZROV3PCyhVg0QMQvoDwiYhNMUrmMIcaIL8kqqYoKLFdbAo4yTsB1o8oJV Z7iQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gT6tqJcq; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-65872-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCWGnG6+SMgVWWJjXs8oHNZrLdwG+zWQusRZV/MOs8Vq6y0x5LyXoszDhIuu3UQGg3XI8D8tShxd1LeA4+bmXns4GjByJYjEZIe8kqCuIA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s21-20020a639255000000b005cfda2f9e48si4315225pgn.860.2024.02.14.11.31.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 11:31:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65872-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gT6tqJcq; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-65872-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1FF94290D9C for ; Wed, 14 Feb 2024 19:19:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8F1F13B28C; Wed, 14 Feb 2024 19:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gT6tqJcq" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 6792D13A87D for ; Wed, 14 Feb 2024 19:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707938373; cv=none; b=K6ktUYcw1FbLBNPVVzWXW973yaJiwMh2LQoCLVXEQG5LE1iskV42uDVPS8ydmpFhHUXBh5/bLqXunr8cg1lbaFZ1plS4RlLhJy7TO9vqNN1x7DIBl/1yFutvFT5BjkhX4F8eOcULBtoQ443iTXAx3NPzGyCNuim1gUhA30QWnAs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707938373; c=relaxed/simple; bh=WddP6Rm3FHbSkDJ/3e61+m5VRjT87hVk4bJfICjjttk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n7He37109uvhn4K5cgaQdTG7yeQkHemjz66qZOSJJrMt+zUbC4PJB/2+62vA8ss31YDmc+WNySDrjKjeZvKOVIqDEL0ExcUmGfJkNXNoQzhKnIG81I19ccTUKPwNsZnDWPc+rZpR3M3TsXCQ8ZnkOK0omOOvMV9gyEo1QgqoWrc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gT6tqJcq; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707938369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WddP6Rm3FHbSkDJ/3e61+m5VRjT87hVk4bJfICjjttk=; b=gT6tqJcqq5GOpoR4jPyFWhKYwdlkF4TVs99MdMYHmhCG7UQgt7d9WGEImgcGRGkoKlm43n FpDWk9/Oxu2D5aByaiQCmOl0j6Ca5KBIYQ225hL8OJyh2+5qjTkF8btAKzkYaMUYpBwcfo T/drJqHRnbts7ylDIqPbtmgdNMSOrrE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-110-TE08d_v-OtOUaL93Si5HLQ-1; Wed, 14 Feb 2024 14:19:25 -0500 X-MC-Unique: TE08d_v-OtOUaL93Si5HLQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E1B3C828CE3; Wed, 14 Feb 2024 19:19:23 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.126]) by smtp.corp.redhat.com (Postfix) with SMTP id 544DA8CED; Wed, 14 Feb 2024 19:19:18 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 14 Feb 2024 20:18:07 +0100 (CET) Date: Wed, 14 Feb 2024 20:18:01 +0100 From: Oleg Nesterov To: Tycho Andersen Cc: coverity-bot , Christian Brauner , 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: <20240214191801.GA27799@redhat.com> References: <202402131559.B76A34B@keescook> <20240214090332.GA14017@redhat.com> <20240214090640.GB14017@redhat.com> <20240214175555.GC16265@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=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 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. Oleg.