[LU-6510] mdt_handle_idmap unsafe access to req->rq_export Created: 27/Apr/15  Updated: 07/Jun/17  Resolved: 30/May/17

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

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: easy, hackathon2017

Issue Links:
Duplicate
duplicates LU-6971 Remove obsolete remote client and "lf... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

smatch highlighted this unsafe usage:

int mdt_handle_idmap(struct tgt_session_info *tsi)
{
        struct ptlrpc_request   *req = tgt_ses_req(tsi);
        struct mdt_device       *mdt = mdt_exp2dev(req->rq_export);
        struct mdt_export_data *med;
        struct ptlrpc_user_desc *pud = req->rq_user_desc;
        struct md_identity *identity;
        __u32 opc;
        int rc = 0;
        ENTRY;

        if (!req->rq_export)
                RETURN(0);

Probably need to move the mdt variable assignment to after this check.



 Comments   
Comment by Gerrit Updater [ 15/Apr/16 ]

Parinay Kondekar (parinay.kondekar@seagate.com) uploaded a new patch: http://review.whamcloud.com/19601
Subject: LU-6510 mdt: mdt_handle_idmap unsafe access to req->rq_export
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 4237bc6dc978a5b3e33d160a334c37076269770c

Comment by Sebastien Buisson (Inactive) [ 30/May/17 ]

File containing the faulty code has been removed by patch:
https://review.whamcloud.com/19789

So this ticket can be closed.

Comment by Peter Jones [ 30/May/17 ]

ok - thanks Sebastien

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