Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-6510

mdt_handle_idmap unsafe access to req->rq_export

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • None
    • 3
    • 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.

      Attachments

        Issue Links

          Activity

            [LU-6510] mdt_handle_idmap unsafe access to req->rq_export
            pjones Peter Jones added a comment -

            ok - thanks Sebastien

            pjones Peter Jones added a comment - ok - thanks Sebastien

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

            So this ticket can be closed.

            sbuisson Sebastien Buisson (Inactive) added a comment - File containing the faulty code has been removed by patch: https://review.whamcloud.com/19789 So this ticket can be closed.

            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

            gerrit Gerrit Updater added a comment - 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

            People

              wc-triage WC Triage
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: