[LU-6521] Unitialized variable access in ll_layout_fetch Created: 27/Apr/15  Updated: 27/Apr/15

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

smatch highlighted this piece in ll_layout_fetch():

        struct ptlrpc_request *req;
...
        rc = ll_get_default_mdsize(sbi, &lmmsize);
        if (rc == 0)
                rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), oc,
                                OBD_MD_FLXATTR, XATTR_NAME_LOV, NULL, 0,
                                lmmsize, 0, &req);
        capa_put(oc);
        if (rc < 0)
                RETURN(rc);

        body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);

So if ll_get_default_mdsize returns a value bigger than 0, we access uninitialized req variable


Generated at Sat Feb 10 02:00:56 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.