Skip to content

Commit

Permalink
ipc/util.c: correct comment in ipc_obtain_object_check
Browse files Browse the repository at this point in the history
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/20180712185241.4017-6-manfred@colorfullife.com
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Kees Cook <keescook@chromium.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Manfred Spraul authored and Linus Torvalds committed Aug 22, 2018
1 parent 4241c1a commit 2e5ceb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
* @ids: ipc identifier set
* @id: ipc id to look for
*
* Similar to ipc_obtain_object_idr() but also checks
* the ipc object reference counter.
* Similar to ipc_obtain_object_idr() but also checks the ipc object
* sequence number.
*
* Call inside the RCU critical section.
* The ipc object is *not* locked on exit.
Expand Down

0 comments on commit 2e5ceb4

Please sign in to comment.