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 7324B2E093A; Mon, 20 Apr 2026 15:52:36 +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=1776700356; cv=none; b=b+EBa9vjXNyNjfa+2eDklxhbqTep8P1Df7rSa4r5FicRQ2A52W2rWO6kF3F6XuVkA9UW22cwoBe3nYnfU2VXeRPfO2XtV7u2DHP4P53ShcE70Dpz6UQwqPOC3ux9Jz6KiA7r30f/q+bakHgJhuYrH9YTQ3F1488oQDI1LTZBa10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776700356; c=relaxed/simple; bh=wYmkqLFVQx/SjVsrpEaQPKzw35b+jBVo6Z9AzGOeR3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DVLgwMBqDe6XP8zkC9eNOk8RcGzQMOuT/oCElqBMPpCMTXqubkaRorEo5Ea1YpKoMiadVU2akJAiw1SEnaagi+a4XqI8f7qw9gIVKRU4vIDZyjqJmLdo6g+RNQTuzhZ9x7Bgy7VLkJX6PkRd77cVeijOUxvLSe/nXv/kmswGVBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qhuZszYT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qhuZszYT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C015BC19425; Mon, 20 Apr 2026 15:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776700356; bh=wYmkqLFVQx/SjVsrpEaQPKzw35b+jBVo6Z9AzGOeR3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qhuZszYTHEgmjoVssktNysB+jFQMFEvK+BOVGl0HVrcp7SEZS2DmHNxNMA6BwE84a bLUVn+0psi+TKnRWurdbO7ux/DTzVDzYD4Em3IZGODccvGH5GhKJfag+pIxGHhlL9p EImkyjmvnt2yV51swVjhuwjPJRTQihtrJq5nVNDI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+aa11561819dc42ebbc7c@syzkaller.appspotmail.com, Daniel Pouzzner , Herbert Xu , Sasha Levin Subject: [PATCH 6.19 139/220] crypto: algif_aead - Fix minimum RX size check for decryption Date: Mon, 20 Apr 2026 17:41:20 +0200 Message-ID: <20260420153939.029120163@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260420153934.013228280@linuxfoundation.org> References: <20260420153934.013228280@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Herbert Xu [ Upstream commit 3d14bd48e3a77091cbce637a12c2ae31b4a1687c ] The check for the minimum receive buffer size did not take the tag size into account during decryption. Fix this by adding the required extra length. Reported-by: syzbot+aa11561819dc42ebbc7c@syzkaller.appspotmail.com Reported-by: Daniel Pouzzner Fixes: d887c52d6ae4 ("crypto: algif_aead - overhaul memory management") Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/algif_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c index dda15bb05e892..f8bd45f7dc839 100644 --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c @@ -144,7 +144,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg, if (usedpages < outlen) { size_t less = outlen - usedpages; - if (used < less) { + if (used < less + (ctx->enc ? 0 : as)) { err = -EINVAL; goto free; } -- 2.53.0