Received: by 10.213.65.68 with SMTP id h4csp1401041imn; Wed, 4 Apr 2018 19:07:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+aIH/mUedRlMEAdzCDadp22i6PInmlJ5gDOHxSX8d0Pl3Bguh6oycLoM6lweIPQJFuxW1a X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr21488072plp.355.1522894022236; Wed, 04 Apr 2018 19:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522894022; cv=none; d=google.com; s=arc-20160816; b=eB7EwdDPmom+EUvb7nVRM1K465BOtSI1qRffDGM6ySfoP3eg6MCzOkHIeYAdOBNP8m EIqeVr/l4tWcg/t9R3K1324ecU1EjAc9Ic4SCWTnj1xJZ6cev3fWm3tEHIB8/YHiWnbG 6ID+gCfKzgddPacCh/42KonjBJMHmYw6F/c4BADs8yMjhUdjRzOaaF7TRIi+tHkKHhCf RnkNL36jXgHcr3BtbgFOGLpG/ZPyej0E8DQgX+qVDjb7kJrCSjxT2Zm9Js41gaSuGuXV UDoJaCG85GrN5bjblL/N3uWgAxM5Z6rA4wCxi9zXioJ1dOAVx59ms9gWBGg0iY+qsoiH HxRg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=ByyIjeGJKNmICDTsPuQbR/j39Buu7kp+iUTKk60sszo=; b=Xctm/9G8s2hsmLo0UDBnDv+noDzQ8rrD9Fiblto25UO5WPoKC/qXpGP7HcSb1f2/Xb 8G/wjApwjFWLZW7Y0G1Qq+7L6RLlBaUsLVqezbtyEtSj7iClmLAlL6gnVLfW7IgankJU fwOJiS3PuFYic+wKfLRz1O4h5XIm20oCGtvqCutEmCY8nPn5Ghof6gXlkTc/33jV0Qzx V3PdXQV1oWEdEyIYZuefrzFMLqf8OLJOQgZsDxqQQO1da4fXjkvreE4EAjCypJdn+qnl Vl1rqFsX7kvVmZ6onpqczIWnmIAFaaYaA4UMs2SccAFI6OdqlB56uEas0BGFJTBXWEEg UwWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Hxco/Tmk; 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 b72si5267656pfk.135.2018.04.04.19.06.48; Wed, 04 Apr 2018 19:07:02 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Hxco/Tmk; 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 S1752816AbeDECFi (ORCPT + 99 others); Wed, 4 Apr 2018 22:05:38 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60298 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbeDECFg (ORCPT ); Wed, 4 Apr 2018 22:05:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ByyIjeGJKNmICDTsPuQbR/j39Buu7kp+iUTKk60sszo=; b=Hxco/TmksTsz6nFkcSVRbVDyx aU71rILDRYdNhAg5v4uCAixWFCIzkgRDD8Sbtzfuf0Kafepnew34ZXNlIqaPUtbKBe7V/EnFGDQT0 KVhj5q0bH/ok4T3qhB95fUG++nflZZNNiKmo+fJdhKk2C4HqBBf7FvQMLSTkYricE4uAda6LUAbiJ HKxR/jrB15Cj3Jko1FIUHjCot4Q9a6TGSAa35E0Co1xVzrZipLMCZLL23tkAjMsmVrQOs9vYC5/uf 7gDQI50BCh1RypgC9grz4BZRTozMzeUL/BV2yj01cyN67Uxc4Uv2UhYwxzB70Fb08SIwW/Ce538TQ lnO1RoKxw==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3uHM-00009K-Mf; Thu, 05 Apr 2018 02:05:32 +0000 Subject: Re: [PATCH?] reiserfs: prevent panic: don't allow %-char in journal dev. name To: Jeff Mahoney , Andrew Morton Cc: LKML , reiserfs-devel@vger.kernel.org, Alexander Viro , Jan Kara , Frederic Weisbecker , Artem Bityutskiy , syzkaller-bugs@googlegroups.com, syzbot+6bd77b88c1977c03f584@syzkaller.appspotmail.com References: <20180404184517.9f2b91b856a56f71464f5f7f@linux-foundation.org> <5e9ea36a-6a6a-921c-81b3-bc623a9e125a@suse.com> From: Randy Dunlap Message-ID: Date: Wed, 4 Apr 2018 19:05:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <5e9ea36a-6a6a-921c-81b3-bc623a9e125a@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/04/2018 06:48 PM, Jeff Mahoney wrote: > On 4/4/18 9:45 PM, Andrew Morton wrote: >> On Wed, 4 Apr 2018 18:25:16 -0700 Randy Dunlap wrote: >> >>> From: Randy Dunlap >>> >>> If the reiserfs mount option's journal name contains a '%' character, >>> it can lead to a WARN_ONCE() in lib/vsprintf.c::format_decode(), >>> saying: "Please remove unsupported %/ in format string." >>> That's OK until panic_on_warn is set, at which point it's dead, Jim. >>> >>> To placate this situation, check the journal name string for a '%' >>> character and return an error if one is found. Also print a warning >>> (one that won't panic the kernel) about the invalid journal name (e.g.): >>> >>> reiserfs: journal device name is invalid: %/file0 >>> >>> (In this example, the caller app specified the journal device name as >>> "%/file0".) >>> >> >> Well, that is a valid filename and we should support it... >> >> Isn't the bug in journal_init_dev()? OK, thanks. > Yep. That's exactly it. > > Acked-by: Jeff Mahoney > > Thanks, > > -Jeff > >> --- a/fs/reiserfs/journal.c~a >> +++ a/fs/reiserfs/journal.c >> @@ -2643,7 +2643,7 @@ static int journal_init_dev(struct super >> if (IS_ERR(journal->j_dev_bd)) { >> result = PTR_ERR(journal->j_dev_bd); >> journal->j_dev_bd = NULL; >> - reiserfs_warning(super, >> + reiserfs_warning(super, "sh-457", >> "journal_init_dev: Cannot open '%s': %i", >> jdev_name, result); >> return result; >> _ >> >> > > -- ~Randy