Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2647556rbb; Wed, 28 Feb 2024 08:14:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW2d/8hqGVX56NFetnFf3au4efcp4h6b8IyjgeGxrbk5ayPwQ17Q6xdD2ZufNADFfR4CzVs8cc9v9ZqY6U22CYo2GRWqL6zqXw74haAOQ== X-Google-Smtp-Source: AGHT+IEbUlJF2Fi+Q3pOTNE1XbVGEyo3Sx8l0ZRJ8qIeJ45E1RZFVcQVZ1gIQ59dYZ0Jr4PondsF X-Received: by 2002:a17:906:6d04:b0:a3f:db30:872a with SMTP id m4-20020a1709066d0400b00a3fdb30872amr105165ejr.66.1709136843612; Wed, 28 Feb 2024 08:14:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709136843; cv=pass; d=google.com; s=arc-20160816; b=ptehzo+uoozjmBRmO5a4nCRfpxpzgMx0lg6LWbBo8xjCiL0+wPM1+cxoh7hYpbJPSu gLJGCqFGvCI8HekcUnG+Up4tJ/lmK6trxZln1WxwRJquyWPs+JBO6sEJxF4DC3xWsK2d utlgLzEEL943myvF5f1sDNc3X17lfNhFfXKPgt4ae9NoF5iEoRbB4mNT/clDZ8Kyy1K8 9o319K41+3xaummYfLS5Wa2+TevPcJWZP5lha737QK85zgySWudZ4gXnVXydTk1cVdEX h8s2Gk+vQudG4ea7Gf9A5HMm3v/Oq/7BOor65TRGSBfJ0QXOOCugUVN/Go3Hx2w7Bb3o dMQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=poGUx2qZOfCi41Ogk+XWXo3aj1qHgkTWm4teAktTxrI=; fh=7YuYy8foh2ICZGesVqaMJQXrWpB64mX8RiOnx8kjTtw=; b=BTXmXsKUHlOYoR/qqSNGgwSG0vVDo8aH8K+29KVKg5254sLcx/YYtB+J+2tGvA1QwC DvZcIhtrxhthxig7S+tcN88DCk1UWWLRmF9kAqtjAOHeh6sVgr/0dB9P02rngL56ciHu 1MAkuCrcKBwF+n00jrEyd5bDausZ8F9f4x2qqV7j1MscuWlK4AhFWNWtcvI4o0HiNejK uWTEVIU8s5N9hC5NhbNXBWRnjgbenMXmE3QniY9Ectd9QV+ujsJ2bdLhMZI0u3YQlWtr eKZC1XoiH09z0Mz2pTh95RZCxcYdkWvDY2KBTnUMzNUmoEQBZvcTb/eYLAoVJZsgRDY5 +AHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-85331-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v9-20020a170906b00900b00a43e168cd31si1054388ejy.853.2024.02.28.08.14.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 08:14:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85331-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-85331-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 88D301F29B8C for ; Wed, 28 Feb 2024 16:12:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 110ED15DBC8; Wed, 28 Feb 2024 16:12:10 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id 274A415DBC7 for ; Wed, 28 Feb 2024 16:12:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.131.102.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709136729; cv=none; b=eXZIXUXggvYSKXOJqEIVbIy1BO82BfIWi6AQQG6G86yA2UvEXccJyVEuKQKM6g2LM/Cd2mS+fxHmO3lnoyRfRCzP5oJZhpP8eo8zHR4nq7ZIP72Xig+sTnsnS5EoKgQMvC1JqG2OWa0CT81An/sVVhfw+UPG6wbpl+2U1rcPHWA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709136729; c=relaxed/simple; bh=FOSvzJIqz76gZszAfCyXvUnqGoQxI5NXFDSG9rTprIQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aXj7LF9aGlVequ5cN/kLzlxiKT9jaj2iU4eKLFKe8rxUFK7B93AMG49rD6+5Fmbkx8MADcL3+UqwH4AMc4wRlsfV3vKNhAn513P+meRjvhdLxz/LphunJdkxXHemaiXoMEnLuti7P1AJZS7grgsjilGcoJ4H3M4q8X+JOKKRBB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu; spf=pass smtp.mailfrom=netrider.rowland.org; arc=none smtp.client-ip=192.131.102.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netrider.rowland.org Received: (qmail 797627 invoked by uid 1000); 28 Feb 2024 11:12:06 -0500 Date: Wed, 28 Feb 2024 11:12:06 -0500 From: Alan Stern To: syzbot Cc: bvanassche@acm.org, emilne@redhat.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, martin.petersen@oracle.com, syzkaller-bugs@googlegroups.com, tasos@tasossah.com, usb-storage@lists.one-eyed-alien.net Subject: Re: [syzbot] [usb-storage?] divide error in isd200_ata_command Message-ID: <13add23d-af18-4f84-9f1a-043932a9712b@rowland.harvard.edu> References: <8fe3f46c-4ee5-4597-bf2d-12a5d634a264@rowland.harvard.edu> <0000000000008b026406126a4bbe@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0000000000008b026406126a4bbe@google.com> On Tue, Feb 27, 2024 at 09:20:03PM -0800, syzbot wrote: > Hello, > > syzbot tried to test the proposed patch but the build/boot failed: > > failed to checkout kernel repo https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ on commit f2e367d6ad3b: failed to run ["git" "fetch" "--force" "--tags" "7b440d1b40dd93ea98b5af6bba55ffca63425216" "f2e367d6ad3b"]: exit status 128 > fatal: couldn't find remote ref f2e367d6ad3b I'm going to guess this was a temporary failure and try again. If that wasn't the case, something is seriously wrong somewhere. I had no trouble accessing that commit using the git.kernel.org web interface. Alan Stern On Mon, Feb 26, 2024 at 01:42:26AM -0800, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: f2e367d6ad3b Merge tag 'for-6.8/dm-fix-3' of git://git.ker.. > git tree: upstream #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ f2e367d6ad3b Index: usb-devel/drivers/usb/storage/isd200.c =================================================================== --- usb-devel.orig/drivers/usb/storage/isd200.c +++ usb-devel/drivers/usb/storage/isd200.c @@ -1105,7 +1105,7 @@ static void isd200_dump_driveid(struct u static int isd200_get_inquiry_data( struct us_data *us ) { struct isd200_info *info = (struct isd200_info *)us->extra; - int retStatus = ISD200_GOOD; + int retStatus; u16 *id = info->id; usb_stor_dbg(us, "Entering isd200_get_inquiry_data\n"); @@ -1137,6 +1137,13 @@ static int isd200_get_inquiry_data( stru isd200_fix_driveid(id); isd200_dump_driveid(us, id); + /* Prevent division by 0 in isd200_scsi_to_ata() */ + if (id[ATA_ID_HEADS] == 0 || id[ATA_ID_SECTORS] == 0) { + usb_stor_dbg(us, " Invalid ATA Identify data\n"); + retStatus = ISD200_ERROR; + goto Done; + } + memset(&info->InquiryData, 0, sizeof(info->InquiryData)); /* Standard IDE interface only supports disks */ @@ -1202,6 +1209,7 @@ static int isd200_get_inquiry_data( stru } } + Done: usb_stor_dbg(us, "Leaving isd200_get_inquiry_data %08X\n", retStatus); return(retStatus); @@ -1481,22 +1489,27 @@ static int isd200_init_info(struct us_da static int isd200_Initialization(struct us_data *us) { + int rc = 0; + usb_stor_dbg(us, "ISD200 Initialization...\n"); /* Initialize ISD200 info struct */ - if (isd200_init_info(us) == ISD200_ERROR) { + if (isd200_init_info(us) < 0) { usb_stor_dbg(us, "ERROR Initializing ISD200 Info struct\n"); + rc = -ENOMEM; } else { /* Get device specific data */ - if (isd200_get_inquiry_data(us) != ISD200_GOOD) + if (isd200_get_inquiry_data(us) != ISD200_GOOD) { usb_stor_dbg(us, "ISD200 Initialization Failure\n"); - else + rc = -EINVAL; + } else { usb_stor_dbg(us, "ISD200 Initialization complete\n"); + } } - return 0; + return rc; }