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

lnetctl import segfault on junk input

    XMLWordPrintable

Details

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

    Description

      cassini-hosta:/home/hornc/lustre-wc-rel/lustre/tests # cat t.yaml
      show:
      -     net:
      cassini-hosta:/home/hornc/lustre-wc-rel/lustre/tests # lnetctl import t.yaml
      Segmentation fault (core dumped)
      cassini-hosta:/home/hornc/lustre-wc-rel/lustre/tests #
      

      It is trying to interpret "show" as a global parameter:

      static int jt_import(int argc, char **argv)
      {
      ...
              const char *msg = NULL;
      ...
                      } else if (op == LNET_CMD_UNSPEC) {
                              struct cYAML *err_rc = NULL;
                              long int value;
                              char *key;
      
                              key = strdup((char *)event.data.scalar.value);
                              rc = yaml_parser_parse(&setup, &event);
                              if (rc == 0)
                                      goto free_reply;
                              rc = parse_long((char *)event.data.scalar.value,
                                              &value);
                              if (rc != 0)
                                      goto free_reply;
      ...
      free_reply:
              if (rc == 0) {
                      yaml_lnet_print_error(flags, "import", msg);
                      rc = -EINVAL;
              }
      

      And it is hitting segfault in the call to parse_long(). Another issue is that "msg" will be NULL for both of those goto's, and this will result in another segfault in yaml_lnet_print_error()

      Attachments

        Issue Links

          Activity

            People

              hornc Chris Horn
              hornc Chris Horn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: