diff options
author | Davidlohr Bueso <dave@stgolabs.net> | 2015-06-30 17:58:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-30 22:44:59 -0400 |
commit | 6157dbbfbf9d8e4a2b6d4e5ee35e864ab9ee8414 (patch) | |
tree | 261947d302e567e7657642c1b2a5d5ca25bedcab /ipc | |
parent | f8b5918495be32807c4f878de959540eb63a9b9f (diff) |
ipc,sysv: return -EINVAL upon incorrect id/seqnum
In ipc_obtain_object_check we return -EIDRM when a bogus sequence number
is detected via ipc_checkid, while the ipc manpages state the following
return codes for such errors:
EIDRM <ID> points to a removed identifier.
EINVAL Invalid <ID> value, or unaligned, etc.
EIDRM should only be returned upon a RMID call (->deleted check), and thus
return EINVAL for wrong seq. This difference in semantics has also caused
real bugs, ie: https://bugzilla.redhat.com/show_bug.cgi?id=246509
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/util.c b/ipc/util.c index b99038699fee..be4230020a1f 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -622,7 +622,7 @@ struct kern_ipc_perm *ipc_obtain_object_check(struct ipc_ids *ids, int id) | |||
622 | goto out; | 622 | goto out; |
623 | 623 | ||
624 | if (ipc_checkid(out, id)) | 624 | if (ipc_checkid(out, id)) |
625 | return ERR_PTR(-EIDRM); | 625 | return ERR_PTR(-EINVAL); |
626 | out: | 626 | out: |
627 | return out; | 627 | return out; |
628 | } | 628 | } |