Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3396271pxk; Mon, 21 Sep 2020 12:32:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCmw8Ck0IAkX06I3Vlcn4GFqN8uasSpsFcWnb7HcPQvtUhPI3TGiF3Iyhrlv8kaI+PIJzh X-Received: by 2002:a17:906:4b4a:: with SMTP id j10mr1063371ejv.498.1600716775436; Mon, 21 Sep 2020 12:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600716775; cv=none; d=google.com; s=arc-20160816; b=UcpklWTSbJN/d/NOgPkzxNmQq/u1LRz9nw1ws6KxSAn+QJGZ9/z0CmP2vqsdEPC2d0 aEBdIch2ltVYy8qG/yLTvs43zciBrhRTWLJVveK1da4zH6N5J5Jry1q6vIpfqdHkkCeN kdnS7P2fdcNJmTGB1OFkPPj7uAn7T/n2pd6pUbtYTOWhtWMlz/V+U9qWQS1ajlPO7lNV KRG9CbZmbQdepuHVWQREbiNJT7E1BKe0bxbOzUggtVPHjSMSbsQoy0sGD+FB7ylE6S5l yg+JvTDJ5ImkKaEXKbdQNez1ovfW8DeGTuWW6nwrZXwbB0XLMvmLjhOL8oHURINJMokK DlFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=TN7gESgeVk5LSLZMaZh/DeQMiRpBcU2vvoPv2iN4F6g=; b=ePHeZH13Hjs/ewP53nNWNoF0BgHXPMreAkaCqTcJD7pA+A+PNqE4rxBO292lhcPXuq XVbOWgjjsXPcSZuzAR89ZVasTk2ZzK2aE4IMgMYnbt6BQw2oGzGuMYzfksLSz+MIc5MZ Fa/h8Cj5BdIungmKdsG0maEvp1y13AL39yZ2l3DoyCU30vuuTgx7Niz73tcZc4n0UtoL wmcRseJbqB7vQpyKt7CfjD6vzfRmTsb7zJ69EAfGjTxpocyMyFn2qDcShkEUvKyAQUcI qusCGfL4why/tlYRl7XYW/nTyDakfyt1agGC7Zh4XDA5haFS1jzqQj5oGgj4AE1LY5uP v0CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si8692544eds.204.2020.09.21.12.32.32; Mon, 21 Sep 2020 12:32:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727529AbgIUT3d (ORCPT + 99 others); Mon, 21 Sep 2020 15:29:33 -0400 Received: from smtprelay0205.hostedemail.com ([216.40.44.205]:45316 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726471AbgIUT3c (ORCPT ); Mon, 21 Sep 2020 15:29:32 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id A321118029124; Mon, 21 Sep 2020 19:29:31 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 30,2,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1539:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3834:3865:3866:3867:3868:3871:4321:5007:9390:10010:10400:10848:11232:11658:11914:12048:12296:12297:12740:12760:12895:13069:13095:13311:13357:13439:14659:14721:21080:21433:21627:21939:21990:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:1:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: linen39_0e1404b27147 X-Filterd-Recvd-Size: 1634 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA; Mon, 21 Sep 2020 19:29:30 +0000 (UTC) Message-ID: <88110ffe6b08a2b403f30f4ea7463d5dad50b80b.camel@perches.com> Subject: Re: [PATCH 1/2] dyndbg: dont panic over bad input From: Joe Perches To: Jim Cromie , jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Petr Mladek Date: Mon, 21 Sep 2020 12:29:29 -0700 In-Reply-To: <20200921190433.1149521-2-jim.cromie@gmail.com> References: <20200921190433.1149521-1-jim.cromie@gmail.com> <20200921190433.1149521-2-jim.cromie@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-09-21 at 13:04 -0600, Jim Cromie wrote: > This BUG_ON, from 2009, caught the impossible case of a word-char both > starting and ending a string (loosely speaking). A bad (reverted) > patch finally hit this case, but even "impossibly bad input" is no > reason to panic the kernel. Instead pr_err and return -EINVAL. [] > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c [] > @@ -259,7 +259,10 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) > } else { > for (end = buf; *end && !isspace(*end); end++) > ; > - BUG_ON(end == buf); > + if (end == buf) { > + pr_err("expected non-empty bareword"); missing newline This message is also unintelligible. What is a non-empty bareword?