diff options
Diffstat (limited to 'ipc/util.c')
| -rw-r--r-- | ipc/util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ipc/util.c b/ipc/util.c index be4230020a1f..0f401d94b7c6 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
| @@ -237,6 +237,10 @@ int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int size) | |||
| 237 | rcu_read_lock(); | 237 | rcu_read_lock(); |
| 238 | spin_lock(&new->lock); | 238 | spin_lock(&new->lock); |
| 239 | 239 | ||
| 240 | current_euid_egid(&euid, &egid); | ||
| 241 | new->cuid = new->uid = euid; | ||
| 242 | new->gid = new->cgid = egid; | ||
| 243 | |||
| 240 | id = idr_alloc(&ids->ipcs_idr, new, | 244 | id = idr_alloc(&ids->ipcs_idr, new, |
| 241 | (next_id < 0) ? 0 : ipcid_to_idx(next_id), 0, | 245 | (next_id < 0) ? 0 : ipcid_to_idx(next_id), 0, |
| 242 | GFP_NOWAIT); | 246 | GFP_NOWAIT); |
| @@ -249,10 +253,6 @@ int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int size) | |||
| 249 | 253 | ||
| 250 | ids->in_use++; | 254 | ids->in_use++; |
| 251 | 255 | ||
| 252 | current_euid_egid(&euid, &egid); | ||
| 253 | new->cuid = new->uid = euid; | ||
| 254 | new->gid = new->cgid = egid; | ||
| 255 | |||
| 256 | if (next_id < 0) { | 256 | if (next_id < 0) { |
| 257 | new->seq = ids->seq++; | 257 | new->seq = ids->seq++; |
| 258 | if (ids->seq > IPCID_SEQ_MAX) | 258 | if (ids->seq > IPCID_SEQ_MAX) |
