Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2377806pxk; Sun, 27 Sep 2020 05:30:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT+jkdBb09rtki2FI3gdstZm2cXbJrvh1cxv0yhnVirXCYIn9hjc/lNjXR/DDI+aJljmjC X-Received: by 2002:a05:6402:1495:: with SMTP id e21mr10587797edv.146.1601209834158; Sun, 27 Sep 2020 05:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601209834; cv=none; d=google.com; s=arc-20160816; b=sLzTUFfgw2L8aX/XQU403BVK31NpdEQuPrPxqvoTTGLRC1/lBqLqPDcdricVWkLUO2 glx7bNmWL4Dt6UjZLiAZ7X1wlBoRJ5xVkemBlD+DSRfmoR5DNwgkaN9yPy4MohJR16eY 558hP7YKmqeC00ORFvim28JLjhkvwuvPO5jkl/yuB8OtzB/oL7HYyp3TxhrbAB/ecA2r M9cwikV0UCRY34UnjE0gH96stpjV4PTLQGAz2EPpBU6IIZTWo+l8NUNLdPMpwn/CfcaM /NQEe0akwmr+fpw0NajOhF/NHacadYEqWK8toTNtolySKqpDJleRSFnius899GI6D29b PtDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Cp84rNDp5VIIysS5QkIufZWPZSw9weiO69l3I/AVep8=; b=M0W81w3cH3DR7Lr/1O6BOuxtT8l7VBnObHAplh/l1iVoowpxWBdNRwdWJFt1D+6Tgj x8TazvFYPgP0pOXCbIwVEK7HryxlcNlKqn1fJmZ1algQedW9BX/Qp8oSAnwdoqR9uBjY hAiECJvQZRD7Fp2C5I3nc7EtmSam51f6jAXzsNAqXD3Kd+jroSuFctKtq3l/eQtNlzRl +x1UFu94eIqXAeDhtbvIBhGgAfsxMzZDBZ+Xi2PLABts2uqfrH4xhUSon49adTokeYF2 MSpFXZ3uuwB71ws3KVf+ihKjX8ZuJdGZNqiwB2+dDSYgpVnKZDtkpoJjzc+O3cNvtbcC jByw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H2Eaiv46; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q20si5494464ejx.248.2020.09.27.05.30.10; Sun, 27 Sep 2020 05:30:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b=H2Eaiv46; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726424AbgI0M3F (ORCPT + 99 others); Sun, 27 Sep 2020 08:29:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:38064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbgI0M3E (ORCPT ); Sun, 27 Sep 2020 08:29:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E05B323718; Sun, 27 Sep 2020 12:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601209744; bh=j0QP36WYATNJ3FwgZM1LE2LH5S0hG8ZqfT3GRwI76rw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H2Eaiv46cvZ9UJLIVHzO2imJDClR2H70Rrqr5W9zQ7ZkqOI1AlQ/jx6gSrh6AAfm/ bSjF0DzbkcFrS8yz68kK7FQQdFUnlRYmxunC/TR5ATCcEc2oxVk+txiohasWQt5fvo TZ02zW5xc5BCy1eXEDFAFBkufXgsfygWrzr70ZRM= Date: Sun, 27 Sep 2020 14:29:09 +0200 From: Greg KH To: Jim Cromie Cc: jbaron@akamai.com, linux-kernel@vger.kernel.org, Petr Mladek Subject: Re: [PATCH 1/2] dyndbg: dont panic over bad input Message-ID: <20200927122909.GA186979@kroah.com> References: <20200921190433.1149521-1-jim.cromie@gmail.com> <20200921190433.1149521-2-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200921190433.1149521-2-jim.cromie@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 01:04:32PM -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. > > Reported-by: Petr Mladek > Signed-off-by: Jim Cromie > --- > lib/dynamic_debug.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c > index 2d4dfd44b0fa5..90ddf07ce34fe 100644 > --- 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"); Need a "\n" here, right? thanks, greg k-h