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 E52D525290F; Wed, 5 Mar 2025 18:39:11 +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=1741199952; cv=none; b=inAQwom+2IwJaF/uJmPaaY8yEITG1hZsDJvAtQNxJPH94ml1MLtfGbw6fIsFrcfsquv7x/3njnjQW9/zHTxwT2roQAABYSdeUsLm9cRdCRS0nM1I/kNNCShGYDvzETXvvf7XQvvE2w9h4fUOaarcaHxLISyQpV1rszB8nthI3YE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741199952; c=relaxed/simple; bh=grH0RhVhc4eOiVhfXSf0JaS0A7IAc62nPyeEwfK6Y14=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mwzfa4fiXdu2kZCdseykZtYvUzAO3VZ+MPmhxOLLRi9QqeNm4Y5YtxzXLLtxgaN//RaLkMdvNPjwk+bVB3gfECKZX/u9UC4le7kfj1amB7rziOBn6UjiUGo3Y1XVGGww8VQyrlVLRgGrD4jIq18fQMgiyZZ0jgNdN2wfqfesBaM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YvkVF1Gc; 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="YvkVF1Gc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8445C4CEE8; Wed, 5 Mar 2025 18:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741199951; bh=grH0RhVhc4eOiVhfXSf0JaS0A7IAc62nPyeEwfK6Y14=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YvkVF1Gcn2xVAVy+dRci1AFs7Pm6G4S1szXVBwYXnjhyGT2Juz2KDr8bYgShpw3Ly agEK3dIgTD0yz7JmGk7a9T6cUmEFNJ5uR8frxcz4wnbUieh69sZWNfH/D4CES2blbO eT/qXta75KJdQK0DdYYFhnlRYrxufD8YmMvXGY3ve4dmyojglcjX6CMzqaHUB2UV5t ZV1nuLAIV79V4oxlqQwuhXyYQqG66SDbuCx/frW93wAz3mHqY5PtgC9m7qBXN3/gJT UuLbnrl0RlV2BwcR86FMxUbnnqNQhk1KVK1SZ6eu+d7RSI1sDWgEElffrS3XFNQJX6 Eb03ecfRs8v7g== Date: Wed, 5 Mar 2025 11:39:08 -0700 From: Keith Busch To: Dan Carpenter Cc: Caleb Sander Mateos , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v2] nvme-tcp: fix signedness bug in nvme_tcp_init_connection() Message-ID: References: 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 Wed, Mar 05, 2025 at 06:52:59PM +0300, Dan Carpenter wrote: > The kernel_recvmsg() function returns an int which could be either > negative error codes or the number of bytes received. The problem is > that the condition: > > if (ret < sizeof(*icresp)) { > > is type promoted to type unsigned long and negative values are treated > as high positive values which is success, when they should be treated as > failure. Handle invalid positive returns separately from negative > error codes to avoid this problem. Thanks, applied to nvme-6.14. I had v1 applied previously, and it was the top commit in that tree; force pushed this version to replace it.