Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1581684lqa; Mon, 29 Apr 2024 12:32:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVe+imaSy22dbSBOctPq5idra6SzJQyUCzXFgOknKq8ZTnz+9i4oFVwX6r4ieH6gq39eIUOJrdA6UEeXXVInNPllNZDYgf7sl52cr/eng== X-Google-Smtp-Source: AGHT+IEhBGpoGciIyQFCkIwU1wFGtq5nLDh6MyMy1QNx8kepb0as4UyYYsmhwcckwZgHcf6KG2Ur X-Received: by 2002:a05:6358:850e:b0:17e:53f9:6985 with SMTP id n14-20020a056358850e00b0017e53f96985mr12859221rwk.14.1714419174191; Mon, 29 Apr 2024 12:32:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714419174; cv=pass; d=google.com; s=arc-20160816; b=cyUeNuvyeBBwRv7XsjXvBDKGbL3dVOerl5RMZemYzW0EKMIviS5bAROcfdw5m21q36 OIn9VfGb0lpDfjolaiptESai86UGZ4kxU6ILSdKMfJ3nhA16T9pTeZw42vWsWEIKN2dD HJP4cE0ZIdRPBP6vULeXQPJEizWjE1+qlXyG4dlvxmO4lNuYDayqOOyKy0/xjofIX7Z8 j7hyXiWcEPTDkUp3k3RPtUS/pbU2xd4D7bwALnH3GLkBWKLgHoBSCBdrpEVBZXUw8pmZ T4JzZwmZW/+ZkLwhZdK3E7zUmjIaUpXGkvcuv76yPkU72qn6VE91BpyAR9QKywQAwO1Q ny0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ap0abnHnzuA+pCntBOpzm99vZ6Zv5ODzcROoP3CQSrg=; fh=/ouzcN18ZMhXsGFkPA6LriiHuvanQWjzE5WSBiWa1Fc=; b=OrtXz0XGXO7jGWUTAShe8rsO00VwjX3L+cYWVd6yEBLBYZBFyHBRRO1bPO6MsnC5xe zuZhBRQg6hc3zNEt4SZTJI07ISgaUhgd6m1Rf9sR/FhPEVD7Lpk0UoeOJRmFqUlBG7IZ gGQXAr1rueOzXlKWmYvkYwi2Tv3+m+7LuxNtJYJjhisXtiDfv3iOIvo7mm86F0YeezQo c0h7ccyh6uO72zOVfqeQYIE7uFK7OuBnSUTyJ9X6AXyaH/Ko8tUqrTu7QDoXHM7siyuc miX1Ir7grVcxlChjJY8ff6p2bZZpQAry69bePCIPGftSS05I4g5P6nz0n7/9nRpsWpU0 wHEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OSsEnDau; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-162914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w191-20020a6382c8000000b005fd85b3b336si4483022pgd.744.2024.04.29.12.32.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:32:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OSsEnDau; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-162914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E8F7CB21D15 for ; Mon, 29 Apr 2024 19:32:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAEF113B588; Mon, 29 Apr 2024 19:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OSsEnDau" Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0AC813AA5A; Mon, 29 Apr 2024 19:32:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714419134; cv=none; b=V+dmFT+Ett0c2peW4tQ5xMjuWy+XcHOK9v5kGIBpeQ59kG5dr0gRz4kQyMLrHP+JtL3sEFB26TPL46K3hMVJWH3wOkTc3MFTUq3pE+PcT+41mqkmHt2EsuNx5XgQJHlo+naJOk73dQCyliPdY9qerg8IRj44WFFXE0cqrf3CtUk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714419134; c=relaxed/simple; bh=MxxpWFWIkQTnaHMmRSSNu1GlLY2Bctt1yjxnIAL7ar4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XwcDHnd9u5YoYbmQmTejD/EOdFznTAIzO1eCfTDPTaf1Ax9pWqdRpO/gUJPRdoT6iiepcwe26qX8FfNIZk6fx3/sTkVsswKenvIqyl+730CV99tJovzGIOqpg4H0hYYXto9mDhmPpipqv1KTl21jH8vEte9N+JsnlhxMU1T2XM8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OSsEnDau; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7d6ad896c6dso215357539f.1; Mon, 29 Apr 2024 12:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419132; x=1715023932; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ap0abnHnzuA+pCntBOpzm99vZ6Zv5ODzcROoP3CQSrg=; b=OSsEnDau1VjQGx8YkSLalVJRWqWN1bRmA9+G9st5w1h74n+bqM1uapiXx+5T1p4YFw NozIf/qtgApZPtglsaXmjCEO/MdHUeOocnGB2TFl2RhBV68SeH9UlMuagdOHPzvFFgcS 5KvYmxccYhdcQpAaN45Z9fEMT4M0OFbcWqnD20wEUuuLP5EdHXyBWrsTc+6jz0du0eFp Omx0a64u0fnhPc+yjQKD2HKtkmnJOQc9GbtF2UO0AFORpA9XsSzG8y+IKI5oAZfL9InL DQ2Ys09Kzr1XDT7pZ5XL/UmW4q3iTisNRAO8chwv6AJbgb8f3asCY4arlnxgzPN+ZL6z FhMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419132; x=1715023932; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ap0abnHnzuA+pCntBOpzm99vZ6Zv5ODzcROoP3CQSrg=; b=JLP4bXxzRhewUjKR3MwK2tA8wY7P3s7rZo5hrpHqgs1IQOv9d002qWG0XNcdCvVLfx 8SToQ7dhOPI0rfLFVNDNyDilZ4gZ7j4mOb0bmAeO0Zf1TbZL660vTnFrtjeFLV90c9FF TsWFR6YCF8DumcVC/bgJWWH+W4YbkLVB3JBZ/zyjbKFu9YzO7HJvEX6mgyODmhVB1t3K kdSnrFKEUaSIL0Ovexio+1WuUsp7udAQyfhtm6qYmIwfIXI3S0Z+U4K6lc/20sMKpOV9 F9nSNi5geoRqCTFEiXmoYEUGsalq42/oantPA8Ax6CBy24jH8VLeAqWdRor7wHitcviM EamA== X-Forwarded-Encrypted: i=1; AJvYcCWqmst+evQn8gWvRirg/ZaWp8QLTws+EOYx+JMk1L/qiNj53+J2CgR1rJjRY8/MUYsxynFb3t6dJRZ17adJSV4O2DMbGsHNr5kYBw9GXIOB85el9TIbLFhWS5vA6dRukzFR7XxkAfqB2Sj+5Lxo86BZMA6NT7Sjfu4PjkmExS7O X-Gm-Message-State: AOJu0YyXV4Yk2h7ZYCv32TWqCnzBszodCcC89QNlpKNnVVvewuNcjRYS DPCIjHxBOw2Ct6kYJL6GmAwH0+pbUegvcYRhlVne6+2jg61jKq8a X-Received: by 2002:a6b:6417:0:b0:7d0:8cff:cff3 with SMTP id t23-20020a6b6417000000b007d08cffcff3mr13514911iog.8.1714419132083; Mon, 29 Apr 2024 12:32:12 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id dq18-20020a0566021b9200b007d5ec9b77aesm5988402iob.51.2024.04.29.12.32.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:32:11 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, Jim Cromie , stable@vger.kernel.org Subject: [PATCH v8 01/35] dyndbg: fix old BUG_ON in >control parser Date: Mon, 29 Apr 2024 13:31:11 -0600 Message-ID: <20240429193145.66543-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193145.66543-1-jim.cromie@gmail.com> References: <20240429193145.66543-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fix a BUG_ON from 2009. Even if it looks "unreachable" (I didn't really look), lets make sure by removing it, doing pr_err and return -EINVAL instead. cc: stable@vger.kernel.org Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index c78f335fa981..f2c5e7910bb1 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -302,7 +302,11 @@ 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("parse err after word:%d=%s\n", nwords, + nwords ? words[nwords - 1] : ""); + return -EINVAL; + } } /* `buf' is start of word, `end' is one past its end */ -- 2.44.0