[lkml]   [2015]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 5/5] 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:

Signed-off-by: Davidlohr Bueso <>
ipc/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/util.c b/ipc/util.c
index 15e750d..468b225 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -625,7 +625,7 @@ struct kern_ipc_perm *ipc_obtain_object_check(struct ipc_ids *ids, int id)
goto out;

if (ipc_checkid(out, id))
- return ERR_PTR(-EIDRM);
+ return ERR_PTR(-EINVAL);
return out;

 \ /
  Last update: 2015-06-06 16:01    [W:0.048 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site