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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • Lustre 2.9.0
    • 3
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: