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

lprocfs_alloc_stats() Segmentation fault (core dumped)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • Lustre 2.8.0
    • lustre 2.8.0 centos7 kernel-3.10.0_3.10.0_327.3.1.el7_lustre.x86_64-1.x86_64

    Description

      In lustre/obdclass/lprocfs_status.c ,and in the function "lprocfs_alloc_stats",
      when alloc percpu pointers for all possible cpu slots,the corresponding code:
      LIBCFS_ALLOC(stats, offsetof(typeof(*stats), ls_percpu[num_entry]));
      In fact ,this code didn't alloc space for its member struct lprocfs_counter lp_cntr[0],
      but in other operations like funcion:
      lprocfs_counter_init which call lprocfs_stats_counter_get
      the code in fuction lprocfs_stats_counter_get such as
      stats->ls_percpu[cpuid]->lp_cntr[index]
      may access memory that not belong to var stats itself,
      it's not safe and may lead to Segmentation fault.especially when there is not enough memory.

      Attachments

        Activity

          People

            laisiyao Lai Siyao
            邓仕军 ShijunDeng (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: