autofs: crash with SIGSEGV on try_remount using hierarchical map entries after service reload

Solution Verified - Updated -

Issue

  • autofs crashes on reload (systemctl reload autofs) if hierarchical map entries are used, can be reproduced, using:

    # grep -v ^# /etc/auto.direct
    /required \
    / localhost:/playground2 \
    /sub1 localhost:/playground3 \
    /sub2 localhost:/playground4
    
  • Trigger the mount :

    # grep requi /proc/mounts
    /etc/auto.direct /required autofs rw,relatime,fd=13,pgrp=33021,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=10600557 0 0
    
    # find /required &> /dev/null
    
    # grep requi /proc/mounts
    /etc/auto.direct /required autofs rw,relatime,fd=13,pgrp=33021,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=10600557 0 0
    /dev/mapper/rhel-root /required xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 0
    /etc/auto.direct /required/sub1 autofs rw,relatime,fd=13,pgrp=33021,timeout=300,minproto=5,maxproto=5,offset,pipe_ino=10600557 0 0
    /etc/auto.direct /required/sub2 autofs rw,relatime,fd=13,pgrp=33021,timeout=300,minproto=5,maxproto=5,offset,pipe_ino=10600557 0 0
    /dev/mapper/rhel-root /required/sub1 xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 0
    /dev/mapper/rhel-root /required/sub2 xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 0
    
  • Now, edit /etc/auto.direct to remove one of the entries and reload the map:

    # vi /etc/auto.direct
    
    # grep -v ^# /etc/auto.direct
    /required \
    / localhost:/playground2 \
    /sub2 localhost:/playground4
    
  • Reload :

    # systemctl reload autofs
    
    # systemctl status autofs
    ● autofs.service - Automounts filesystems on demand
    Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled; vendor preset: disabled)
    Active: failed (Result: signal) since Fri 2023-12-01 14:10:20 CET; 4s ago
    Process: 33082 ExecReload=/usr/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
    Process: 33021 ExecStart=/usr/sbin/automount $OPTIONS --systemd-service --dont-check-daemon (code=killed, signal=SEGV)
    Main PID: 33021 (code=killed, signal=SEGV)
    

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • autofs

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content