Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2079944imu; Sun, 16 Dec 2018 16:26:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/VZRNtAl2JtJ6Bk6ubmolKygBBF6/UYcUQxp8MpWUtOaBdJQIooHGq81L2GTOxsPWQcgwu3 X-Received: by 2002:a63:4948:: with SMTP id y8mr10353709pgk.32.1545006381130; Sun, 16 Dec 2018 16:26:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545006381; cv=none; d=google.com; s=arc-20160816; b=e5rBs7sN/Ymu2uM+rMeQvFDCBaNn/ZYF3Zck3xw9aVVAswPvf2QbnJI8D+99l69LWR 4lXlotC7zeGYwDyLPlGxVgFBMaZhjm/7F0xMMrS4XVAN5XgeJKnxXZDDRr/KEcbQQpXW NAFJUKc3K95ysRQvJWNRzTmdsapRxzNgp2cRJ9zomjV9vwGJP2eC3bythKPXdPXQyECY NNt8QP3YeNo1nX6fhLMr38KufB+fhA11Gbd7ZMIM3EwIZNTC5y+sA72d01hjg0xcV8ZC b/e4Pn0secpMJhPIVzc7X3r+yLhJh3TB3h2ZkqaHZBrpIaPuJ69sXaIAzl6zmdMtpM8E VcCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LfUSmwDuqBqAikgSwV2pPocAsayQs7nw84OxK0kY2+M=; b=SGi7sxWHlB3hlEDTfMVhLPo+LO9NxKlIfqQo7ZcRXAUUCztWwQfEEeLMraPgY046rZ hibVE13oFBIX/BSyvpW5crsc47sEEU50MPjlp613fOhTZp+9LfwtXvS0HcuK89DQt8JA w2t4TVcospQ50rSVbSaoFmt7NqWjpd2R4DHS67LCPg229MRq7aClnHTHE9As2ToAQZoV Cyuiz9ZcmyACp5ButLYCl0yri0Z+kobkz9jQrTQXigDRm+EwnRE6YO4eCxcjZDWkGVrJ eTMnANwe7YsmWWNL4xLtPWf0JRFSpdqART70yAyQxkyHRanBeDAmfQO11stV3nxPfuUO RohQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bNV+KDNc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si10235072pfe.243.2018.12.16.16.26.00; Sun, 16 Dec 2018 16:26:21 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=bNV+KDNc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731064AbeLPX5J (ORCPT + 99 others); Sun, 16 Dec 2018 18:57:09 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37780 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730719AbeLPX5J (ORCPT ); Sun, 16 Dec 2018 18:57:09 -0500 Received: by mail-wr1-f66.google.com with SMTP id s12so10079424wrt.4; Sun, 16 Dec 2018 15:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LfUSmwDuqBqAikgSwV2pPocAsayQs7nw84OxK0kY2+M=; b=bNV+KDNcg+CKpukYU5YtjqP2UhnVgWM45TDBQMMFZ/0gmaV3a6d8b2uefeFGGhoXfV XoA5G7XZuB49vj/arGPh0a5ejPPBwwc1+j+kEustXG+JHvw/2dP2Ua7GC6DTTZz+Jmtt UCyE7bOqDZOg0e/370+8f64x5MTnoDbi91jvrGYrYxA5NDLxK0b4fCt5EsEERO4RQMyf nTQS6hTF/c0LFbfazWrI/mho4GsujifkKc3hMAo4IINbVYcb5Noaj0j+uQ02u4DFJnA2 VtTggorZ/7FdyMtfN1XLu3jt/YjNOjoYhgWeUXv4DNAe57OxvgYo7CqqEqgJYM78jz0k jG2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LfUSmwDuqBqAikgSwV2pPocAsayQs7nw84OxK0kY2+M=; b=Az5waer2Q4Y0pVps09u+fXIU4KnpKEL+LChNXwFErIEHWFAaGd+qvGSa/giugwuI+j KD59S58PTKs+PqF0OLwZPvt5m1wVZpKwvjTCMOuoc/ZrbY8FCt/DmRTjwU9SBsXYh+5g bpZrcROErqCtGPX24mHXCrpA5CRyD3UxEHEyYA2m2027vp8ayJMLrrt4R6HZyFwOTTHp zTBM5eAuPlbQTkStUtr8WRUSWv8jdczhhb1px5a6q5aoBylwHv5lyxr0a7a/nFPGgguj jOTf6W8i1/qIXmL9Vg8McYkXDM8Urrk0MsAosZ44VtBlTQ8XkwKfH8R52j/dDmYCFktk L7bA== X-Gm-Message-State: AA+aEWbzw8H1vqnT/O5uq3ClQWXO60CeNL5spt9Dac5vepTZenVRMa3N Ee4hbBJkiicByYOCVn//MwMQ+OfCEkbekKx8KyE= X-Received: by 2002:adf:ed46:: with SMTP id u6mr9203577wro.262.1545004627192; Sun, 16 Dec 2018 15:57:07 -0800 (PST) MIME-Version: 1.0 References: <20181020120849.65708-1-houtao1@huawei.com> In-Reply-To: <20181020120849.65708-1-houtao1@huawei.com> From: Richard Weinberger Date: Mon, 17 Dec 2018 00:56:55 +0100 Message-ID: Subject: Re: [PATCH] jffs2: ensure wbuf_verify is valid before using it. To: houtao1@huawei.com Cc: linux-mtd@lists.infradead.org, David Woodhouse , LKML , stable , boris.brezillon@bootlin.com 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 On Sat, Oct 20, 2018 at 2:06 PM Hou Tao wrote: > > Now MTD emulated by UBI volumn doesn't allocate wbuf_verify in > jffs2_ubivol_setup(), because UBI can do the verifcation itself, > so when CONFIG_JFFS2_FS_WBUF_VERIFY is enabled and a MTD device > emulated by UBI volumn is used, a Oops will occur as show in the > following trace: > > general protection fault: 0000 [#1] SMP KASAN PTI > CPU: 6 PID: 404 Comm: kworker/6:1 Not tainted 4.19.0-rc8 > Workqueue: events_long delayed_wbuf_sync > RIP: 0010:ubi_io_read+0x156/0x650 > Call Trace: > ubi_eba_read_leb+0x57d/0xba0 > ubi_leb_read+0xe5/0x1b0 > gluebi_read+0x10c/0x1a0 > mtd_read+0x112/0x340 > jffs2_verify_write+0xef/0x440 > __jffs2_flush_wbuf+0x3fa/0x3540 > jffs2_flush_wbuf_gc+0x1b1/0x2e0 > process_one_work+0x58b/0x11e0 > worker_thread+0x8f/0xfe0 > kthread+0x2ae/0x3a0 > ret_from_fork+0x35/0x40 > > Fix the problem by checking the validity of wbuf_verify before > using it in jffs2_verify_write(). > > Cc: stable@vger.kernel.org > Fixes: 0029da3bf430 ("JFFS2: add UBI support") > Signed-off-by: Hou Tao Reviewed-by: Richard Weinberger BTW: Are you actually using glubi? It is on my list of things I'd like to kill. :-) -- Thanks, //richard