From patchwork Thu Dec 7 21:30:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 845858 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fKSQ8nXc"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yt7zB48jlz9s84 for ; Fri, 8 Dec 2017 08:34:14 +1100 (AEDT) Received: from localhost ([::1]:34421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN3o4-0000oN-6B for incoming@patchwork.ozlabs.org; Thu, 07 Dec 2017 16:34:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN3kV-0005aE-GX for qemu-devel@nongnu.org; Thu, 07 Dec 2017 16:30:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eN3kU-0001zA-Ag for qemu-devel@nongnu.org; Thu, 07 Dec 2017 16:30:31 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:40636) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eN3kU-0001yK-3O for qemu-devel@nongnu.org; Thu, 07 Dec 2017 16:30:30 -0500 Received: by mail-pg0-x241.google.com with SMTP id k15so5361440pgr.7 for ; Thu, 07 Dec 2017 13:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5+wWHqEUj1ugPkwebAYHCdGKbj4PXJLd76dY1MU+g2A=; b=fKSQ8nXcUL4es7Mp2U7IO3ycXAFeyZY4yUrcCcI/U9JXn3NSsgOUo8ub+NxzHsB3m9 sDMdR+rTZseuNi0gEy0ZKsgHWo0ONtCscKtGeGVjvNVgPL2tRgVLU7r9lX0cXNfo6WAg sJY2lRDwwPWQwmGNMAUsncc4EzkthB0bu2p6qUmBorw7u3e6hRpFBs/imeVqOc6xTiIr zokHylo0ne6FI4wp/OiDJEugQA05yAhxsuFIRhmKmG/Xzy/oNJiQdUrQ/g0hPqYWtCkc xvhHwTsN/KZ7XcGh3eShS0Cfw2POsQvjhDOo9qLa9Wlq8zkRnLVzqqhZUOOU95Ty9S9c cV2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5+wWHqEUj1ugPkwebAYHCdGKbj4PXJLd76dY1MU+g2A=; b=a7MsPjwhz/zWlmVu7NCyvVRSC0Br/YlM3S+Pvh/c7+6/YPzmf/fn/y8z0S7i05/iHX QQE4GnKn0DkLFoUXCPzbJHLizm4zt+dKEyb8aEEs3PDyNMyz2If/rPoGVjhYwBHhWTAB wq8klwlb1VGGh0O+fWyCEYU81e5k5IHiqZx6c02HC65bqZ66szilRzz6+kjiUHPtW4Zy LMBozGUx8aDp5o0FInHDUmJlselCr3i3EZmSCF7cpJ0OioaIJgM1W0NnuxPaTi1ZRzGg Y0JPRTpmd2ydUTe07ZLEzC0g4vxfFDawAVBnVFQcCnKa9CRLgj3/PRPvnPlbmE+RM8Dm peLA== X-Gm-Message-State: AJaThX7s8BXSRPrIoDETK/AyS+sPYhnmWpJ0VcL250Vnc/wxhRqXyG0Y sScawLupi1iY3g7rvW3cpA== X-Google-Smtp-Source: AGs4zMZiwtmNkGPwg94f3ugYdBnpVP0td/FMxnwnPRb1AjLXO5P856Lr47iWNMp7vJ3WKUp3MvfPBw== X-Received: by 10.99.138.194 with SMTP id y185mr26394050pgd.290.1512682229080; Thu, 07 Dec 2017 13:30:29 -0800 (PST) Received: from serve.minyard.net ([47.184.168.85]) by smtp.gmail.com with ESMTPSA id g9sm11584521pfk.0.2017.12.07.13.30.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 13:30:26 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 85D6FEE8; Thu, 7 Dec 2017 15:30:21 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 104B1302369; Thu, 7 Dec 2017 15:30:18 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Thu, 7 Dec 2017 15:30:11 -0600 Message-Id: <1512682213-4354-7-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512682213-4354-1-git-send-email-minyard@acm.org> References: <1512682213-4354-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PATCH 6/8] vl.c: disallow command line fw cfg without opt/ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Michael S. Tsirkin" Allowing arbitary file names on command line is setting us up for failure: future guests will look for a specific QEMU-specified name and will get confused finding a user file there. Signed-off-by: Michael S. Tsirkin [Change "warning" to "error" in the error report.] Signed-off-by: Corey Minyard --- vl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 1ad1c04..fae9300 100644 --- a/vl.c +++ b/vl.c @@ -2400,8 +2400,9 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp) return -1; } if (strncmp(name, "opt/", 4) != 0) { - warn_report("externally provided fw_cfg item names " - "should be prefixed with \"opt/\""); + error_report("error: externally provided fw_cfg item names " + "should be prefixed with \"opt/\""); + return -1; } if (nonempty_str(str)) { size = strlen(str); /* NUL terminator NOT included in fw_cfg blob */