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

llite:Opening an existing file can easily lead to security context memory leaks

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Critical
    • None
    • Lustre 2.15.6
    • Lustre server 2.15.6 RoCE
      Lustre MGS 2.15.6 RoCE
      Lustre client 2.15.6 RoCE
    • 3
    • 9223372036854775807

    Description

       Lustre server are deployed within the VM, The VM uses the network card PF pass-through mode.

      【Lustre Server OS】
      VM Version: qemu-kvm-7.0.0
      OS Verion: openEuler2203sp4
      Kernel Verion: 5.10.0-216.0.0.115.oe2203sp4.x86_64

      【Lustre Client OS】

      OS Version:CCLinux OS

      Kernel Verion: 5.15.131-17.cl9.x86_64

      【Network Card】
      Client:
      MLX CX6 1*100G RoCE v2
      MLNX_OFED_LINUX-23.10-2.1.3.1-rhel9.2-x86_64

      Server:
      MLX CX6 2*100G RoCE v2 ** 
      MLNX_OFED_LINUX-23.10-3.2.2.0-rhel8.10-x86_64

       

      【BUG Info】

      Here is the following reproducer:

      • Mount lustre on a RoCE network. Mount point is /mnt/lustre
      • write a simple open test。

       

      /*
       * simple_open_test.c
       */
      #include <stdio.h>
      #include <fcntl.h>
      #include <unistd.h>int main(int argc, char *argv[])
      {
          int fd;
          if (argc < 2) {
              printf("Usage: %s <filepath>\n", argv[0]);
              return 1;
          }
        
          fd = open(argv[1], O_CREAT | O_WRONLY, 0644);
          if (fd < 0) {
              perror("open failed");
              return 1;
          }
          
          printf("Opened: %s (fd=%d)\n", argv[1], fd);
          close(fd);
          return 0;
      }

               Compile: gcc -o simple_open simple_open_test.c 

               Test Command:

                   Client:for i in {1..10000000}; do     echo 3 > /proc/sys/vm/drop_caches     ./simple_open /mnt/lustre/file1.txt >/dev/null 2>&1 done 

      • Use slabtop to observe the growth of kmalloc-32 and kmalloc-64

       

      【Problem manifestation】

      If you use high concurrency for stress testing, the memory will be completely consumed.You can observe through slabtop that kmalloc-32 or kmalloc-64 keeps growing.

      Attachments

        1. code.png
          code.png
          676 kB
        2. code-1.png
          code-1.png
          344 kB
        3. free.png
          11 kB
        4. slabtop.png
          78 kB

        Activity

          People

            zhangsiyao Siyao Zhang
            zhangsiyao Siyao Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: