Skip to content

Commit 2e5ceb4

Browse files
manfred-colorfutorvalds
authored andcommitted
ipc/util.c: correct comment in ipc_obtain_object_check
The comment that explains ipc_obtain_object_check is wrong: The function checks the sequence number, not the reference counter. Note that checking the reference counter would be meaningless: The reference counter is decreased without holding any locks, thus an object with kern_ipc_perm.deleted=true may disappear at the end of the next rcu grace period. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Manfred Spraul <[email protected]> Reviewed-by: Davidlohr Bueso <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Kees Cook <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4241c1a commit 2e5ceb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ipc/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,8 @@ struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
629629
* @ids: ipc identifier set
630630
* @id: ipc id to look for
631631
*
632-
* Similar to ipc_obtain_object_idr() but also checks
633-
* the ipc object reference counter.
632+
* Similar to ipc_obtain_object_idr() but also checks the ipc object
633+
* sequence number.
634634
*
635635
* Call inside the RCU critical section.
636636
* The ipc object is *not* locked on exit.

0 commit comments

Comments
 (0)