Hmm, that's an interesting situation you have there with /proc under a
process.  It looks like it is getting the /proc/stat and the
/proc/<PID>/stat confused and crashing.  I'll have a look at the code
around reading the stat file in and see if it can be a bit more robust.
Unfortunately, the older (current) library isn't too good about reporting
problems back up to the calling binary.

 - Craig


On Mon, 18 Nov 2019 at 02:25, Marco d'Itri <m...@linux.it> wrote:

> On Oct 24, Craig Small <csm...@debian.org> wrote:
>
> >   Are you sure it's just a lack of memory causing this problem?
> > It's going to be a bit tricky to fix with just a crash message.
> I have seen a similar bug being triggered on a compromised customer
> server.
>
> strace:
>
> ...
> stat("/proc/22299", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
> open("/proc/22299/stat", O_RDONLY)      = 6
> read(6, "cpu  1067991797 7372 10234352 43"..., 2048) = 860
> close(6)                                = 0
> --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1} ---
>
> The problem is that for some reason /proc was mounted again on
> /proc/22299:
>
> # ps
> Signal 11 (SEGV) caught by ps (3.3.12).
> ps:ps/display.c:66: please report this bug
> Segmentation fault
> [Exit 139 (SIGSEGV)]
> # pstree -p | grep 22299
> [Exit 1]
> # grep 22299 /proc/mounts
> proc /proc/22299 proc rw,relatime 0 0
> proc /usr/foo/22299 proc rw,relatime 0 0
> proc /proc/22299 proc rw,relatime 0 0
> proc /usr/foo/22299 proc rw,relatime 0 0
> proc /usr/foo/22299/22314 proc rw,relatime 0 0
> proc /proc/22299/22314 proc rw,relatime 0 0
> proc /usr/foo/22299/22314 proc rw,relatime 0 0
> proc /proc/22299/22314 proc rw,relatime 0 0
> proc /usr/foo/22299/22315 proc rw,relatime 0 0
> proc /proc/22299/22315 proc rw,relatime 0 0
> proc /usr/foo/22299/22315 proc rw,relatime 0 0
> proc /proc/22299/22315 proc rw,relatime 0 0
> proc /usr/foo/22299/22314/22315 proc rw,relatime 0 0
> proc /proc/22299/22314/22315 proc rw,relatime 0 0
> proc /usr/foo/22299/22314/22315 proc rw,relatime 0 0
> proc /proc/22299/22314/22315 proc rw,relatime 0 0
> #
>
> After unmounting everything below /proc/22299 ps and top would work
> again. pstree was not affected, BTW.
>
> HTH.
>
> --
> ciao,
> Marco
>

Reply via email to