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

Potential buffer overrun in jt_opt_threads()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.13.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      smatch highlighted:

              if (verbose != 0) {
                      snprintf(cmdstr, sizeof(cmdstr), "%s", argv[4]);
                      for (i = 5; i < argc; i++)
                              snprintf(cmdstr + strlen(cmdstr), sizeof(cmdstr),
                                       " %s", argv[i]);
      
                      printf("%s: starting %ld threads on device %s running %s\n",
                             argv[0], threads, argv[3], cmdstr);
              }
      

      Note how the other sprints inside of the for loop advances the cmdstr pointer, but dos not adjust the size of the string.
      Really need to do sizeof(cmdstr) - strlen(cmdstr) there.

      Attachments

        Activity

          People

            green Oleg Drokin
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: