Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2028373imm; Thu, 12 Jul 2018 11:55:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdxpLY64vqqQhEVXE9luNg/NTgOlfZ31ZnBMTZdK/HWHFFEs+gXrhyLRCOWnEVqEfxxNc3B X-Received: by 2002:a62:bd03:: with SMTP id a3-v6mr3641366pff.138.1531421755951; Thu, 12 Jul 2018 11:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531421755; cv=none; d=google.com; s=arc-20160816; b=viUSe+wrwnBL9c1lKQdq0eBnU9TnkjCfB1abHdZR3Wy0AFNaka+tGVj3Fc88pZHrb/ s/sTZS2UaMGcebWOZ0ZWqOyhv8oYIYsrmu3y5kvK8rOB96KdJ9Qk96xqSAILCUyOI/5E T+SyWp5icXlnCAlNw8q1XVWtp7DpyHj882cDrRf9xCe33AR93QfiEmA0RYniCw4rN21J otz71eqtY403gV546jx6xe1oE1NcDph0E1WeJv6xmB0TlxxNEl33TP/AbGpUy7TAO2Rf gdd2HmiZTIot3hWZ0dTyJBBoB6Wpca70m2u786t92e5eEicPJCv6TMxoNB7twHyAoY6r i+VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JKhNjtSAaGH7H2rmz0Zl3PymPdxxLi/JZsA2Os9fvJU=; b=Rd8R8eSu/eMwn1zhf6yGcOP++Zt1tsUkmyXxBVKWQQw7oJIEH+Yf4YwnChsOcCTurg GTI7sWZPD053F/cxq6yI629S2HNGa+6vYv4asL8+l+I/NuT1iPAD6I4AwabcK82QeKJn gsFAbOqtzvnKoFJ7TAiypEnpu3Kbc+eLnVm7QBnOtoYfBDkuqeiMf8vT+npn/3kn1g4q SkDcEKVzD2gVkRXIur7XV+SOfKMpmdVeO05nsxGHgDUu2BYQvT9pkDyjxAm6tnY4h4fL oP2nGRmmrhjLwpmmVCJuYF93SlFr5SXpkuT1zdg4i4/v6n21ryOoFF9gZKMyNLwfvZqW HDCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@colorfullife-com.20150623.gappssmtp.com header.s=20150623 header.b="B/uNCdU6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6-v6si22379722ply.300.2018.07.12.11.55.40; Thu, 12 Jul 2018 11:55:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@colorfullife-com.20150623.gappssmtp.com header.s=20150623 header.b="B/uNCdU6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732216AbeGLTEC (ORCPT + 99 others); Thu, 12 Jul 2018 15:04:02 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34460 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbeGLTEA (ORCPT ); Thu, 12 Jul 2018 15:04:00 -0400 Received: by mail-wr1-f65.google.com with SMTP id c13-v6so22677143wrt.1 for ; Thu, 12 Jul 2018 11:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=colorfullife-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JKhNjtSAaGH7H2rmz0Zl3PymPdxxLi/JZsA2Os9fvJU=; b=B/uNCdU6Ka5mxo78UVsxqDrSpRCZ2A3sfD5eoRXlAxNmHuNpNBBwPiVHjPrMEWa1x7 QZNjRqXsfY6/AFnf4vgF/UnkjZiTCKXjRPZMO6EwYYbX9+XORCBDBVub0OZSGhNF+MH/ 7JKh3aAnL7WwmTe7nkXTaC6nvhIM3YXkNTHsHCPIOWj85gVRpcIgmUixURRzOhtK575j RQi5j3fZtAzu/KL9r0aQaYBzpmRVItbmr7Y5ntzNuEWLJlRwhFmkiEKaxiDbN0gMCSqM oLCXB5qr7e36d2Bd1RIeX2nsmTMlqKQ3gsLz8eR30/KOC1R3un5NBvUvfgyEWx8Frmjw P3nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JKhNjtSAaGH7H2rmz0Zl3PymPdxxLi/JZsA2Os9fvJU=; b=i1qIeVTix/b7ONRdsd4Ubb3I0lLh1e88jz6gwodXNXoYhL2hNj66/0HwAzgWXanQTx SOsr+G0N/F24CY3NX4gWpIA1vPPDYEJzeB1v+wZvFfd9zcBWYNEXjKwW8hnTyU3xn+4r aYKCXuejjlgC6Ocw/OTFtGwkPnq39ELzUxA6BxQEVEbr2sSDUU5wnF9wmzFeNtDedfx1 N2ipBqEyZJWnJTkUdKX1nboXSrQj9yJMjwVKrqdT28kmwuLR2I9EjtD9w65KCCzmHeMy 8sqb5fWfyDi3YTSs2V3P54RXzEp9xbebrin+FpGPIyOkyBpwaWuYlsYaM5jmB0qW44aX SeKQ== X-Gm-Message-State: AOUpUlFdBlK1UH/xs7bc9RXKCYsgjMAwCZHTSzt6IRbEtpP6Lf/CJs+b kZlhRlZUcTmN7Iq6MQWEcbAJqg== X-Received: by 2002:adf:820a:: with SMTP id 10-v6mr2563731wrb.144.1531421591217; Thu, 12 Jul 2018 11:53:11 -0700 (PDT) Received: from localhost.localdomain (p200300D993C98700CB5FA3798C189FE1.dip0.t-ipconnect.de. [2003:d9:93c9:8700:cb5f:a379:8c18:9fe1]) by smtp.googlemail.com with ESMTPSA id h5-v6sm13557841wrr.19.2018.07.12.11.53.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 11:53:10 -0700 (PDT) From: Manfred Spraul To: Andrew Morton , Davidlohr Bueso , Dmitry Vyukov Cc: LKML , 1vier1@web.de, Kees Cook , Manfred Spraul Subject: [PATCH 05/12] ipc/util.c: correct comment in ipc_obtain_object_check Date: Thu, 12 Jul 2018 20:52:34 +0200 Message-Id: <20180712185241.4017-6-manfred@colorfullife.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180712185241.4017-1-manfred@colorfullife.com> References: <20180712185241.4017-1-manfred@colorfullife.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Manfred Spraul Reviewed-by: Davidlohr Bueso --- ipc/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipc/util.c b/ipc/util.c index cffd12240f67..5cc37066e659 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -628,8 +628,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. -- 2.17.1