Bug 666213 - uninitialized memory leading to `killall -g name ` failure
Summary: uninitialized memory leading to `killall -g name ` failure
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: psmisc
Version: 5.6
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Jaromír Cápík
QA Contact: Branislav Náter
URL:
Whiteboard:
Depends On:
Blocks: 665076 666214 668991
TreeView+ depends on / blocked
 
Reported: 2010-12-29 16:15 UTC by Dan Kenigsberg
Modified: 2013-01-11 03:41 UTC (History)
8 users (show)

Fixed In Version: psmisc-22.2-8
Doc Type: Bug Fix
Doc Text:
Due to an error in memory allocation, an attempt to kill a process group by using the "killall -g" command could fail. With this update, the memory allocation has been corrected, and the killall utility now works as expected.
Clone Of:
: 666214 (view as bug list)
Environment:
Last Closed: 2013-01-08 03:30:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
reproducer (567 bytes, application/x-tar)
2011-01-07 14:16 UTC, Jan Görig
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0118 0 normal SHIPPED_LIVE psmisc bug fix update 2013-01-08 08:27:15 UTC

Description Dan Kenigsberg 2010-12-29 16:15:26 UTC
Description of problem:
We need to kill a processes named 'spmprotect.sh' and all the processes in its process group.

`killall -g spmprotect.sh`

this ends up with "spmprotect.sh: no process killed".

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

How reproducible:
seldom, when the target process has a low pid.


Additional info:
The issue stems from unclean pgids table, and seems to be fixed by

--- killall.c.orig	2010-12-29 18:10:16.000000000 +0200
+++ killall.c	2010-12-29 18:10:43.000000000 +0200
@@ -238,7 +238,7 @@
     pgids = NULL;		/* silence gcc */
   else
     {
-      pgids = malloc (pids * sizeof (pid_t));
+      pgids = calloc (pids, sizeof (pid_t));
       if (!pgids)
 	{
 	  perror ("malloc");

Comment 1 RHEL Program Management 2010-12-29 16:27:25 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 2 Jan Görig 2011-01-07 14:16:14 UTC
Created attachment 472237 [details]
reproducer

Patch looks fine and resolves bug correctly. Reproducer attached.

Comment 6 Jaromir Hradilek 2011-01-14 11:42:40 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Due to an error in memory allocation, an attempt to kill a process group by using the "killall -g" command could fail. With this update, the memory allocation has been corrected, and the killall utility now works as expected.

Comment 12 errata-xmlrpc 2013-01-08 03:30:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0118.html


Note You need to log in before you can comment on or make changes to this bug.