From nobody Fri May 10 03:52:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611659813; cv=none; d=zohomail.com; s=zohoarc; b=PWAcjm5dQxA6EU5rG24V0ujGcqM4IDmhdbvwIApUJxj1/FIMR3RFfdb7a8WqUjA1PzIHLK0sTPt0LOXZdLe1tcLaPbiNbPAA23d83Y1QjcQXy8saU4iousZa1ZUse83bEJflS/BudbRmkMk+KaiEi6xmnrRHKMhIFziR5qvr/xo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611659813; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=pOa+invkTSd9msAOq158KC7sen/JzmgqNE1f7YnfH2U=; b=HWMqXulagVVv5seqpa1Ra/b2O23mtj1c1tyV4rO4Dd5XBrsm31h9wI3EGO92HaFH53RJMufNh+qGCvharxFFg+zTmSSpMnWrWlMR5Fi9LAMMCNhW/hwBKbUHE7RBLs2uBJS1BiSItJ+m/IPKeivigIQ3gtZG/lSzOGfX944LqDc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611659813420994.668333072752; Tue, 26 Jan 2021 03:16:53 -0800 (PST) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-5YEhAGKHNaGUpY_E-Ca8GQ-1; Tue, 26 Jan 2021 06:16:48 -0500 Received: by mail-ed1-f69.google.com with SMTP id ck25so9165423edb.16 for ; Tue, 26 Jan 2021 03:16:48 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id g14sm9592461ejr.105.2021.01.26.03.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 03:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611659812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pOa+invkTSd9msAOq158KC7sen/JzmgqNE1f7YnfH2U=; b=CkIYc/sKsW/JwrrbU6FDbRIF+/zOjKhjWJ92tomaD6I3VvNYbjPFQCWVh0m3ODGrzGNAXX kjmXEDT8wvgK7Z3HbMaHqov94sGQzluVwab2Q6WWije0hvCQLOxva66Z58DUf0DEsLe6t7 juQ3I/i8ETMKxyGFdskXhbocQz/OAMI= X-MC-Unique: 5YEhAGKHNaGUpY_E-Ca8GQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pOa+invkTSd9msAOq158KC7sen/JzmgqNE1f7YnfH2U=; b=ez/Viop9lMQVtTNfWdUWbuDAlsfK+sJurlMv3KV58PV4F/pa4NXaMx7h0JtHDTZ3Ox VUE7JyQ3YB1XE+fpJS5596VzuYQtu95kw3rbsKNLrHDs+b0QIK4IWpieXTbYOE0Di4IN GEkeZA2IWgLiS1gAScXoeX/DBBSeFaExexaoaksA1MzQkDhZEh7+YoHfPfl/8+Yzoa1X p/6F5zNcLK5aHx2OFzdnAPuInrHOhtFeUO0xNB7IpZDRuca0j5L1CTSbbamS5sqaLJpM z0erMKEm7+BCt0rH68/tPtbZmfjLl11PsRmteRPsZKj/etryFg1lgEFSfBKh9BeXVceL rJRg== X-Gm-Message-State: AOAM532npTc4O8NVKmp5g3ufeDgcZryhMJIzgrHyycA2F2GlIV0iHdYj 5Lv2VX2Gt0dPjvSnlwHvUAG5p5akJfEyBMHh2bZ/sU97jNTX/Ya/ICZgLd+ck4tV1mW+okdL0nc 2w1xBYVK5FPAxxg== X-Received: by 2002:a50:fc8c:: with SMTP id f12mr4119196edq.225.1611659807550; Tue, 26 Jan 2021 03:16:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTDP67weBlp45JOc7dob+dM0iHxeNK7szy/rUJ0V75hf62dePbLWJA+DXrNW5UQ0UoeX1KLA== X-Received: by 2002:a50:fc8c:: with SMTP id f12mr4119182edq.225.1611659807368; Tue, 26 Jan 2021 03:16:47 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fam Zheng , Hannes Reinecke , qemu-block@nongnu.org, Paolo Bonzini , Thomas Huth , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/2] tests/qtest: Only run fuzz-megasas-test if megasas device is available Date: Tue, 26 Jan 2021 12:16:37 +0100 Message-Id: <20210126111638.3141780-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210126111638.3141780-1-philmd@redhat.com> References: <20210126111638.3141780-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This test fails when QEMU is built without the megasas device, restrict it to its availability. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- tests/qtest/fuzz-megasas-test.c | 49 +++++++++++++++++++++++++++++++++ tests/qtest/fuzz-test.c | 25 ----------------- MAINTAINERS | 1 + tests/qtest/meson.build | 4 ++- 4 files changed, 53 insertions(+), 26 deletions(-) create mode 100644 tests/qtest/fuzz-megasas-test.c diff --git a/tests/qtest/fuzz-megasas-test.c b/tests/qtest/fuzz-megasas-tes= t.c new file mode 100644 index 00000000000..940a76bf25a --- /dev/null +++ b/tests/qtest/fuzz-megasas-test.c @@ -0,0 +1,49 @@ +/* + * QTest fuzzer-generated testcase for megasas device + * + * Copyright (c) 2020 Li Qiang + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" + +#include "libqos/libqtest.h" + +/* + * This used to trigger the assert in scsi_dma_complete + * https://bugs.launchpad.net/qemu/+bug/1878263 + */ +static void test_lp1878263_megasas_zero_iov_cnt(void) +{ + QTestState *s; + + s =3D qtest_init("-nographic -monitor none -serial none " + "-M q35 -device megasas -device scsi-cd,drive=3Dnull0 " + "-blockdev driver=3Dnull-co,read-zeroes=3Don,node-name= =3Dnull0"); + qtest_outl(s, 0xcf8, 0x80001818); + qtest_outl(s, 0xcfc, 0xc101); + qtest_outl(s, 0xcf8, 0x8000181c); + qtest_outl(s, 0xcf8, 0x80001804); + qtest_outw(s, 0xcfc, 0x7); + qtest_outl(s, 0xcf8, 0x8000186a); + qtest_writeb(s, 0x14, 0xfe); + qtest_writeb(s, 0x0, 0x02); + qtest_outb(s, 0xc1c0, 0x17); + qtest_quit(s); +} + +int main(int argc, char **argv) +{ + const char *arch =3D qtest_get_arch(); + + g_test_init(&argc, &argv, NULL); + + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { + qtest_add_func("fuzz/test_lp1878263_megasas_zero_iov_cnt", + test_lp1878263_megasas_zero_iov_cnt); + } + + return g_test_run(); +} diff --git a/tests/qtest/fuzz-test.c b/tests/qtest/fuzz-test.c index cdb1100a0b8..6188fbb8e96 100644 --- a/tests/qtest/fuzz-test.c +++ b/tests/qtest/fuzz-test.c @@ -11,29 +11,6 @@ =20 #include "libqos/libqtest.h" =20 -/* - * This used to trigger the assert in scsi_dma_complete - * https://bugs.launchpad.net/qemu/+bug/1878263 - */ -static void test_lp1878263_megasas_zero_iov_cnt(void) -{ - QTestState *s; - - s =3D qtest_init("-nographic -monitor none -serial none " - "-M q35 -device megasas -device scsi-cd,drive=3Dnull0 " - "-blockdev driver=3Dnull-co,read-zeroes=3Don,node-name= =3Dnull0"); - qtest_outl(s, 0xcf8, 0x80001818); - qtest_outl(s, 0xcfc, 0xc101); - qtest_outl(s, 0xcf8, 0x8000181c); - qtest_outl(s, 0xcf8, 0x80001804); - qtest_outw(s, 0xcfc, 0x7); - qtest_outl(s, 0xcf8, 0x8000186a); - qtest_writeb(s, 0x14, 0xfe); - qtest_writeb(s, 0x0, 0x02); - qtest_outb(s, 0xc1c0, 0x17); - qtest_quit(s); -} - static void test_lp1878642_pci_bus_get_irq_level_assert(void) { QTestState *s; @@ -104,8 +81,6 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { - qtest_add_func("fuzz/test_lp1878263_megasas_zero_iov_cnt", - test_lp1878263_megasas_zero_iov_cnt); qtest_add_func("fuzz/test_lp1878642_pci_bus_get_irq_level_assert", test_lp1878642_pci_bus_get_irq_level_assert); qtest_add_func("fuzz/test_mmio_oob_from_memory_region_cache", diff --git a/MAINTAINERS b/MAINTAINERS index 34359a99b8e..44cd74b03cd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1925,6 +1925,7 @@ S: Supported F: hw/scsi/megasas.c F: hw/scsi/mfi.h F: tests/qtest/megasas-test.c +F: tests/qtest/fuzz-megasas-test.c =20 Network packet abstractions M: Dmitry Fleytman diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 16d04625b8b..85682d0dfce 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -4,7 +4,9 @@ subdir_done() endif =20 -qtests_generic =3D [ +qtests_generic =3D \ + (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-= test'] : []) + \ + [ 'cdrom-test', 'device-introspect-test', 'machine-none-test', --=20 2.26.2 From nobody Fri May 10 03:52:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611659819; cv=none; d=zohomail.com; s=zohoarc; b=gWT0F4MqbkvuulRzgZiZP2ouZW7ed5GD+kdeGFN+/W+GDYLnNiUURspxHV7X4yOvKcnLThEwVFHeZ/ybItUaQzOuzD5JejQ7p6jNTjMiWB/Cp52T4mOueU/fLRHoEsHnilgzVp0UNIfEyIqKQCLhOhYPFnIjXGsjjviJCrzE25g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611659819; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=6y59I937hE7WeSby5lmZT2/B3vYVu6vqOt5kug2kSA0=; b=XNLvkLXCPFsNBjjRD3Hvt6s0YhX86RLkS58QcMBLjsOneF7GTPcHPZdmNOKwVT038FVQy2D8WzEtOgyb4YZq5hip8rrZEM/8dU3aVpFpee5LYbKlONNHrQNgT7o1s+EmKVZgmF1hzC0aZJqzGHNbSAU9xd8dLcC+St5duAtvteg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611659819102902.0022008443999; Tue, 26 Jan 2021 03:16:59 -0800 (PST) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-308-eJOJISyNMIupG_YrnaRURQ-1; Tue, 26 Jan 2021 06:16:54 -0500 Received: by mail-ed1-f69.google.com with SMTP id o8so3923320edh.12 for ; Tue, 26 Jan 2021 03:16:54 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id x21sm526060eje.118.2021.01.26.03.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 03:16:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611659818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6y59I937hE7WeSby5lmZT2/B3vYVu6vqOt5kug2kSA0=; b=edHrtA7d+At2Nr+0TVN51xzpBAgfjaXQV+adQd7kGSeouZzGwqIHY9gb4xisyTSDN9/0BU jMZxoGcsx36z9A9d9jEUkR1MyzBdWvszEan16ybS+pSPQObwLOv90sBWf29wm7URaREYCs 1Tta3WdxISkiVnejl+qEobwRQs+N+dc= X-MC-Unique: eJOJISyNMIupG_YrnaRURQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6y59I937hE7WeSby5lmZT2/B3vYVu6vqOt5kug2kSA0=; b=tiLF7Gb4ULnc7ugURch0r2Dh/1PgG3ctcPe8i/HJFczoVsvGS7lW4Jgx1VSqcvHqxN xcY8r04NrdVo84PlZssLM1+FvpI61G95egIBalALQc+3Jui5Z47DMptUflG11Yjz4VfY XMEBDzEg5H5M6fEzEovJPQXrshL5JYJRBlDmSYkqsuIOMzJr5xGAUoVU6ADWLyXrZc7h Nc9FqR66SB6kZwPmTZAYQoixk0C8kOj9ehlBsFpUGz8mUgcAGUgjZT+gZvgp/aDb/BTw 4blOUWkaEaRSPelC28/AhQqHurx5LlYJ26gQ5oZuvWZJXYTGInT0f1dmkgaqcmZfamxh nnSQ== X-Gm-Message-State: AOAM531RD9Wcrsv+l7p9uJAIkSF7OtAeuuwi+N3DpLAWgB8wPLIAcL37 yYRdZOwp/Z9qlSFfJJ1/yl4NIORLgY7hcc+stZSickB/GAyxUmRFREfCB8uxEB6oNvesx/GYvoy colYbCDdHDVr8fA== X-Received: by 2002:aa7:c94c:: with SMTP id h12mr4289314edt.40.1611659813229; Tue, 26 Jan 2021 03:16:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDvIaPKBSY/eFQQGpooa/E16Z3DVFP19bgRXi8IkuWJUM+xxHhANFujGPpl3Ph8jGhIqx8Kg== X-Received: by 2002:aa7:c94c:: with SMTP id h12mr4289297edt.40.1611659813031; Tue, 26 Jan 2021 03:16:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fam Zheng , Hannes Reinecke , qemu-block@nongnu.org, Paolo Bonzini , Thomas Huth , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" Subject: [PATCH v2 2/2] tests/qtest: Only run fuzz-virtio-scsi when virtio-scsi is available Date: Tue, 26 Jan 2021 12:16:38 +0100 Message-Id: <20210126111638.3141780-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210126111638.3141780-1-philmd@redhat.com> References: <20210126111638.3141780-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This test fails when QEMU is built without the virtio-scsi device, restrict it to its availability. Reviewed-by: Michael S. Tsirkin Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- tests/qtest/fuzz-test.c | 51 -------------------- tests/qtest/fuzz-virtio-scsi-test.c | 75 +++++++++++++++++++++++++++++ MAINTAINERS | 1 + tests/qtest/meson.build | 1 + 4 files changed, 77 insertions(+), 51 deletions(-) create mode 100644 tests/qtest/fuzz-virtio-scsi-test.c diff --git a/tests/qtest/fuzz-test.c b/tests/qtest/fuzz-test.c index 6188fbb8e96..d112798afe3 100644 --- a/tests/qtest/fuzz-test.c +++ b/tests/qtest/fuzz-test.c @@ -25,55 +25,6 @@ static void test_lp1878642_pci_bus_get_irq_level_assert(= void) qtest_quit(s); } =20 -/* - * Here a MemoryRegionCache pointed to an MMIO region but had a - * larger size than the underlying region. - */ -static void test_mmio_oob_from_memory_region_cache(void) -{ - QTestState *s; - - s =3D qtest_init("-M pc-q35-5.2 -display none -m 512M " - "-device virtio-scsi,num_queues=3D8,addr=3D03.0 "); - - qtest_outl(s, 0xcf8, 0x80001811); - qtest_outb(s, 0xcfc, 0x6e); - qtest_outl(s, 0xcf8, 0x80001824); - qtest_outl(s, 0xcf8, 0x80001813); - qtest_outl(s, 0xcfc, 0xa080000); - qtest_outl(s, 0xcf8, 0x80001802); - qtest_outl(s, 0xcfc, 0x5a175a63); - qtest_outb(s, 0x6e08, 0x9e); - qtest_writeb(s, 0x9f003, 0xff); - qtest_writeb(s, 0x9f004, 0x01); - qtest_writeb(s, 0x9e012, 0x0e); - qtest_writeb(s, 0x9e01b, 0x0e); - qtest_writeb(s, 0x9f006, 0x01); - qtest_writeb(s, 0x9f008, 0x01); - qtest_writeb(s, 0x9f00a, 0x01); - qtest_writeb(s, 0x9f00c, 0x01); - qtest_writeb(s, 0x9f00e, 0x01); - qtest_writeb(s, 0x9f010, 0x01); - qtest_writeb(s, 0x9f012, 0x01); - qtest_writeb(s, 0x9f014, 0x01); - qtest_writeb(s, 0x9f016, 0x01); - qtest_writeb(s, 0x9f018, 0x01); - qtest_writeb(s, 0x9f01a, 0x01); - qtest_writeb(s, 0x9f01c, 0x01); - qtest_writeb(s, 0x9f01e, 0x01); - qtest_writeb(s, 0x9f020, 0x01); - qtest_writeb(s, 0x9f022, 0x01); - qtest_writeb(s, 0x9f024, 0x01); - qtest_writeb(s, 0x9f026, 0x01); - qtest_writeb(s, 0x9f028, 0x01); - qtest_writeb(s, 0x9f02a, 0x01); - qtest_writeb(s, 0x9f02c, 0x01); - qtest_writeb(s, 0x9f02e, 0x01); - qtest_writeb(s, 0x9f030, 0x01); - qtest_outb(s, 0x6e10, 0x00); - qtest_quit(s); -} - int main(int argc, char **argv) { const char *arch =3D qtest_get_arch(); @@ -83,8 +34,6 @@ int main(int argc, char **argv) if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { qtest_add_func("fuzz/test_lp1878642_pci_bus_get_irq_level_assert", test_lp1878642_pci_bus_get_irq_level_assert); - qtest_add_func("fuzz/test_mmio_oob_from_memory_region_cache", - test_mmio_oob_from_memory_region_cache); } =20 return g_test_run(); diff --git a/tests/qtest/fuzz-virtio-scsi-test.c b/tests/qtest/fuzz-virtio-= scsi-test.c new file mode 100644 index 00000000000..aaf6d10e189 --- /dev/null +++ b/tests/qtest/fuzz-virtio-scsi-test.c @@ -0,0 +1,75 @@ +/* + * QTest fuzzer-generated testcase for virtio-scsi device + * + * Copyright (c) 2020 Li Qiang + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" + +#include "libqos/libqtest.h" + +/* + * Here a MemoryRegionCache pointed to an MMIO region but had a + * larger size than the underlying region. + */ +static void test_mmio_oob_from_memory_region_cache(void) +{ + QTestState *s; + + s =3D qtest_init("-M pc-q35-5.2 -display none -m 512M " + "-device virtio-scsi,num_queues=3D8,addr=3D03.0 "); + + qtest_outl(s, 0xcf8, 0x80001811); + qtest_outb(s, 0xcfc, 0x6e); + qtest_outl(s, 0xcf8, 0x80001824); + qtest_outl(s, 0xcf8, 0x80001813); + qtest_outl(s, 0xcfc, 0xa080000); + qtest_outl(s, 0xcf8, 0x80001802); + qtest_outl(s, 0xcfc, 0x5a175a63); + qtest_outb(s, 0x6e08, 0x9e); + qtest_writeb(s, 0x9f003, 0xff); + qtest_writeb(s, 0x9f004, 0x01); + qtest_writeb(s, 0x9e012, 0x0e); + qtest_writeb(s, 0x9e01b, 0x0e); + qtest_writeb(s, 0x9f006, 0x01); + qtest_writeb(s, 0x9f008, 0x01); + qtest_writeb(s, 0x9f00a, 0x01); + qtest_writeb(s, 0x9f00c, 0x01); + qtest_writeb(s, 0x9f00e, 0x01); + qtest_writeb(s, 0x9f010, 0x01); + qtest_writeb(s, 0x9f012, 0x01); + qtest_writeb(s, 0x9f014, 0x01); + qtest_writeb(s, 0x9f016, 0x01); + qtest_writeb(s, 0x9f018, 0x01); + qtest_writeb(s, 0x9f01a, 0x01); + qtest_writeb(s, 0x9f01c, 0x01); + qtest_writeb(s, 0x9f01e, 0x01); + qtest_writeb(s, 0x9f020, 0x01); + qtest_writeb(s, 0x9f022, 0x01); + qtest_writeb(s, 0x9f024, 0x01); + qtest_writeb(s, 0x9f026, 0x01); + qtest_writeb(s, 0x9f028, 0x01); + qtest_writeb(s, 0x9f02a, 0x01); + qtest_writeb(s, 0x9f02c, 0x01); + qtest_writeb(s, 0x9f02e, 0x01); + qtest_writeb(s, 0x9f030, 0x01); + qtest_outb(s, 0x6e10, 0x00); + qtest_quit(s); +} + +int main(int argc, char **argv) +{ + const char *arch =3D qtest_get_arch(); + + g_test_init(&argc, &argv, NULL); + + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { + qtest_add_func("fuzz/test_mmio_oob_from_memory_region_cache", + test_mmio_oob_from_memory_region_cache); + } + + return g_test_run(); +} diff --git a/MAINTAINERS b/MAINTAINERS index 44cd74b03cd..48c0ec41e93 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1717,6 +1717,7 @@ S: Supported F: include/hw/scsi/* F: hw/scsi/* F: tests/qtest/virtio-scsi-test.c +F: tests/qtest/fuzz-virtio-scsi-test.c T: git https://github.com/bonzini/qemu.git scsi-next =20 SSI diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 85682d0dfce..f2090296597 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -6,6 +6,7 @@ =20 qtests_generic =3D \ (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-= test'] : []) + \ + (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-t= est'] : []) + \ [ 'cdrom-test', 'device-introspect-test', --=20 2.26.2 From nobody Fri May 10 03:52:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611660538; cv=none; d=zohomail.com; s=zohoarc; b=Q3ulazVJbYhOJzPofnoWdCZPTbo9QnEzY6Oe/00/4t43RmDkTEzH3QLa0CIgu+6H491WrTh1Kp9iWGAFN3UgPzflJtDbBe0jE/bsk08V61C90b16+8glUvJE/4agk37Utsmrdk/LshgFeO5wWMoKsYqd/tc0wyzqHjP7G3gVskM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611660538; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=cwUreLFAlgw4Ko5GaFdgcv8ckaMTl11AQV+twWsQ3mU=; b=j/HzQRXD7Pz+DmujkenzTYX5QT9+CopEcBYBBI0mvAct7KMoKKQYkNbhcWevws1gX/K+LEagnJ/okmCMr6wqiSVGguSrJ/s/8fUWJFyA/wx7EPBxTBSlDEUlmv3ri8bcJPv63gZ+mTIYz6vZ5qJOYREOn9s4/71VLQITrDVcHSw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1611660538480167.67323287261343; Tue, 26 Jan 2021 03:28:58 -0800 (PST) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-VlFHkjjVNlWkNRbX25cq1w-1; Tue, 26 Jan 2021 06:28:52 -0500 Received: by mail-ed1-f72.google.com with SMTP id m18so2592821edp.13 for ; Tue, 26 Jan 2021 03:28:52 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id n5sm10666356edw.7.2021.01.26.03.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 03:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611660536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cwUreLFAlgw4Ko5GaFdgcv8ckaMTl11AQV+twWsQ3mU=; b=SLtvhojywxnOZjCALvEXIXPTZE3sLd7vLMwZYpZZKOxsxsoD8QMvyHsarbh8qR2AS1jNIy SfzJVedIxZ+SB5dPRoTFWPhKkO5vy8A+LpES6e9t+v1E6wj+VAj+8/Vkkd5dubyulKnle6 asi7t6lRb7XBLAlB6fuQbRmmz1UGMdA= X-MC-Unique: VlFHkjjVNlWkNRbX25cq1w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cwUreLFAlgw4Ko5GaFdgcv8ckaMTl11AQV+twWsQ3mU=; b=cX2F4Cd0yOsnecozBkoohvkFU7SvB2qF0nwAc5WwRlHTQcttLyhpXStwAcjM17z/EM dkrXmmFuaQUE195M10iQzHVIRw1cjcHvrep3QL9fOkeD1uia6pY7oMBz6J++gIHxiTlT /FHTMSBrNeVgrc8d44Xg3KW6zrzC6wo1tYeInVat85dk2wC0b0FNDVtOpIUB4XhgRoIU Ej7/ymM60qgvUsYC3UOpWKYI0zEs64K0uz05hvB9x7fK2E18yfi3yVKQj3ISPekvLuPv nlc+Ocv2f6jte3rDIgj0kfqVzZt7H5bbdTEQCOY8r/3jOBQbJ+RqRh8NWmDjAI5EjVJ0 Xs/A== X-Gm-Message-State: AOAM532duceaJ1q2/Ia7zclV1EZAUVh5l2Y1n9Thfr07Ydppz4hAmwWh VVsMH4xg96jho4D///P9OBt9VblH4ek17QbzEMRds0ndXXfb2/UzsEAsecq4DRc4ENSvdjAIiQj +kqDuMDR4FTjdVA== X-Received: by 2002:aa7:d9c3:: with SMTP id v3mr4103111eds.133.1611660531535; Tue, 26 Jan 2021 03:28:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRowPhI5MC8B5f6X1fbcRIh751abzMDDf7kNVarK7W+W4/xBvrd3gLbjFHRWY64Sjbe3FMyA== X-Received: by 2002:aa7:d9c3:: with SMTP id v3mr4103100eds.133.1611660531439; Tue, 26 Jan 2021 03:28:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexander Bulekov , Paolo Bonzini , Li Qiang , Bandan Das , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/2] MAINTAINERS: Cover fuzzer reproducer tests within 'Device Fuzzing' Date: Tue, 26 Jan 2021 12:28:49 +0100 Message-Id: <20210126112849.3145695-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210126111638.3141780-1-philmd@redhat.com> References: <20210126111638.3141780-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) When we started to commit the fuzzer QTest reproducers to fuzz-test.c in commit d8dd1095019 ("qtest: add fuzz test case"), we forgot to add the corresponding MAINTAINERS entry. Do it now. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e275c81fd49..1b88753b325 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2571,6 +2571,7 @@ R: Stefan Hajnoczi R: Thomas Huth S: Maintained F: tests/qtest/fuzz/ +F: tests/qtest/fuzz-*test.c F: scripts/oss-fuzz/ F: docs/devel/fuzzing.rst =20 --=20 2.26.2