Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1080805ybl; Wed, 14 Aug 2019 10:22:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmpK0R1lMejakX9jzd2hObaoPXLHvcSe5chGzZSY2AFJFmhq655/zokQeIwx7XFxdeHLOW X-Received: by 2002:a63:2cd4:: with SMTP id s203mr216517pgs.19.1565803378900; Wed, 14 Aug 2019 10:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803378; cv=none; d=google.com; s=arc-20160816; b=EuziK57KZQ4CwgXJMWuwUO1kUc9qCFAcqL6xneaC5dincJj01yzKKqOeUBV5r1ltDL dzCkd9jT6T4YCR/afV2ZkmH29mdb8SsR9GMDiZHTxzwSL1pMIC8Pb5rQxZUEozrEoKct 9Lt8jVP8Xx+/qwN1ZjMPY6QadOwjAJtCoZkzQQB+zTDpxLnyEVBmr0o7YsIW2AcDpai4 txyTUl6+8xHzBbiOQfsifsv/sJ7CDy3JiRClPppHs35WaPAhAvsZjY5ygrmfIierHnJa MGZ+Lk8nGqTIbXdl55m6OS7hlPatbz6KfC/UQRRDKdx9OMGTCi4huxgiauCt4etPJM8K W1Ug== 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=RYDU4LkGFZUMbYQpkgmyUKUK9kVSZmzDiZl6rTqIsAGKuOty9Yen9wytlqk7XkmwhL +9RvS+0WE37oWhPhkypZkEUxKfS2BeOaqTYXHhPSO+GPTV1NKBEAQk0ReOPGhkdz+Lpg NViApa2+l/ipGPU51uaFGQvW6GOCAjMCN4FBjpAET3Fv0xz8HwOtsJnYuecoCFNIuoWN CdkwNADu1JG1YQOTwcWv0arkSVZd7r//NaJu5yWp/WJNPGlxuvJQ1h7CEAmoiWVD4nkd t0XLWlypOrlejaZE/NTSoZ1w1HnHdu4OTB93sH1nJF9g+oS/lVvxlDY6ru34ZN1f77r7 8O6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GISj+ZyX; 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 w8si191186pgp.414.2019.08.14.10.22.42; Wed, 14 Aug 2019 10:22:58 -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=GISj+ZyX; 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 S1730264AbfHNRJE (ORCPT + 99 others); Wed, 14 Aug 2019 13:09:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:59276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730257AbfHNRJB (ORCPT ); Wed, 14 Aug 2019 13:09:01 -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 F2A72208C2; Wed, 14 Aug 2019 17:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802541; bh=YEuwsiOPbmEY4UEHEL+C4JDBIzmOVxcNTaAVUFAyJ+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GISj+ZyX8rBeh4zgvNQcFbzP5fd9sID46mXQUoInKyqgVkBcSMyRrUlyeKH+zTwEA Bd21PmQTn5aS/s7WtaenzxuzWghMrZz6EvwJwe+k69yp2FoM2MuSaEkKB/oqlqvpsl VIvCYobw6I7CFWCcr9i51MAPfsm4QL8GWN/X0qPM= 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 4.19 04/91] staging: android: ion: Bail out upon SIGKILL when allocating memory. Date: Wed, 14 Aug 2019 19:00:27 +0200 Message-Id: <20190814165749.236426007@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@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); }