Bug 1977722

Summary: radiusd in RHEL9 cannot coredump.
Product: Red Hat Enterprise Linux 9 Reporter: Filip Dvorak <fdvorak>
Component: freeradiusAssignee: Antonio Torres <antorres>
Status: CLOSED CURRENTRELEASE QA Contact: Filip Dvorak <fdvorak>
Severity: high Docs Contact:
Priority: high    
Version: 9.0CC: antorres, fdvorak, kyoneyam, nikolai.kondrashov
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: freeradius-3.0.21-15.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1977572 Environment:
Last Closed: 2021-12-07 21:24:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1977572    
Bug Blocks:    

Description Filip Dvorak 2021-06-30 11:02:30 UTC
+++ This bug was initially created as a clone of Bug #1977572 +++

Description of problem:

radiusd in RHEL8 canno coredump.


I allowed radiusd coredump in radiusd.conf.

  -- /etc/raddb/radiusd.conf --
        allow_core_dumps = yes

In the systemd configuration, the core rlimit is unlimited.

  -- /etc/systemd/system.conf --
  DefaultLimitCORE=infinity

However, when I checked the rlimit of the process, it was 0 for both soft and hard.

  # systemctl status radiusd
  ● radiusd.service - FreeRADIUS high performance RADIUS server.
     Loaded: loaded (/usr/lib/systemd/system/radiusd.service; enabled; vendor preset: disabled)
     Active: active (running) since Wed 2021-06-30 14:30:21 JST; 4s ago
    Process: 20827 ExecStart=/usr/sbin/radiusd -d /etc/raddb (code=exited, status=0/SUCCESS)
    Process: 20822 ExecStartPre=/usr/sbin/radiusd -C (code=exited, status=0/SUCCESS)
    Process: 20814 ExecStartPre=/bin/sh /etc/raddb/certs/bootstrap (code=exited, status=0/SUCCESS)
    Process: 20813 ExecStartPre=/bin/chown -R radiusd.radiusd /var/run/radiusd (code=exited, status=0/SUCCESS)
   Main PID: 20829 (radiusd)
      Tasks: 6 (limit: 7974)
  ...

  # prlimit -c -p 20829
  RESOURCE DESCRIPTION        SOFT HARD UNITS
  CORE     max core file size    0    0 bytes



Testing to send SIGSEGV to a process did not coredump.

  # kill -11 20829

  # coredumpctl info 20829
             PID: 20829 (radiusd)
             UID: 95 (radiusd)
             GID: 95 (radiusd)
          Signal: 11 (SEGV)
       Timestamp: Wed 2021-06-30 14:31:32 JST (7s ago)
    Command Line: /usr/sbin/radiusd -d /etc/raddb
      Executable: /usr/sbin/radiusd
   Control Group: /system.slice/radiusd.service
            Unit: radiusd.service
           Slice: system.slice
         Boot ID: ee16e7f9d82940d5a402aaab82380bfc
      Machine ID: 0618d47a97964a6e88fedc399ebd3b46
        Hostname: rhel84-minimal2
         Storage: none
         Message: Process 20829 (radiusd) of user 95 dumped core.


I checked it in debug mode, and it throws the following error:

  # radiusd -X
  FreeRADIUS Version 3.0.20
  Copyright (C) 1999-2019 The FreeRADIUS server project and contributors
  ..snip..
  main {
   security {
          user = "radiusd"
          group = "radiusd"
          allow_core_dumps = yes
   }
          name = "radiusd"
          prefix = "/usr"
          localstatedir = "/var"
          logdir = "/var/log/radius"
          run_dir = "/var/run/radiusd"
  }
  Cannot update core dump limit: Operation not permitted
  Core dumps are enabled
  ..snip..


Version-Release number of selected component (if applicable):

- Red Hat Enterprise Linux 8
- freeradius-3.0.20-3.module+el8.3.0+7597+67902674


How reproducible:

- Always

Steps to Reproduce:

1. Edit the following line in /etc/raddb/radiusd.conf

  -- /etc/raddb/radiusd.conf --
        allow_core_dumps = yes

2. Start radiusd service

  # systemctl start radiusd
  
3. Check rlimits with prlimit

  # prlimit -c -p <radiusd's pid>


Actual results:

- radiusd cannot coredump.

Expected results:

- radiusd can coredump.


Additional info:

- radiusd cannot coredump in RHEL8 GA(freeradius-3.0.17-3.module+el8+2746+2e560403)
   through the latest RHEL8.3(freeradius-3.0.20-3.module+el8.3.0+7597+67902674).