Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3691413pxk; Mon, 21 Sep 2020 23:16:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoA7MhNnhyrO9ClhAnVwHAfsWeqrGiZtRLHUfUrkGiF2Lv2QRE5XWN+EZgPrr2l3mLD2nx X-Received: by 2002:a05:6402:6d6:: with SMTP id n22mr2277083edy.79.1600755416789; Mon, 21 Sep 2020 23:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600755416; cv=none; d=google.com; s=arc-20160816; b=CP8DIesiecOEGilNfkFtK7VNMAnMAFC/gS/NOfJ/YCFfU+Orv4Wdq3Z7fNFIQnMB+U Y6DL9LfDc0MoWsnHPQmOr/UJ4f8VCSNu7s7Q5ivx4nr5h5KDeJAxovBTGiHGQtbfDQIb bsw1rVLyCYWl+lC2op2yP8Lp/TgxdK5IDWMCgjYlnF92j5bNfqVX8S1orlMlzLUnGrCN /3SRTNOWbjs1lfwQLgUBZr6ePU7OOxoZMEZBx0aXFUqVQSVyfMx1tPiqeR5s3mHwN6wX tfzP1YBZ37BY4/PJJIX1KOi3bWYupHy9fjJ8qldRvIHKh2LfVvNe8CAXYD6FaF6RgVTS jyeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EkUjUieCb6XRK6uMlDV2dbwExrL7ULDE403JBTQMbwM=; b=O0VwZPAOG32XsDYRym3cQqxodx/xYED2bJ2NQoUs6dtPbZn78jEAQR3gk9yBfm1y5k 393YR7VV/MrjponI4VyqtqkGqulWUwuWpwJdDJUSfhtWOa/BZxaNjHMjsp9cKMtqSLwE zG4EpM31oCVn9BNweuy8JcuY7tHKWG0Iy/cK+RIUjxfAyiBodYmAJJ1sl+1XEvCGwYSk QQXVi+cR5DGSHz0eK47r8B+M1q08Av8DJoG0t8bJc1igIE900D2TAeNanGXQXDnOSSN3 /CF9FA6wj5iPc5frbgHLByRKk0bVnXBQy3es4ZsSBV2XY5ZMzseKu8w1HDDzxqb1TdDO r+PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dPC6uIvp; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 40si10011132edr.35.2020.09.21.23.16.33; Mon, 21 Sep 2020 23:16:56 -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=@gmail.com header.s=20161025 header.b=dPC6uIvp; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728908AbgIVD5v (ORCPT + 99 others); Mon, 21 Sep 2020 23:57:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728897AbgIVD5u (ORCPT ); Mon, 21 Sep 2020 23:57:50 -0400 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19438C061755 for ; Mon, 21 Sep 2020 20:57:50 -0700 (PDT) Received: by mail-vs1-xe43.google.com with SMTP id p24so4516246vsf.8 for ; Mon, 21 Sep 2020 20:57:50 -0700 (PDT) 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:content-transfer-encoding; bh=EkUjUieCb6XRK6uMlDV2dbwExrL7ULDE403JBTQMbwM=; b=dPC6uIvpOEmGqHW4WivurYxYCFSJHZfgFJDFtzIWLMhx4cIEIxkN/KxiBhD5WJaVz2 aifgipxlkEm0y9WvPjFzVOZIfyBxc5IyvAKjZt/3hAYP5Lk4E4O8uOgNLin3Htyr+np8 sjtOgr918HNnA067xHasLX5RdXcQSi7kyAQw9wkrtx1bVAfAPEeFb3+mLXHgeLE+K3kg RBSUvRiojkRrFyfZV0/TeqgoH4JRDbg4mQBUEplTB/iTdeDnQQBLx8V8Sdsq6ttEvOsp Z0ze6VZks1W+IFccjmfAk2nEw+Fpfk/yeeqhhBAIBuRUDW6akbnLG8wwYlshF0Tx/SEe I8TQ== 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:content-transfer-encoding; bh=EkUjUieCb6XRK6uMlDV2dbwExrL7ULDE403JBTQMbwM=; b=jBlPsJl4tWAI6t9rfvD7joO4gHGk19NxuFqV6OpzPHlIIlaVP1jtfel7+SJpsa7tXc 75WPkiQoIQR9RsbmgrFCB/dhGaofCz8lGIApNNGLpdVcgsnB+2Jn5kMrkbUMdl5xVO6L FNc/H+iPmaWE42NpAKE0V77Ub9jWEuan59WWuwiwO3vwbLsqng5VlZQpbbtMerwiBWjA HFT1kdbD9tN0ndYeKL8haJ2wgxpxZdbVG/cH3tkPi/Ik6mViqRHzdcu4LZRHeSuW0pKd PGLwj4UNjbpea7n/w4rTOtbYmoR16fVAjfUdhVHXfkzFAR5UTyOv2o01hiKEsVJH6+Sw JxYw== X-Gm-Message-State: AOAM530+Lx9UrrGExU2Oo/oy8vcW9B07cirov0hAhaNAvyl3kIKNoM6U w/hyycfpGD+zJwsGI8MVNSYuubFJuQcnYMA/+SNAGQ5STRaaoA== X-Received: by 2002:a67:f90d:: with SMTP id t13mr2207494vsq.60.1600747069091; Mon, 21 Sep 2020 20:57:49 -0700 (PDT) MIME-Version: 1.0 References: <20200921190433.1149521-1-jim.cromie@gmail.com> <20200921190433.1149521-2-jim.cromie@gmail.com> <88110ffe6b08a2b403f30f4ea7463d5dad50b80b.camel@perches.com> In-Reply-To: <88110ffe6b08a2b403f30f4ea7463d5dad50b80b.camel@perches.com> From: jim.cromie@gmail.com Date: Mon, 21 Sep 2020 21:57:22 -0600 Message-ID: Subject: Re: [PATCH 1/2] dyndbg: dont panic over bad input To: Joe Perches Cc: Jason Baron , Greg KH , LKML , Petr Mladek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 1:29 PM Joe Perches wrote: > > 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 =3D buf; *end && !isspace(*end); end++) > > ; > > - BUG_ON(end =3D=3D buf); > > + if (end =3D=3D buf) { > > + pr_err("expected non-empty bareword"); > > missing newline > > This message is also unintelligible. > What is a non-empty bareword? > > hmm, I borrowed the term from perl en.wiktionary.org =E2=80=BA wiki =E2=80=BA bareword (programming, chiefly Perl) A sequence of text characters in source code that do not form a keyword nor part of a quoted string, and may potentially be interpreted ... basically, a not-quoted word, a keyword or not-quoted-value Im open that there might be better terminology. have any suggestions ?