From patchwork Thu May 18 12:13:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 9734111 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 39B60601BC for ; Thu, 18 May 2017 12:13:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28537286C6 for ; Thu, 18 May 2017 12:13:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D22028775; Thu, 18 May 2017 12:13:52 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8A41286E7 for ; Thu, 18 May 2017 12:13:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932515AbdERMNt (ORCPT ); Thu, 18 May 2017 08:13:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:58734 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932313AbdERMNp (ORCPT ); Thu, 18 May 2017 08:13:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E6DADADB7; Thu, 18 May 2017 12:13:43 +0000 (UTC) From: Johannes Thumshirn To: Omar Sandoval Cc: Linux Block Layer Mailinglist , Linux SCSI Mailinglist , Johannes Thumshirn Subject: [PATCH blktests 3/3] sg/001: add regression test for syzcaller generated GPF Date: Thu, 18 May 2017 14:13:08 +0200 Message-Id: <3f1ba16236b94cd7d282606d8b5b30d992205c84.1495109149.git.jthumshirn@suse.de> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a regression test for commit 48ae8484e9fc ("scsi: sg: don't return bogus Sg_requests"). This is a general protection fault triggered by syzcaller. Signed-off-by: Johannes Thumshirn --- tests/sg/001 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/sg/001.out | 2 ++ 2 files changed, 50 insertions(+) create mode 100755 tests/sg/001 create mode 100644 tests/sg/001.out diff --git a/tests/sg/001 b/tests/sg/001 new file mode 100755 index 000000000000..3a72931d5748 --- /dev/null +++ b/tests/sg/001 @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Regression test for commit 48ae8484e9fc ("scsi: sg: don't return bogus Sg_requests") +# +# Copyright (C) 2017 Johannes Thumshirn +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +. common/sg +. common/scsi_debug + +DESCRIPTION="Regression test for commit 48ae8484e9fc (\"scsi: sg: don't return bogus Sg_requests\")" +TIMED=1 +QUICK=1 + +requires() { + _have_program src/sg-001 \ + _have_program timeout \ + && _have_scsi_debug \ + && _have_scsi_generic +} + + +test() { + echo "Running ${TEST_NAME}" + + if ! _get_scsi_debug_dev; then + return 1 + fi + + _divide_timeout 2 + timeout -s INT 10s ./src/sg-001 + + _put_scsi_debug_dev + + echo "Test complete" +} diff --git a/tests/sg/001.out b/tests/sg/001.out new file mode 100644 index 000000000000..beb4c437dd28 --- /dev/null +++ b/tests/sg/001.out @@ -0,0 +1,2 @@ +Running sg/001 +Test complete