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: 10101107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6030360360 for ; Thu, 7 Dec 2017 21:34:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53156283E8 for ; Thu, 7 Dec 2017 21:34:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 475A428738; Thu, 7 Dec 2017 21:34:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 003ED283E8 for ; Thu, 7 Dec 2017 21:34:43 +0000 (UTC) Received: from localhost ([::1]:34424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN3oZ-0001ev-5T for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Dec 2017 16:34:43 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 */