From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3129C4363C for ; Mon, 21 Sep 2020 19:29:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A439216C4 for ; Mon, 21 Sep 2020 19:29:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727931AbgIUT3d (ORCPT ); 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-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?