From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751152AbWBZO6E (ORCPT ); Sun, 26 Feb 2006 09:58:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751168AbWBZO6E (ORCPT ); Sun, 26 Feb 2006 09:58:04 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:43686 "EHLO ZenIV.linux.org.uk") by vger.kernel.org with ESMTP id S1751152AbWBZO6D (ORCPT ); Sun, 26 Feb 2006 09:58:03 -0500 Date: Sun, 26 Feb 2006 14:57:51 +0000 From: Al Viro To: James Bottomley Cc: Linus Torvalds , Stefan Richter , Chris Wright , stable@kernel.org, Jody McIntyre , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: [stable] [PATCH 1/2] sd: fix memory corruption by sd_read_cache_type Message-ID: <20060226145751.GR27946@ftp.linux.org.uk> References: <20060225021009.GV3883@sorel.sous-sol.org> <4400E34B.1000400@s5r6.in-berlin.de> <1140930888.3279.4.camel@mulgrave.il.steeleye.com> <20060226053138.GM27946@ftp.linux.org.uk> <1140964451.3337.5.camel@mulgrave.il.steeleye.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1140964451.3337.5.camel@mulgrave.il.steeleye.com> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 26, 2006 at 08:34:10AM -0600, James Bottomley wrote: > Well, OK, I agree allowing us to request data longer than the actual > buffer is a problem. However, I don't exactly see how this actually > causes corruption, since even the initio bridge only sends 12 bytes of > data, so we should stop with a data underrun at that point (however big > the buffer is) scsi_mode_sense() does memset(buffer, 0, len). You don't need corrupting data to come from device - 10Kb of zeroes into 512-byte kmalloc'ed buffer will do the job just fine... ACKed in that form.