From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932263AbXC3WIn (ORCPT ); Fri, 30 Mar 2007 18:08:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932266AbXC3WIn (ORCPT ); Fri, 30 Mar 2007 18:08:43 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53459 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932263AbXC3WIm (ORCPT ); Fri, 30 Mar 2007 18:08:42 -0400 Date: Fri, 30 Mar 2007 14:59:17 -0700 From: Greg KH To: Mark Lord Cc: linux-kernel@vger.kernel.org, stable@kernel.org, Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Jeff Garzik Subject: Re: [patch 34/37] libata bugfix: HDIO_DRIVE_TASK Message-ID: <20070330215917.GB5812@suse.de> References: <20070330205938.984247529@mini.kroah.org> <20070330210659.GK29450@kroah.com> <460D8435.3060503@pobox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <460D8435.3060503@pobox.com> User-Agent: Mutt/1.5.14 (2007-02-12) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 30, 2007 at 05:42:13PM -0400, Mark Lord wrote: > Greg KH wrote: > >-stable review patch. If anyone has any objections, please let us know. > > > >------------------ > >From: Mark Lord > > > >libata bugfix: HDIO_DRIVE_TASK > > > >I was trying to use HDIO_DRIVE_TASK for something today, > >and discovered that the libata implementation does not copy > >over the upper four LBA bits from args[6]. > > > >This is serious, as any tools using this ioctl would have their > >commands applied to the wrong sectors on the drive, possibly resulting > >in disk corruption. > > > >Ideally, newer apps should use SG_IO/ATA_16 directly, > >avoiding this bug. But with libata poised to displace drivers/ide, > >better compatibility here is a must. > > > >This patch fixes libata to use the upper four LBA bits passed > >in from the ioctl. > > > >The original drivers/ide implementation copies over all bits > >except for the master/slave select bit. With this patch, > >libata will copy only the four high-order LBA bits, > >just in case there are assumptions elsewhere in libata (?). > > > >Signed-off-by: Mark Lord > >Cc: Chuck Ebbert > >Signed-off-by: Jeff Garzik > >Signed-off-by: Greg Kroah-Hartman > .. > > Mmmm.. I've just noticed another bit we should be preserving there, > both for *stable* and current mainline. > > Instead of: > > >+ scsi_cmd[13] = args[6] & 0x0f; > > We should be doing: > > >+ scsi_cmd[13] = args[6] & 0x4f; > > As-is, the patch still helps, but it is not as useful as it could be. > Here's the fixed version. I'm also sending out a 2.6.21 patch via Jeff. > > Signed-off-by: Mark Lord Can you forward that one to the stable@kernel.org address too, with the full changelog and Jeff's ack/signed-off-by so that I will remember to add it to the tree? thanks, greg k-h