From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3340C4321D for ; Fri, 24 Aug 2018 03:09:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 418DC21571 for ; Fri, 24 Aug 2018 03:09:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 418DC21571 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=stgolabs.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727067AbeHXGmN (ORCPT ); Fri, 24 Aug 2018 02:42:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:48244 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726140AbeHXGmN (ORCPT ); Fri, 24 Aug 2018 02:42:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4AE85AF3A; Fri, 24 Aug 2018 03:09:34 +0000 (UTC) Date: Thu, 23 Aug 2018 20:09:20 -0700 From: Davidlohr Bueso To: kernel test robot Cc: Stephen Rothwell , Davidlohr Bueso , Manfred Spraul , Dmitry Vyukov , Herbert Xu , Kees Cook , Michael Kerrisk , Michal Hocko , Andrew Morton , LKML , lkp@01.org, ltp@lists.linux.it Subject: [PATCH] ipc/shm: properly return EIDRM in shm_lock() Message-ID: <20180824030920.GD3677@linux-r8p5> References: <20180823024051.GC13343@shao2-debian> <20180823041434.GC3677@linux-r8p5> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180823041434.GC3677@linux-r8p5> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When getting rid of the general ipc_lock(), this was missed furthermore, making the comment around the ipc object validity check bogus. Under EIDRM conditions, callers will in turn not see the error and continue with the operation. Fixes: 82061c57ce9 (ipc: drop ipc_lock()) Signed-off-by: Davidlohr Bueso --- ipc/shm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ipc/shm.c b/ipc/shm.c index b0eb3757ab89..4cd402e4cfeb 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -199,6 +199,7 @@ static inline struct shmid_kernel *shm_lock(struct ipc_namespace *ns, int id) } ipc_unlock_object(ipcp); + ipcp = ERR_PTR(-EIDRM); err: rcu_read_unlock(); /* -- 2.16.4