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 061EF1DE8A0; Thu, 17 Apr 2025 17:57:55 +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=1744912675; cv=none; b=GLFB4ENkYY2s5GDDm0VOe/K1c+1l8n5ax8mViOhOr8aHhONswdRrShWGsUvrbh9Vb2RM2/1qmrDnomMqEceMUIPe3KmSFmiq6ou0DTF/0kDCVJupp/gHYGGnlS1r9NbphPXm9S2oHwWmlWBvwewRwRT5Lvioz9uLWMXkou/FkyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744912675; c=relaxed/simple; bh=uwxDhWGp+HO9VY374icj3VsX2Jec0qICLQxD6Nfheoc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e2H0ShPIil+NhfwTbUYf+KeVbg20FN5eX0vol3bF3x4ChLvEwZk6q8ziijbIcvOE8Xg3LuqWbGF8UHEL0yQo4iNF7KlLHXoSGiNlNfzZhVoeWwVQ1ihO7PBwiXeVRuqPBadTRV1mg9M/ghLYNeScCd3uVTnNej4q+iOi/5Lmcqo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=z/gqmKGA; 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="z/gqmKGA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C151C4CEE4; Thu, 17 Apr 2025 17:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744912674; bh=uwxDhWGp+HO9VY374icj3VsX2Jec0qICLQxD6Nfheoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z/gqmKGAMuu4xOLzvDzbFdXf+eVhhnbZ7h06gtwEQh2sYvyRlswG3K4q0oBL8NZ4y tRcCo3989qOju41dIwNGr+2RK6ZaUf73W5vjnEynglG7dlcmSt3ablZSagNxDb7LGD pp+x9dmSBd1EDwR+/NGZw0JzhivLZB3U0DmuQ8jc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Hans Verkuil , Aakarsh Jain , Nicolas Dufresne , Marek Szyprowski , Sasha Levin Subject: [PATCH 6.14 087/449] media: s5p-mfc: Corrected NV12M/NV21M plane-sizes Date: Thu, 17 Apr 2025 19:46:15 +0200 Message-ID: <20250417175121.472204086@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250417175117.964400335@linuxfoundation.org> References: <20250417175117.964400335@linuxfoundation.org> User-Agent: quilt/0.68 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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aakarsh Jain [ Upstream commit 7d0d0b2342bebc47a46499cdf21257ed1e58c4aa ] There is a possibility of getting page fault if the overall buffer size is not aligned to 256bytes. Since MFC does read operation only and it won't corrupt the data values even if it reads the extra bytes. Corrected luma and chroma plane sizes for V4L2_PIX_FMT_NV12M and V4L2_PIX_FMT_NV21M pixel format. Suggested-by: Hans Verkuil Signed-off-by: Aakarsh Jain Reviewed-by: Nicolas Dufresne Acked-by: Marek Szyprowski Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index 73f7af674c01b..0c636090d723d 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -549,8 +549,9 @@ static void s5p_mfc_enc_calc_src_size_v6(struct s5p_mfc_ctx *ctx) case V4L2_PIX_FMT_NV21M: ctx->stride[0] = ALIGN(ctx->img_width, S5P_FIMV_NV12M_HALIGN_V6); ctx->stride[1] = ALIGN(ctx->img_width, S5P_FIMV_NV12M_HALIGN_V6); - ctx->luma_size = ctx->stride[0] * ALIGN(ctx->img_height, 16); - ctx->chroma_size = ctx->stride[0] * ALIGN(ctx->img_height / 2, 16); + ctx->luma_size = ALIGN(ctx->stride[0] * ALIGN(ctx->img_height, 16), 256); + ctx->chroma_size = ALIGN(ctx->stride[0] * ALIGN(ctx->img_height / 2, 16), + 256); break; case V4L2_PIX_FMT_YUV420M: case V4L2_PIX_FMT_YVU420M: -- 2.39.5