From owner-svn-src-head@freebsd.org Wed Dec 6 18:11:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC320E87EFE; Wed, 6 Dec 2017 18:11:41 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from pv33p00im-asmtp002.me.com (pv33p00im-asmtp002.me.com [17.142.194.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF1F97CA4B; Wed, 6 Dec 2017 18:11:41 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.pv33p00im-asmtp002.me.com by pv33p00im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P0J00J00U0GKB00@pv33p00im-asmtp002.me.com>; Wed, 06 Dec 2017 17:11:34 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1512580294; bh=fojFQGsXXuy1w19bay9ml+nPKYzoSUpbPNB8Ebu/Njg=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=Hau5nADUBB5zKZyTbgJafuA3jg51LdmRopWT+iMlFTVo/A+SL5VUwS7CQhlAiRoRE v71yVrwQ/zgU86+o20QgsWWG1LjDg7CT3260kq+oVUes/aEwmSE1BkAgSr7qZ+etOY 8WcE4h5BFkwQKqgzaI83BY+CnzQ4mxPukLW4Z5wEoxHMv6CWFDi9shiVlSEMRosWwX fMnwCMdauESPx0jAaki2gDphN2OGQVHfXXO8kjelKcY7P7G+9hVb9ID9X5e5MfIjWD 7YgHloX1y4FDFZOwkcOM55SZPMOM5Trl5VTsqzI6UzeNFHpL4eC50/QqO+sSPCugxw a/4mBMeSt5yGw== Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P0J002IFUF3XC00@pv33p00im-asmtp002.me.com>; Wed, 06 Dec 2017 17:11:28 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-06_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1712060245 User-Agent: Microsoft-MacOutlook/f.28.0.171108 Date: Wed, 06 Dec 2017 09:11:26 -0800 Subject: Re: svn commit: r326624 - head/sys/cam/ata From: Ravi Pokala To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r326624 - head/sys/cam/ata References: <201712061701.vB6H1PDN011394@repo.freebsd.org> In-reply-to: <201712061701.vB6H1PDN011394@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 18:11:41 -0000 > ... disks of >=1TiB that still use CHS addressing. Out of morbid curiosity, are there any such monstrosities? -Ravi (rpokala@) -----Original Message----- From: on behalf of Alan Somers Date: 2017-12-06, Wednesday at 09:01 To: , , Subject: svn commit: r326624 - head/sys/cam/ata Author: asomers Date: Wed Dec 6 17:01:25 2017 New Revision: 326624 URL: https://svnweb.freebsd.org/changeset/base/326624 Log: cam: fix sign-extension error in adagetparams adagetparams contains a sign-extension error that will cause the sector count to be incorrectly calculated for ATA disks of >=1TiB that still use CHS addressing. Disks using LBA48 addressing are unaffected. Reported by: Coverity CID: 1007296 Reviewed by: ken MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13198 Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed Dec 6 14:53:53 2017 (r326623) +++ head/sys/cam/ata/ata_da.c Wed Dec 6 17:01:25 2017 (r326624) @@ -3377,7 +3377,8 @@ adagetparams(struct cam_periph *periph, struct ccb_get dp->heads = cgd->ident_data.heads; dp->secs_per_track = cgd->ident_data.sectors; dp->cylinders = cgd->ident_data.cylinders; - dp->sectors = cgd->ident_data.cylinders * dp->heads * dp->secs_per_track; + dp->sectors = cgd->ident_data.cylinders * + (u_int32_t)(dp->heads * dp->secs_per_track); } lbasize = (u_int32_t)cgd->ident_data.lba_size_1 | ((u_int32_t)cgd->ident_data.lba_size_2 << 16);