From 421b8fb4e95938cdd4221954ef86a26c6bb436cb Mon Sep 17 00:00:00 2001 From: Andriy Skulysh Date: Fri, 3 Jun 2022 15:28:14 +0300 Subject: [PATCH] LU-16333 osc: page fault in osc_release_bounce_pages() pga[i] can be uninitialized. It happens after following code path in osc_build_rpc(): OBD_SLAB_ALLOC_PTR_GFP(oa, osc_obdo_kmem, GFP_NOFS); if (oa == NULL) GOTO(out, rc = -ENOMEM); Fixes: a9ed5b149646 ("LU-12275 sec: encryption for write path") HPE-bug-id: LUS-10991 Signed-off-by: Andriy Skulysh Reviewed-by: Alexander Zarochentsev Reviewed-by: Alexander Boyko Change-Id: I7e21cb9ab69f0bce9c1bdb53a4b0ac7a673887cc Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49210 Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Reviewed-by: Alexander Boyko Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/osc/osc_request.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 56e8b7d..08a286d 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1461,6 +1461,9 @@ static inline void osc_release_bounce_pages(struct brw_page **pga, struct page **pa = NULL; int i, j = 0; + if (!pga[0]) + return; + #ifdef CONFIG_LL_ENCRYPTION if (PageChecked(pga[0]->pg)) { OBD_ALLOC_PTR_ARRAY_LARGE(pa, page_count); -- 1.8.3.1