Package: psmisc
Version: 22.21-2
Severity: normal
Tags: upstream patch

If a thread is deleted during the execution of the function
get_threadname, the fclose function can be called with a NULL argument,
which will cause a segmentation fault.

Core was generated by `pstree'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  _IO_new_fclose (fp=0x0) at iofclose.c:54
54      iofclose.c: No such file or directory.
(gdb) bt
#0  _IO_new_fclose (fp=0x0) at iofclose.c:54
#1  0x00000000004037be in ?? ()
#2  0x0000000000401a43 in ?? ()
#3  0x00007f577c553b45 in __libc_start_main (main=0x401670, argc=1,
argv=0x7ffeb6139328, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7ffeb6139318) at libc-start.c:287
#4  0x0000000000401e8d in ?? ()


Bug is fixed in upstream in version 22.22 by patch
https://sourceforge.net/p/psmisc/patches/33/


Patch for this problem only:

--- pstree.c.orig       2016-02-25 16:36:48.630355893 +0300
+++ pstree.c    2016-02-25 16:39:47.588783148 +0300
@@ -816,10 +816,10 @@
                return threadname;
            }
        }
+       fclose(file);
     }
     /* Fall back to old method */
     sprintf(threadname, "{%.*s}", COMM_LEN, comm);
-    fclose(file);
     return threadname;
 }



-- System Information:
Debian Release: 8.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0-0.bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=ru_RU.utf8, LC_CTYPE=ru_RU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages psmisc depends on:
ii  libc6      2.19-18+deb8u3
ii  libtinfo5  5.9+20140913-1+b1

psmisc recommends no packages.

psmisc suggests no packages.

-- no debconf information


-- 
С уважением.   WBR.
    Алексей.       Alexey.

mailto:ale...@remizov.org
jabber:remi...@jabber.ru

Reply via email to