Subject: [PATCH] sysvipc namespace Only free ids that are in use in ipc_free_ids From: Eric W. Biederman Date: 1132747813 -0700 --- ipc/util.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) 675019385ee6b5ca057f5d34d26e6ae2670918b4 diff --git a/ipc/util.c b/ipc/util.c index 1a54abb..e1c1dd9 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -116,10 +116,12 @@ void ipc_free_ids(struct ipc_ids *ids, v size = ids->entries->size; for (id = 0; id < size; id++) { struct kern_ipc_perm *p; - rcu_read_lock(); p = ids->entries->p[id]; - spin_lock(&p->lock); - ipc_free(p); + if (p) { + rcu_read_lock(); + spin_lock(&p->lock); + ipc_free(p); + } } BUG_ON(ids->in_use); old = ids->entries; -- 1.0.GIT