From: Davidlohr Bueso <dave@stgolabs.net>
To: ltp@lists.linux.it
Subject: [LTP] [lkp-robot] [ipc] 296ba26b66: BUG:sleeping_function_called_from_invalid_context_at_mm/memory.c
Date: Wed, 22 Aug 2018 21:14:34 -0700 [thread overview]
Message-ID: <20180823041434.GC3677@linux-r8p5> (raw)
In-Reply-To: <20180823024051.GC13343@shao2-debian>
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();
/*
WARNING: multiple messages have this Message-ID (diff)
From: Davidlohr Bueso <dave@stgolabs.net>
To: lkp@lists.01.org
Subject: Re: [lkp-robot] [ipc] 296ba26b66: BUG:sleeping_function_called_from_invalid_context_at_mm/memory.c
Date: Wed, 22 Aug 2018 21:14:34 -0700 [thread overview]
Message-ID: <20180823041434.GC3677@linux-r8p5> (raw)
In-Reply-To: <20180823024051.GC13343@shao2-debian>
[-- Attachment #1: Type: text/plain, Size: 762 bytes --]
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();
/*
WARNING: multiple messages have this Message-ID (diff)
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: Re: [lkp-robot] [ipc] 296ba26b66: BUG:sleeping_function_called_from_invalid_context_at_mm/memory.c
Date: Wed, 22 Aug 2018 21:14:34 -0700 [thread overview]
Message-ID: <20180823041434.GC3677@linux-r8p5> (raw)
In-Reply-To: <20180823024051.GC13343@shao2-debian>
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();
/*
next prev parent reply other threads:[~2018-08-23 4:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-23 2:40 [LTP] [lkp-robot] [ipc] 296ba26b66: BUG:sleeping_function_called_from_invalid_context_at_mm/memory.c kernel test robot
2018-08-23 2:40 ` kernel test robot
2018-08-23 2:40 ` kernel test robot
2018-08-23 4:14 ` Davidlohr Bueso [this message]
2018-08-23 4:14 ` Davidlohr Bueso
2018-08-23 4:14 ` Davidlohr Bueso
2018-08-24 3:09 ` [LTP] [PATCH] ipc/shm: properly return EIDRM in shm_lock() Davidlohr Bueso
2018-08-24 3:09 ` Davidlohr Bueso
2018-08-24 3:09 ` Davidlohr Bueso
2018-09-25 12:00 ` [LTP] " Arnd Bergmann
2018-09-25 12:00 ` Arnd Bergmann
2018-09-25 12:00 ` Arnd Bergmann
2018-09-25 17:23 ` [LTP] " Kees Cook
2018-09-25 17:23 ` Kees Cook
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=20180823041434.GC3677@linux-r8p5 \
--to=dave@stgolabs.net \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.