#1142050 libproc-processtable-perl: bad handling of EACCES on stat of /proc/$PROC and read of /proc/$PROC/stat

Package:
libproc-processtable-perl
Source:
libproc-processtable-perl
Description:
Perl library for accessing process table information
Submitter:
Russell Coker
Date:
2026-07-15 04:51:02 UTC
Severity:
normal
#1142050#5
Date:
2026-07-14 12:22:35 UTC
From:
To:
Ran into unknown state (hex char: 0) at ./test.pl line 8.

When I run the below program as user_t on a SE Linux system (or as an
unprivileged user on any other access contro system that denies access to
some directories under /proc but doesn't hide them) I get errors like the
above.

#!/usr/bin/perl
use strict;

use Proc::ProcessTable;

my $process_table = new Proc::ProcessTable('cache_ttys' => 0 );

foreach my $process ( @{$process_table->table} )
{
  print $process->fname . "\n";
}

Here is the relevant part of strace output:

newfstatat(AT_FDCWD, "/proc/2", 0x7fff19533c10, 0) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/proc/2/stat", O_RDONLY) = -1 EACCES (Permission denied)
access("/proc/2", F_OK)                 = 0
write(2, "Ran into unknown state (hex char: 0) at /tmp/test.pl line 8.\n", 61) = 61

The expected operation is that it would put suitable data in the $process
variable so that Perl code can handle the situation in whatever way the
programmer thinks is appropriate.

#1142050#12
Date:
2026-07-15 04:39:21 UTC
From:
To:
I've attached a patch to fix this.