From patchwork Thu Jun 6 10:39:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 801982 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp226155wro; Thu, 6 Jun 2024 03:40:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWAMqGrtMmQvQ+PZhrJBSI6wO/WsHiAAQguw6lvAt5RRL9ih+r3qHAfNhhr5JxVtqaB9Qaf87DfvcA4zy+Q8amv X-Google-Smtp-Source: AGHT+IHJKh9wz1K+Xvml4ElHpP3xP02ira63ARSi244LI1EKb1dgciN4uWLP4HpZOxNlt59rZy85 X-Received: by 2002:a05:622a:1a15:b0:43a:d39a:45bc with SMTP id d75a77b69052e-4402b6df99amr49430181cf.49.1717670444215; Thu, 06 Jun 2024 03:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717670444; cv=none; d=google.com; s=arc-20160816; b=NYVUuv9dbyNr4+5nzNoRhxlWTw6yx7KkhkOiyNxl5ark+Tsu46tU8I7/IoHazjEc5y egJbSMoTehiUakqn8tmhYgZ3WSm+vx+tPYC5TdKpZwGjTmHz44C0nZ5M5IvxYF5liRJP kjRjDRqivw6I2bh1h3NeED6L3DNlKDSQ/AV3nGNFo3Lx2MCUwiK/iW0W0c83zy3tkWzY +784Ac2StthUq59VMQt0+vY2AZXklz/T6+aDwo/T6/ZIZhDX+6qX8dmVngXDSUgUHt4/ NtB/gR9Irc/ZQuiCd4kWLD/FDsDSPlVbPL2OgaLlwCBMxNzCj2aZihIeyWysqjkLUJp4 V9hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BMtQclkfQ+tzZ8PXSD+8zjanVSPJ3R9g60tZMLUUdbU=; fh=PzDM2D96kiCYo4l0PRMdYHJO7wAlAxW3siP0EoLGZRQ=; b=Apr8fMmuJS0HRBa63XfyV9qHi+ilMLEWHVeb2hmqoA70c47vujBzEqWoC1R9cwBnsW DXClr2l0BGWM2DtP+F/7k+JSF4AeqjpSTs0mOSYa8JdDPQpAXPNEPafsOLx6kCoxbcS1 qD6UmWd9C6sR1EwncHmG3wBTTjkKHnwd4Lbr5CWVvt9jR0CPdonPbYbUPA2PRoZ16COK YArmslOQerugiutK96n/jRrRjpkWSiVzVIXgv9rvZfMZRzoQvaVb0ssbybYtVV0e63IN Ul73kbhpPCecB+6O59TnFmVeaKlGEqVkCYLjrQXL/9DC3mSkXEQriNDVAz6KtPLVWR6S j6hg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qRop8QgJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44038a6db5esi12477561cf.21.2024.06.06.03.40.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jun 2024 03:40:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qRop8QgJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFAXh-0003tX-Rb; Thu, 06 Jun 2024 06:40:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFAXg-0003t0-2C for qemu-devel@nongnu.org; Thu, 06 Jun 2024 06:40:24 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sFAXd-0002yw-AA for qemu-devel@nongnu.org; Thu, 06 Jun 2024 06:40:23 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-52b9af7a01bso980027e87.0 for ; Thu, 06 Jun 2024 03:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717670419; x=1718275219; darn=nongnu.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=BMtQclkfQ+tzZ8PXSD+8zjanVSPJ3R9g60tZMLUUdbU=; b=qRop8QgJAGLU5YkbpKacQvzQHmJ8spa5rX0r5jtDwrrPCmqxhFAhLd12OuqtTz8Vkq hcTwHlK30dCirJ2BA2UzFxGYSN7SfBdwYJseAktqODEm0bj2KQXrMHCyzClEtoISO5FR NJjhePEKngBNPuRMlSbq1ed/pZQO0K9495ecNnpSLxP/FYbdKXZUpNJeHjY52ioc7ufL a1UApRxddUcc6mNqiQdMPsGDaa2HlkNRp99pVI2cudfLDWBFdg5LGGW1S2+HvzkuapGm VprW+5lafx1ptg3PULfeWyTf7IIsk/GlBYgeDYXEpRqdgjqIiluOX5cmLHmzkTREyhqv +Wzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717670419; x=1718275219; 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=BMtQclkfQ+tzZ8PXSD+8zjanVSPJ3R9g60tZMLUUdbU=; b=hazj2t1Ly6kwZRX/eC1kEzufsL9IzNyVk3EmXwe1SOx8AokANBXEiVRY10R+QXn1uN PgGMDAZFEl4u9DCPFRRaEKIaCy72+n5XNJYEdScYC150w4PFEFI/Gl1KuKQC8fFhTfz5 GCDvkmJqtHa6nqUN14yaKZ+C4/SdVCsnxcI9vBK06DFCK62FuMIUT+fxlU95aQ2XfvjR 9xqJZYmOkC1+bw55XKeSoIP4RN6qSo3WPBJ6NHt1DDaJo8EeP+OUiPg1L1MJhB5gGkkj jYNhC4Bb9koyGoDSRoEaKKxXHFvtsVIWZkQ+erOlfnCof6tMHKN6M/DnvwI+qrO0e3b0 Epfw== X-Gm-Message-State: AOJu0YzR6qRV5VCUZwP4f+rGXb6b5Ce+kR1pR463wogUjSPNgFaDfcNV JDKmZpudYOmqKKHBjOIQyW+AalSTgXEKsK3h+41Aqo+jj0TITvhEaRcYOzj40RdqE/yngBNxMEa e77c= X-Received: by 2002:a05:6512:3f09:b0:52b:9c8a:735a with SMTP id 2adb3069b0e04-52bab4dbbdbmr3927067e87.40.1717670419082; Thu, 06 Jun 2024 03:40:19 -0700 (PDT) Received: from localhost.localdomain (94.red-88-29-105.staticip.rima-tde.net. [88.29.105.94]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c19d52dsm17724945e9.8.2024.06.06.03.40.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 06 Jun 2024 03:40:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Mads Ynddal , Stefan Hajnoczi , Yoshinori Sato , Stefan Berger , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 5/5] tracetool: Forbid newline character in event format Date: Thu, 6 Jun 2024 12:39:43 +0200 Message-ID: <20240606103943.79116-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240606103943.79116-1-philmd@linaro.org> References: <20240606103943.79116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Events aren't designed to be multi-lines. Multiple events can be used instead. Prevent that format using multi-lines by forbidding the newline character. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- scripts/tracetool/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 7237abe0e8..bc03238c0f 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -301,6 +301,8 @@ def build(line_str, lineno, filename): if fmt.endswith(r'\n"'): raise ValueError("Event format must not end with a newline " "character") + if '\\n' in fmt: + raise ValueError("Event format must not use new line character") if len(fmt_trans) > 0: fmt = [fmt_trans, fmt]