Commit 89163f93 authored by Vasily Averin's avatar Vasily Averin Committed by Linus Torvalds
Browse files

ipc/util.c: sysvipc_find_ipc() should increase position index

If seq_file .next function does not change position index, read after
some lseek can generate unexpected output.

Signed-off-by: default avatarVasily Averin <>
Signed-off-by: default avatarAndrew Morton <>
Acked-by: default avatarWaiman Long <>
Cc: Davidlohr Bueso <>
Cc: Manfred Spraul <>
Cc: Al Viro <>
Cc: Ingo Molnar <>
Cc: NeilBrown <>
Cc: Peter Oberparleiter <>
Cc: Steven Rostedt <>

Signed-off-by: default avatarLinus Torvalds <>
parent f4d74ef6
......@@ -764,13 +764,13 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
*new_pos = pos + 1;
if (total >= ids->in_use)
return NULL;
for (; pos < ipc_mni; pos++) {
ipc = idr_find(&ids->ipcs_idr, pos);
if (ipc != NULL) {
*new_pos = pos + 1;
return ipc;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment