Bug 205618 - CVE-2006-4342 shmat hangs by simultaneous shmctl(IPC_RMID)
Summary: CVE-2006-4342 shmat hangs by simultaneous shmctl(IPC_RMID)
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel   
(Show other bugs)
Version: 3.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Sachin Prabhu
QA Contact: Brian Brock
Whiteboard: impact=important,source=redhat,report...
Keywords: Security
Depends On:
TreeView+ depends on / blocked
Reported: 2006-09-07 17:09 UTC by Issue Tracker
Modified: 2018-10-19 19:13 UTC (History)
5 users (show)

Fixed In Version: RHSA-2006-0710
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-10-19 12:45:30 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Reproducer (675 bytes, application/x-gzip)
2006-09-07 17:11 UTC, Sachin Prabhu
no flags Details
Proposed Patch (1.62 KB, patch)
2006-09-07 17:12 UTC, Sachin Prabhu
no flags Details | Diff
Proposed Patch (1.92 KB, patch)
2006-09-15 06:54 UTC, Sachin Prabhu
no flags Details | Diff
Proposed Patch (1.94 KB, patch)
2006-09-19 06:20 UTC, Sachin Prabhu
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2006:0710 normal SHIPPED_LIVE Important: kernel security update 2006-10-19 12:39:53 UTC

Description Issue Tracker 2006-09-07 17:09:26 UTC
Escalated to Bugzilla from IssueTracker

Comment 6 Sachin Prabhu 2006-09-07 17:12:04 UTC
Created attachment 135788 [details]
Proposed Patch

Comment 12 Sachin Prabhu 2006-09-15 06:54:43 UTC
Created attachment 136333 [details]
Proposed Patch

Added write locks around kfree to resolve a memory corruption issue.

Comment 14 Sachin Prabhu 2006-09-19 06:20:02 UTC
Created attachment 136605 [details]
Proposed Patch

moved br_write_lock and unlock to ipc_unlock_deleted

Comment 15 Sachin Prabhu 2006-09-20 07:51:01 UTC
Deadlock happens on smp machines when a shmat() function runs at the same time
that shmctl() is used to remove the same shm. While the shmat process waits at
the spinlock in ipc_lock function, the shmctl function deletes the path to the
kern_ipc_perm structure which holds the spinlock variable and frees the memory
location. Because of this, the ipc_unlock() run for shmctl() does not unlock the
spinlock and the shmat waits indefinitely at the spinlock.

This is serious issue for RHEL3 users especially applications using IPC
shared-memory. This deadlock brings other deadlock in IPC features (ex. IPC
semaphore) since deadlocked process holds readlock of BR_SEMAPHORE_LOCK which
are shared by all IPC features.

The code in question was backported from the 2.5 kernel with the patch
linux-2.4.21-semaphore-scale.patch by Ingo Molnar. This code does not appear
upstream in the 2.4 kernels. The Red Hat implementation on the 2.4 kernel is
done using 'Big Reader' read-write locks. The patch was written by modifying the
code from the patch provided in bz # 91146 to use brlocks.  The attached
reproducer recreates the issue.

Comment 22 Ernie Petrides 2006-09-23 01:08:09 UTC
A fix for this problem has just been committed to the RHEL3 U9
patch pool this evening (in kernel version 2.4.21-47.1.EL).

Comment 28 Ernie Petrides 2006-10-13 21:51:20 UTC
A fix for this problem has also been committed to the RHEL3 E9
patch pool this evening (in kernel version 2.4.21-47.0.1.EL).

Comment 34 Red Hat Bugzilla 2006-10-19 12:45:32 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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