Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-92267

Echoing certain strings in bash unexpectedly generates negative dentries

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Critical Critical
    • rhel-8.10.z
    • rhel-8.10.z
    • bash
    • None
    • bash-4.4.20-6.el8_10
    • No
    • Low
    • 1
    • rhel-plumbers
    • ssg_core_services
    • 5
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Plumbers Sprint 1
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      Running this script in RHEL8.10.z's bash:

      #!/bin/bash
      CMD_STRING='"'[kworker/3:0]'"'
      date >> /root/dentry.txt
      cat /proc/sys/fs/dentry-state  >> /root/dentry.txt
      for j in {1..50}
      do
          for i in {1..1000000}
          do
              echo $i'|'$j"|"$CMD_STRING
          done
      date >> /root/dentry.txt
      cat /proc/sys/fs/dentry-state  >> /root/dentry.txt
      done
      date >> /root/dentry.txt
      cat /proc/sys/fs/dentry-state  >> /root/dentry.txt

      causes a dramatic increase in the number of negative entries in the dentry cache, due to spurious stat() calls seen when stracing the script:

      stat("1|1|\"[kworker/", 0x7ffe5ce5d900) = -1 ENOENT 

      This seems to have been addressed by an upstream bash commit in bash 5.1:

      commit 4d2e315490b778707b3a3afdfc514d5083a97a11 (HEAD)
      Author: Chet Ramey <chet.ramey@case.edu>
      Date:   Fri Jan 18 15:12:37 2019 -0500
          Bash-5.0 patch 1: fix pathname expansion of directory names containing backslashes
      

      A customer case indicates that the Splunk tool may be generating many thousands of echos of this type and driving the negative dentry cache to sizes which cause system instability, so this may be worth addressing in 8.10.z.

              rhn-support-svashish Siteshwar Vashisht
              esandeen@redhat.com Eric Sandeen
              Siteshwar Vashisht Siteshwar Vashisht
              Karel Volný Karel Volný
              Votes:
              0 Vote for this issue
              Watchers:
              15 Start watching this issue

                Created:
                Updated:
                Resolved: