From: Shaun Tancheff Date: Fri, 6 Sep 2024 16:34:10 +0000 (+0700) Subject: LU-18184 llog: llog_process() with struct llog_process_data X-Git-Tag: 2.16.51~112 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=db86ea7871676828f6cdbe913ee8641b4b61b661;p=fs%2Flustre-release.git LU-18184 llog: llog_process() with struct llog_process_data BUG: KASAN: global-out-of-bounds in \ llog_process_or_fork+0xd0e/0xd60 [obdclass] Calling llog_process 4th argument must be either NULL or struct llog_process_data Test-Parameters: trivial testlist=sanity env=ONLY="60a" Signed-off-by: Shaun Tancheff Change-Id: Iff4848365b5123df25d90811412a43307a115214 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56213 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Mikhail Pershin Reviewed-by: Oleg Drokin Reviewed-by: Etienne AUJAMES --- diff --git a/lustre/kunit/llog_test.c b/lustre/kunit/llog_test.c index 5603cfa..da7e3df 100644 --- a/lustre/kunit/llog_test.c +++ b/lustre/kunit/llog_test.c @@ -758,6 +758,7 @@ static int llog_test_5(const struct lu_env *env, struct obd_device *obd) int rc, rc2; struct llog_mini_rec lmr; struct llog_ctxt *ctxt; + struct llog_process_data data = { .lpd_data = "test 5" }; ENTRY; @@ -782,7 +783,7 @@ static int llog_test_5(const struct lu_env *env, struct obd_device *obd) CWARN("5b: print the catalog entries.. we expect 2\n"); cat_counter = 0; - rc = llog_process(env, llh, cat_print_cb, "test 5", NULL); + rc = llog_process(env, llh, cat_print_cb, &data, NULL); if (rc) { CERROR("5b: process with cat_print_cb failed: %d\n", rc); GOTO(out, rc); @@ -802,7 +803,7 @@ static int llog_test_5(const struct lu_env *env, struct obd_device *obd) CWARN("5c: print the catalog entries.. we expect 1\n"); cat_counter = 0; - rc = llog_process(env, llh, cat_print_cb, "test 5", NULL); + rc = llog_process(env, llh, cat_print_cb, &data, NULL); if (rc) { CERROR("5c: process with cat_print_cb failed: %d\n", rc); GOTO(out, rc); @@ -979,6 +980,7 @@ static int test_7_cancel_cb(const struct lu_env *env, struct llog_handle *llh, static int llog_test_7_sub(const struct lu_env *env, struct llog_ctxt *ctxt) { + struct llog_process_data data = { .lpd_data = "test 7" }; struct llog_handle *llh; int rc = 0, i, process_count; int num_recs = 0; @@ -1024,7 +1026,7 @@ static int llog_test_7_sub(const struct lu_env *env, struct llog_ctxt *ctxt) num_recs, LLOG_HDR_BITMAP_SIZE(llh->lgh_hdr) - 1); plain_counter = 0; - rc = llog_process(env, llh, test_7_print_cb, "test 7", NULL); + rc = llog_process(env, llh, test_7_print_cb, &data, NULL); if (rc) { CERROR("7_sub: llog process failed: %d\n", rc); GOTO(out_close, rc); @@ -1565,6 +1567,7 @@ static int llog_test_10(const struct lu_env *env, struct obd_device *obd) struct lu_attr la; __u64 cat_max_size; struct dt_device *dt; + struct llog_process_data data = { .lpd_data = "test 10" }; ENTRY; @@ -1725,7 +1728,7 @@ static int llog_test_10(const struct lu_env *env, struct obd_device *obd) CWARN("10d: print the catalog entries.. we expect 3\n"); cat_counter = 0; - rc = llog_process(env, cath, cat_print_cb, "test 10", NULL); + rc = llog_process(env, cath, cat_print_cb, &data, NULL); if (rc) { CERROR("10d: process with cat_print_cb failed: %d\n", rc); GOTO(out, rc);