Received: by 10.192.165.148 with SMTP id m20csp2478639imm; Sun, 22 Apr 2018 07:54:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/YyGeCo1AeEBKK7ttSfE96UaqjKKmuv4DcrdJ0IU+w4pWUTDpoYnN/jv4S6S/9rdiXpCPl X-Received: by 2002:a17:902:6d0f:: with SMTP id s15-v6mr17461951plk.241.1524408847956; Sun, 22 Apr 2018 07:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524408847; cv=none; d=google.com; s=arc-20160816; b=pQ/SNcWiU//stxAhiK5ZrTuM3Qd1rOTdwS6nvJUs+a8UZFia/ohah7QSHryQLTgvaC bN8juzSmpnTskcF0EQOnBic3Ii9+Wv4nbnkKtk9Qh6JUjiA8WP68J4SeDu+XmIUecPd/ //NCLUY9sGzTV3bj5kyfnZwa/lfAWllPxYmELrNKHS/+rBWLIbXQbsO1dHBwoQeJFMUe 8Ax3BpOR/qxRg0BWIMki2SjWt/vvoW/dD1PYJx958y+j9cs7iIspj12n7aWNuzWt274I yRxtNTEyWFkF8E0EmiONjdjmVrT6thCmFViNJGPLISQ0LDhnPoof+RD6Xt7YkE7xZN1Y 2UCA== 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=RsXLrIoYCQPZMCfT3e/SV1v62+BpsP6n2gfmX/eXiow=; b=wcHDPuvE9U9I3gsBV8ZxPITjW+47C6QAJOs2vKtDf+B7X0jJGBfExsuyg1vgU9kQJD KeyWCEoxYpa++MLXC6k75AxUGhMK/fdssTHGljp5/VjAId/IlhcvSOK82qIo+oH4EZUE JJzr6Agrt7yQuPfJrmohsIGN0iOmHWEGvNaYbQl3DvrgHJuP4wiN9iVvOpMktT33VwPp ChH08YPIzEm+ZN/hLNx2iuT6dPQZqixatJz5nqcZ8i8VsohJJxaHwjA4hwrZ+QxvukvK RK080dTiSCOqCwH4rdcM5EdiPx2Vj02nweDw8WnOqHDotKWScPkutyvU5EeUYAl2/2e2 3dZg== 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 u184si3316081pgc.223.2018.04.22.07.53.53; Sun, 22 Apr 2018 07:54:07 -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 S932075AbeDVOOu (ORCPT + 99 others); Sun, 22 Apr 2018 10:14:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56504 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756977AbeDVOOj (ORCPT ); Sun, 22 Apr 2018 10:14:39 -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 4AB345AD; Sun, 22 Apr 2018 14:14:38 +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.9 86/95] jffs2_kill_sb(): deal with failed allocations Date: Sun, 22 Apr 2018 15:53:55 +0200 Message-Id: <20180422135213.954335057@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@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.9-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 @@ -342,7 +342,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);