• D
    ipc: drop ipc_lock() · 82061c57
    Davidlohr Bueso 提交于
    ipc/util.c contains multiple functions to get the ipc object pointer given
    an id number.
    
    There are two sets of function: One set verifies the sequence counter part
    of the id number, other functions do not check the sequence counter.
    
    The standard for function names in ipc/util.c is
    - ..._check() functions verify the sequence counter
    - ..._idr() functions do not verify the sequence counter
    
    ipc_lock() is an exception: It does not verify the sequence counter value,
    but this is not obvious from the function name.
    
    Furthermore, shm.c is the only user of this helper.  Thus, we can simply
    move the logic into shm_lock() and get rid of the function altogether.
    
    [manfred@colorfullife.com: most of changelog]
    Link: http://lkml.kernel.org/r/20180712185241.4017-7-manfred@colorfullife.comSigned-off-by: NDavidlohr Bueso <dbueso@suse.de>
    Signed-off-by: NManfred Spraul <manfred@colorfullife.com>
    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: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    82061c57
util.c 22.5 KB