Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1175689imm; Wed, 22 Aug 2018 21:16:14 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxTdnpGZssoCS2rfE1k3LTN5USEUVwPCjhJnWgR0qrTl+/kvavmxe7TonkHRSLJ7dVtD1QY X-Received: by 2002:a62:c182:: with SMTP id i124-v6mr60166029pfg.248.1534997774625; Wed, 22 Aug 2018 21:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534997774; cv=none; d=google.com; s=arc-20160816; b=VqWeCfnfgpJbBQdsFC/zHJYLHAv7+A/NbE9aN1Wx6crNQcZB4Jw/FKyF4LcqxkTMHP /3/SkDm41TGG2NS0H5zmK/r/nbkyPKkuwExa8uUzsMVHlzdOCuutRxa6OtaXtXc9ay6X BiRx2MYWarSjzjxBn12sXjczmnnYOgNvB5ezODw5iytImBg93rl2xqhVZg9YMd5JOdBv 1ExgbuFQ5HjIQMNWA5l2F+KYP4BUMb8emAoyCgBkrTh+EhDLmBuwvI7gYdJrTT+DYWIV DLBQeNxmbBOaMzeBfQCmJZ3XJjKMe+6GW8nIBIEULdIg3Ktp2a2cB7XeOZ9m5UWbjUYV Smmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=zHFWz971F+2X81U6FzV0D67fGtMEx8pOAvsQfk3hfyg=; b=tDK2jhh4PbfKClNa6HjfqqWVerRiBcZpU2pbF8NT8whQ9XheNVjY0GMM0h/TbXOCTQ ErgT9UOTYAnCG57wnuT+F6N4aMD7BcwF4k+wEK0wSJIJDM0iiypZYeTRVDxzWnRm4vK5 RunZ+LhcRcWVLMVkFQ94XmVFSbAeXlStivw1yuMmuVBgF7Ldxe32+zvQUUbjQf2QNjaI TyM26RuGV8U+n+vR6998rJwFrYH++iwzIKQCOaZI/fU1zBAfSxbedn8sxBVwB1eLgKhe gTssbO2hp7p/PLTzZfa05EL/NveYzEXGsE25uWIKkfADFH3PcF/817M/MnoZUQqRBusl qrMg== ARC-Authentication-Results: i=1; mx.google.com; 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 j2-v6si3621564pfc.102.2018.08.22.21.15.58; Wed, 22 Aug 2018 21:16:14 -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; 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 S1728261AbeHWHma (ORCPT + 99 others); Thu, 23 Aug 2018 03:42:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:56356 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727346AbeHWHma (ORCPT ); Thu, 23 Aug 2018 03:42:30 -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 DEB66AB7D; Thu, 23 Aug 2018 04:14:47 +0000 (UTC) Date: Wed, 22 Aug 2018 21:14:34 -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: Re: [lkp-robot] [ipc] 296ba26b66: BUG:sleeping_function_called_from_invalid_context_at_mm/memory.c Message-ID: <20180823041434.GC3677@linux-r8p5> References: <20180823024051.GC13343@shao2-debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180823024051.GC13343@shao2-debian> 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 On Thu, 23 Aug 2018, kernel test robot wrote: >FYI, we noticed the following commit (built with gcc-7): > >commit: 296ba26b6681b6e07ed419b3004647167cb17f61 ("ipc: drop ipc_lock()") >https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master I suspect this is because that commit forgot to set EIDRM for the !ipc_valid_object() case. So the callers check IS_ERR(shm_lock()), which won't fail the op as it did before the commit. 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(); /*