Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1735557

[PATCH] zsmalloc: calling zs_map_object() from irq is a bug

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] zsmalloc: calling zs_map_object() from irq is a bug
Date Wed, 20 Sep 2017 08:40:02 +0200
Message-ID <urGPU-7L3-17@gated-at.bofh.it> (permalink)
X-Original-To Andrew Morton <akpm@linux-foundation.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3B0gcdRM0V1uVPPqBx4S/7xqxDgCS43Ys6zYEq28utk=; b=VuMUBrsUeWGk0sdhonZHFsqvR8gbKZylLcu1fXhe7fIydbbnZerfEpfZ0BhzG9d7h+ QXQBgrOmqVKDT/S/lesqYTgrBPAMBRoCmLreY7GNxBMJQpxYVAsQMks+bZ30lZdbnsLQ teuJE0dr+GB7RAQ+R0yZmq8LiVa9EXEtRifD6QeEHnSRI3/8tRgRjncM50fZIF2mNOKK S0iFQ09rYEpy11yrCm7hQtkvaKAvOl0CPudrK13M0xhzqrAT7gjYlP1FAQfaKk2hTEw0 FddxksTqV6p/SVl9yLxOxaz0x+0Sw/e+XZWX0ogLXXNni2cFCDn1PKhi8Hi6i1m7RIJ/ QpMw==
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; bh=3B0gcdRM0V1uVPPqBx4S/7xqxDgCS43Ys6zYEq28utk=; b=ByugS7U3BlZD8zLUFVEw1xbIUi5b+wCm8Gf6jTeCgGldi4sAgQbpK1YA/AQX77+uib EvOhko4Bs04ZQxO1nRbkdaOo1kg8y7bCG6qRz5BEw+G6dl0r4KR0/WPksCodjcGyEZN1 Pe+14dJrF/ATeIDPSRDjRHsX23vPkUHh47x5nEDA4+0h2VqjQumyI50BL7rTMcfPL0af Yf2Z+/QHtpKHG/QMyr5ZxnoX8yihfNBQjoDyfrIyAY9rlBDlSs/wSukkLw9qRVbecBz+ 20wyhpH/d5limCJCo9+VaAuvulXAtCjg63GUDQxe7RR508p0VTdZcZlpylRt5AFynftI ntxQ==
X-Gm-Message-State AHPjjUg7oztKxcV/Kfr9eH0T4H88xzl/lNBgUqt19xVGslaNY7LqGUFI y+C28YXBKzo1j/zhS8BP1iY=
X-Google-SMTP-Source AOwi7QCGtJrhaz0EcUH9hBC+Q0DSG86zXWGC1lAGt65VtIfkcx/pMR4UrxAxyMBw70ON7mo+1Lg6uA==
X-Received by 10.98.23.10 with SMTP id 10mr1131101pfx.339.1505889593057; Tue, 19 Sep 2017 23:39:53 -0700 (PDT)
X-Google-Original-From Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
X-Mailer git-send-email 2.14.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 24
Organization linux.* mail to news gateway
X-Original-Cc Minchan Kim <minchan@kernel.org>, linux-kernel@vger.kernel.org, Sergey Senozhatsky <sergey.senozhatsky@gmail.com>, Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
X-Original-Date Wed, 20 Sep 2017 15:39:41 +0900
X-Original-Message-ID <20170920063941.14662-1-sergey.senozhatsky@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1735557

Show key headers only | View raw


Use BUG_ON(in_interrupt()) in zs_map_object(). Calling this
function from IRQ is a bug, because we use per-CPU mappings
and interrupt may corrupt those buffers.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 7c38e850a8fc..685049a9048d 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1349,7 +1349,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle,
 	 * pools/users, we can't allow mapping in interrupt context
 	 * because it can corrupt another users mappings.
 	 */
-	WARN_ON_ONCE(in_interrupt());
+	BUG_ON(in_interrupt());
 
 	/* From now on, migration cannot move the object */
 	pin_tag(handle);
-- 
2.14.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] zsmalloc: calling zs_map_object() from irq is a bug Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-20 08:40 +0200
  Re: [PATCH] zsmalloc: calling zs_map_object() from irq is a bug Minchan Kim <minchan@kernel.org> - 2017-09-20 08:50 +0200
    Re: [PATCH] zsmalloc: calling zs_map_object() from irq is a bug Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-20 08:50 +0200

csiph-web