From patchwork Mon May 14 14:12:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 912957 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; dmarc=fail (p=none dis=none) header.from=redhat.com 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 40l2j52zWDz9s08 for ; Tue, 15 May 2018 00:12:56 +1000 (AEST) Received: from localhost ([::1]:39319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIEDd-000255-74 for incoming@patchwork.ozlabs.org; Mon, 14 May 2018 10:12:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIEDC-00020r-3V for qemu-devel@nongnu.org; Mon, 14 May 2018 10:12:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIED8-0002ri-5E for qemu-devel@nongnu.org; Mon, 14 May 2018 10:12:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50708 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fIED8-0002rH-10 for qemu-devel@nongnu.org; Mon, 14 May 2018 10:12:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BBE247D83F; Mon, 14 May 2018 14:12:20 +0000 (UTC) Received: from donizetti.redhat.com (unknown [10.36.118.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id E16042026DEF; Mon, 14 May 2018 14:12:19 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 16:12:18 +0200 Message-Id: <20180514141218.28438-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 14 May 2018 14:12:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 14 May 2018 14:12:20 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH] coverity-model: replay data is considered trusted 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: Markus Armbruster , Pavel Dovgalyuk Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replay data is not considered a possible attack vector; add a model that does not use getc so that "tainted data" warnings are suppressed. Signed-off-by: Paolo Bonzini Reviewed-by: Markus Armbruster --- scripts/coverity-model.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/coverity-model.c b/scripts/coverity-model.c index c702804f41..576f48de33 100644 --- a/scripts/coverity-model.c +++ b/scripts/coverity-model.c @@ -103,6 +103,19 @@ static int get_keysym(const name2keysym_t *table, } } + +/* Replay data is considered trusted. */ +uint8_t replay_get_byte(void) +{ + uint8_t byte = 0; + if (replay_file) { + uint8_t c; + byte = c; + } + return byte; +} + + /* * GLib memory allocation functions. *