Received: by 10.192.165.148 with SMTP id m20csp2465866imm; Sun, 22 Apr 2018 07:37:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx49xYQYJ/1xJHdVWURc2XVPzjgUbGiLVdD5BZpR0sMK30i+3ZkjXL0bq8c4xvOjk2fm+EG3w X-Received: by 10.167.131.146 with SMTP id u18mr16821797pfm.199.1524407832895; Sun, 22 Apr 2018 07:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524407832; cv=none; d=google.com; s=arc-20160816; b=q3xWUv0qyodieNxxNWZvcN9GXESlHXtWWnYL4NSDXOCw0eW/TtT9Xsu6YneJAl6Z0X jGM1UgLA1Ro9tCjloPqBKdGvxZ+EJlLf+LYybJwZGRmXtEy1/Y3x38EFq5j1Pt/wqQxw 38Aqa1gZVSJtR5v37Oenj/21sDeXolCOkKD1R4e0/wqxH2pxKaffoHdimXtTlS1MhYBy 2+v67d5i+l61HpUtJdF1oh19lxtbOyWwMVSbEUwCqqUmZvk3vsSH+yV48NdQzRX9f/dk 83JaH4Ax8pEGqvdYbMyDjuTi2QS3nxnzPy4sDt3VoBnD3NssvyWQbBShjGt+Gu/s0R6B dGRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hBQ+ZQUD2QSp1XU14UWyeq3O3IZSGeYaE0oJzy8aa4Q=; b=LLNq55bwL0KoeTM0RMdEdZUeB+iV16XGjZAu8W9wRsTaaCtcXPiWIohf34Gcoc2bOg rMgLQWqmKex44EqipWDGd7wnDh7P3zVVA1I/rwbHCVgiqguf34Cz2EVMdQZ5ft2NPuJY kzEWh8eyOBP+HeV1NSWyEJgpSeaTxDZSldnbmnUrHxoPc4cNHcMDAe4EZb+1FZdVEjbl lxSZFSTCRb57A2JUkPqlxaJAVGAsIROCtIVPTEMZelE1tty6iTiA0ZKjhTsGuI0YHjep PUNhUF+pVdAeqU08dkNicm9fE0famBHHWkFdq2xhGycfEMGeUq5jW76XfwbMlGknzvP0 /gow== ARC-Authentication-Results: i=1; mx.google.com; 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 h32-v6si9477019pld.170.2018.04.22.07.36.45; Sun, 22 Apr 2018 07:37:12 -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; 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 S932587AbeDVOTP (ORCPT + 99 others); Sun, 22 Apr 2018 10:19:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59304 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932548AbeDVOTD (ORCPT ); Sun, 22 Apr 2018 10:19:03 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E9888CF8; Sun, 22 Apr 2018 14:19:02 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Al Viro Subject: [PATCH 4.4 88/97] jffs2_kill_sb(): deal with failed allocations Date: Sun, 22 Apr 2018 15:54:06 +0200 Message-Id: <20180422135310.002516046@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135304.577223025@linuxfoundation.org> References: <20180422135304.577223025@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Al Viro commit c66b23c2840446a82c389e4cb1a12eb2a71fa2e4 upstream. jffs2_fill_super() might fail to allocate jffs2_sb_info; jffs2_kill_sb() must survive that. Cc: stable@kernel.org Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/jffs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -345,7 +345,7 @@ static void jffs2_put_super (struct supe static void jffs2_kill_sb(struct super_block *sb) { struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); - if (!(sb->s_flags & MS_RDONLY)) + if (c && !(sb->s_flags & MS_RDONLY)) jffs2_stop_garbage_collect_thread(c); kill_mtd_super(sb); kfree(c);