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

llapi_obd_statfs() tests errno in non error cases, may leak file descriptors

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Lustre 2.9.0
    • Fix Version/s: Lustre 2.9.0
    • Labels:
    • Severity:
      3
    • Rank (Obsolete):
      9223372036854775807

      Description

      In llapi_obd_statfs() we have:

              fd = open(path, O_RDONLY);
              if (errno == EISDIR)
                      fd = open(path, O_DIRECTORY | O_RDONLY);
      

      Second, if open() succeeds then the value of errno is arbitrary and the file descriptor may be leaked if errno was previously set to EISDIR.

      Also note that open() will never set errno to EISDIR when write access is not requested.

        Attachments

          Activity

            People

            • Assignee:
              wc-triage WC Triage
              Reporter:
              jhammond John Hammond
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: