linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: kernel test robot <rong.a.chen@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Davidlohr Bueso <dbueso@suse.de>,
	Manfred Spraul <manfred@colorfullife.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Kees Cook <keescook@chromium.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Michal Hocko <mhocko@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	lkp@01.org, ltp@lists.linux.it
Subject: [PATCH] ipc/shm: properly return EIDRM in shm_lock()
Date: Thu, 23 Aug 2018 20:09:20 -0700	[thread overview]
Message-ID: <20180824030920.GD3677@linux-r8p5> (raw)
In-Reply-To: <20180823041434.GC3677@linux-r8p5>

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 <dbueso@suse.de>
---
 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


  reply	other threads:[~2018-08-24  3:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23  2:40 [lkp-robot] [ipc] 296ba26b66: BUG:sleeping_function_called_from_invalid_context_at_mm/memory.c kernel test robot
2018-08-23  4:14 ` Davidlohr Bueso
2018-08-24  3:09   ` Davidlohr Bueso [this message]
2018-09-25 12:00     ` [PATCH] ipc/shm: properly return EIDRM in shm_lock() Arnd Bergmann
2018-09-25 17:23       ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180824030920.GD3677@linux-r8p5 \
    --to=dave@stgolabs.net \
    --cc=akpm@linux-foundation.org \
    --cc=dbueso@suse.de \
    --cc=dvyukov@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=ltp@lists.linux.it \
    --cc=manfred@colorfullife.com \
    --cc=mhocko@suse.com \
    --cc=mtk.manpages@gmail.com \
    --cc=rong.a.chen@intel.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).