Message ID | 1496634360-8338-1-git-send-email-baijiaju1990@163.com |
---|---|
State | Rejected |
Delegated to: | Boris Brezillon |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wh10F3wkLz9s7C for <incoming@patchwork.ozlabs.org>; Mon, 5 Jun 2017 13:44:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kCytekO0"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.b="O9kkUoAV"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=4CDn5EdlSsCoZxnmcEJtwYa8/mBYUdCcMe1e2jNgt8U=; b=kCy tekO0kKqWDZNJCMo/gHrKSIsbnwETC93f33X0hEAeJusO2uPJlIqlx4tPi2z/Y6n40gMFCp2zF+JS 3ZIpo9zMB7WD0mBodRN2nS6VHDLABH0Vo2XT/K6ECZGH9h07qLraqykPUmfHgvqDNn74gBsWcfIq9 GVdVfWEplT2NNij0g5zTwzgfhZMnp4O/Eob0Ekcr9O9E0w6ekY9vPKwom+sAtf1F9h2mp8MS/WlWL L8ipqTPYMAHgjbtHiXUSAwCLyAbmBgVXCwwUpeZAX2HXZKi1E6BQPiEy982SXO0c9wWGe72upXBJ8 3xyFBYgE+f40ArGPbAE5QfjmMFiksHw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dHiwL-0008MX-FL; Mon, 05 Jun 2017 03:44:25 +0000 Received: from m12-11.163.com ([220.181.12.11]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dHivw-0008L8-J9 for linux-mtd@lists.infradead.org; Mon, 05 Jun 2017 03:44:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=0JOuyIYDYRziwyVbYq QUkDTYnJ+n46sR2ChuhLWZqmI=; b=O9kkUoAVcscBSjvSJ0edmhz63N8a5QP3tw PuMkHqg6w0I2426xb57tSlVHoI9P72JOMv6Pb/u0k5uw9f0GKjlrbpGQLM6KGBKr 9t633xB/0y0sd+r6S2BnCjogu6cZvGgpTaw8TrbIpRURBlIlVlYyygIP9sMheG7b F5l+jVLhs= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.19]) by smtp7 (Coremail) with SMTP id C8CowAC3xhJm0zRZGBMEJA--.42698S2; Mon, 05 Jun 2017 11:43:37 +0800 (CST) From: Jia-Ju Bai <baijiaju1990@163.com> To: richard@nod.at, dedekind1@gmail.com Subject: [PATCH] ubifs: Fix a sleep-in-atomic bug in read_nnode Date: Mon, 5 Jun 2017 11:46:00 +0800 Message-Id: <1496634360-8338-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: C8CowAC3xhJm0zRZGBMEJA--.42698S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7XryfCw18tFy5uFy8Jry8AFb_yoWftFc_uF 48Cr15Ww40gr93tr45Cr4xGryqq3Wq9ry0ya1fAFya9Fy5JF15X39rArZxGFsruFsrZFW2 yrZ5Gw15ur1jkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbCJm5UUUUU== X-Originating-IP: [166.111.70.19] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiTgntelUCyNJ2pgAAsN X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170604_204400_983993_06BA8AEE X-CRM114-Status: UNSURE ( 6.30 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [220.181.12.11 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (baijiaju1990[at]163.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (baijiaju1990[at]163.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [220.181.12.11 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Cc: Jia-Ju Bai <baijiaju1990@163.com>, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c index 9a51710..fabe2fd 100644 --- a/fs/ubifs/lpt.c +++ b/fs/ubifs/lpt.c @@ -1268,7 +1268,7 @@ static int read_pnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip) branch = &parent->nbranch[iip]; lnum = branch->lnum; offs = branch->offs; - pnode = kzalloc(sizeof(struct ubifs_pnode), GFP_NOFS); + pnode = kzalloc(sizeof(struct ubifs_pnode), GFP_ATOMIC); if (!pnode) return -ENOMEM;
The driver may sleep under a spin lock, and the function call path is: ubifs_change_lp (acquire the lock by spin_lock) change_category ubifs_remove_from_cat remove_from_lpt_heap dbg_check_heap ubifs_lpt_lookup ubifs_get_pnode read_pnode kzalloc(GFP_NOFS) --> may sleep To fix it, "GFP_NOFS" is replaced with "GFP_ATOMIC". Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> --- fs/ubifs/lpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)