Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1086294ybl; Wed, 14 Aug 2019 10:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAql+WhgIkkdWcqwbzIkbVoGhEozVPtYbLZ6kd343ATwh8XC/nTJ37TyFb5HvBB950wL41 X-Received: by 2002:a62:187:: with SMTP id 129mr1102541pfb.128.1565803712084; Wed, 14 Aug 2019 10:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803712; cv=none; d=google.com; s=arc-20160816; b=yNgXlDZRfuLmKrFr6kDrO9fY92WsRKzx5G3cc4I6d2FHpytZ51h2Y6XUvN/OGIhYdS +TpoEWZZHUOhTgpijBWGngsgOU/1nmfTF+BFuIzkYEKZDC+it4qypx+kD1E4xVlmwH4t J3LWKujsdtu8yQnHK9VGNddSshn4UlIqXZviInBJXB59jxYFez7Ml5eeiPBJAGjuYT26 8Jmmb6LjmEUTo1r9U7COPmeCP4Vh7Wj90XJakhxjGT5C35ZwhFE02ndk9pTy/ie347xQ nQq1d2ki/lBJlXek3nFsI9eDVeZxS8RY5P1SwifWxcMeKuwEYjRXIHZpJYlPxk5mo+j7 sjTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aDvCw3YBO/GS6/+bgAOGOPgdS6UiCEW20IJg0wws7eE=; b=xdttsFn2KtYrkUvM0AhIB69TeQGQ1Xw++HWGrgw85M5VaITkbIZvDhMIoAUb3wDRO7 HfzCOgmKW0WbycnNQljl03pVNsaJ1YM0oVI8GhMkD1OxbbYMUU/50VwycEJoI8yqhYLU QMZc0xzeo8agRhaBbsrzCy2xSHQ5YjZQOnLgpgxpZd5YEWiiE6d+1Fxha+gQfg5onsQ2 PW+vHkZuQPWAIpLHIVsX8fBgdr+ydoxAw40aVtday3lvKE82fq2uTSlX7qjLm8mrzDpA SquB3UzBACkie5PBhklUOCzBAi3UAKSBtpGpIWiwBUDddUn5LS81i3mSugfIHnb+CiCK GLtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VTha+6Mq; 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 t19si227747pjr.68.2019.08.14.10.28.15; Wed, 14 Aug 2019 10:28:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=VTha+6Mq; 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 S1729097AbfHNR1m (ORCPT + 99 others); Wed, 14 Aug 2019 13:27:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:52000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728917AbfHNRDW (ORCPT ); Wed, 14 Aug 2019 13:03:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AEB34208C2; Wed, 14 Aug 2019 17:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802202; bh=YEuwsiOPbmEY4UEHEL+C4JDBIzmOVxcNTaAVUFAyJ+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VTha+6Mql4UnHliFmsVqIrWNgnCM4axsLB7LMO8Rxf31CNEcF/bU1t7sg+t+vScfh pO+CGMTCpefbBhqQv0WYAtTKn1R8oP8HTaL4b7OE+YWj+WDDyIwcJhfoj9SkVGS7rd Dee5cLcRPBvxZK7luo7ERPX+erVKtbgr8rs4m1vk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tetsuo Handa , syzbot , Laura Abbott , Sumit Semwal Subject: [PATCH 5.2 009/144] staging: android: ion: Bail out upon SIGKILL when allocating memory. Date: Wed, 14 Aug 2019 18:59:25 +0200 Message-Id: <20190814165759.881400292@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tetsuo Handa commit 8f9e86ee795971eabbf372e6d804d6b8578287a7 upstream. syzbot found that a thread can stall for minutes inside ion_system_heap_allocate() after that thread was killed by SIGKILL [1]. Let's check for SIGKILL before doing memory allocation. [1] https://syzkaller.appspot.com/bug?id=a0e3436829698d5824231251fad9d8e998f94f5e Signed-off-by: Tetsuo Handa Cc: stable Reported-by: syzbot Acked-by: Laura Abbott Acked-by: Sumit Semwal Link: https://lore.kernel.org/r/d088f188-5f32-d8fc-b9a0-0b404f7501cc@I-love.SAKURA.ne.jp Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/ion/ion_page_pool.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -8,11 +8,14 @@ #include #include #include +#include #include "ion.h" static inline struct page *ion_page_pool_alloc_pages(struct ion_page_pool *pool) { + if (fatal_signal_pending(current)) + return NULL; return alloc_pages(pool->gfp_mask, pool->order); }