From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751724AbdITGjz (ORCPT ); Wed, 20 Sep 2017 02:39:55 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:38513 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbdITGjx (ORCPT ); Wed, 20 Sep 2017 02:39:53 -0400 X-Google-Smtp-Source: AOwi7QCGtJrhaz0EcUH9hBC+Q0DSG86zXWGC1lAGt65VtIfkcx/pMR4UrxAxyMBw70ON7mo+1Lg6uA== From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky To: Andrew Morton Cc: Minchan Kim , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: [PATCH] zsmalloc: calling zs_map_object() from irq is a bug Date: Wed, 20 Sep 2017 15:39:41 +0900 Message-Id: <20170920063941.14662-1-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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