From owner-svn-src-head@freebsd.org Tue Dec 18 13:41:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4436513520A9; Tue, 18 Dec 2018 13:41:33 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C734E6D6D7; Tue, 18 Dec 2018 13:41:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id B627F1EE31; Tue, 18 Dec 2018 13:41:32 +0000 (UTC) Date: Tue, 18 Dec 2018 13:41:32 +0000 From: Alexey Dokuchaev To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r249115 - in head: sbin/camcontrol sys/sys Message-ID: <20181218134132.GA63563@FreeBSD.org> References: <201304042319.r34NJqIP040377@svn.freebsd.org> <20181127134514.GA1580@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181127134514.GA1580@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: C734E6D6D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.985,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-0.98)[-0.984,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Tue, 18 Dec 2018 13:41:33 -0000 On Tue, Nov 27, 2018 at 01:45:14PM +0000, Alexey Dokuchaev wrote: > On Thu, Apr 04, 2013 at 11:19:52PM +0000, Steven Hartland wrote: > > New Revision: 249115 > > URL: http://svnweb.freebsd.org/changeset/base/249115 > > > > Log: > > Adds security options to camcontrol this includes the ability to secure > > erase disks such as SSD's > > > > Adds the ability to run ATA commands via the SCSI ATA Pass-Through(16) > > com[m]and > > > > Modified: head/sbin/camcontrol/camcontrol.c > > > > [...] > > +static int > > +ata_do_identify(struct cam_device *device, int retry_count, int timeout, > > + union ccb *ccb, struct ata_params** ident_bufp) > > +{ > > [...] > > + > > + error = ata_do_28bit_cmd(device, > > + ccb, > > + /*retries*/retry_count, > > + /*flags*/CAM_DIR_IN, > > + /*protocol*/AP_PROTO_PIO_IN, > > + /*tag_action*/MSG_SIMPLE_Q_TAG, > > + /*command*/command, > > + /*features*/0, > > + /*lba*/0, > > + /*sector_count*/(u_int8_t)sizeof(struct ata_params), > > This looks strange: sizeof(struct ata_params) is 512, but it is too wide > for u_int8_t, so it would be truncated to zero. Should it be 1 (one) here > instead for ATA_ATA_IDENTIFY command, since it normally returns some data > which typically fits one sector (>=512 bytes)? Ping. ./danfe > > + /*data_ptr*/(u_int8_t *)ptr, > > + /*dxfer_len*/sizeof(struct ata_params), > > + /*timeout*/timeout ? timeout : 30 * 1000, > > + /*quiet*/1); > > > > [...] > > + error = ata_do_28bit_cmd(device, > > + ccb, > > + /*retries*/retry_count, > > + /*flags*/CAM_DIR_IN, > > + /*protocol*/AP_PROTO_PIO_IN, > > + /*tag_action*/MSG_SIMPLE_Q_TAG, > > + /*command*/retry_command, > > + /*features*/0, > > + /*lba*/0, > > + /*sector_count*/(u_int8_t) > > + sizeof(struct ata_params), > > Same here. > > > + /*data_ptr*/(u_int8_t *)ptr, > > + /*dxfer_len*/sizeof(struct ata_params), > > + /*timeout*/timeout ? timeout : 30 * 1000, > > + /*quiet*/0);