[LU-15013] potential null pointer access in osc_prep_async_page Created: 17/Sep/21  Updated: 10/Oct/21  Resolved: 10/Oct/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.0
Fix Version/s: Lustre 2.15.0

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: James A Simmons
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Introduced by https://review.whamcloud.com/44338

 

        while (--max_scans > 0 &&
               (cli = list_first_entry_or_null(&cache->ccc_lru,
                                               struct client_obd,
                                               cl_lru_osc)) != NULL) {
...
                }
        }
        spin_unlock(&cache->ccc_lru_lock);out:
        cl_env_put(env, &refcheck);
        CDEBUG(D_CACHE, "%s: cli %p freed %ld pages.\n",
                cli_name(cli), cli, rc); 

So now once that cli is NULL we exit and cli_name dereference will get us if +cache is in the debug flags.



 Comments   
Comment by Peter Jones [ 17/Sep/21 ]

James

Can this be fixed in place quickly or should we revert the change?

Peter

Comment by James A Simmons [ 17/Sep/21 ]

Oh I can do a quick fix.

Comment by Gerrit Updater [ 17/Sep/21 ]

"James Simmons <jsimmons@infradead.org>" uploaded a new patch: https://review.whamcloud.com/44966
Subject: LU-15013 osc: use original cli for osc_lru_reclaim for debug msg
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 3f7f4b722b4bbcaa4f0fdf5bd1fbc58f00a0604d

Comment by Gerrit Updater [ 10/Oct/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/44966/
Subject: LU-15013 osc: use original cli for osc_lru_reclaim for debug msg
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3c6a1e94c652685fac7c69bf530e05d27b7f477c

Generated at Sat Feb 10 03:14:42 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.