mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Schermerhorn <lee.schermerhorn@hp.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>
Subject: [PATCH] 2.6.16-rc3-mm1 - restore zeroing of packet_command struct in sr_ioctl.c
Date: Wed, 15 Feb 2006 14:07:37 -0500	[thread overview]
Message-ID: <1140030457.6619.3.camel@localhost.localdomain> (raw)

The 'git-scsi-misc' patch removed 2 calls to memset() to zero out
a struct packet_command before passing it to sr_do_ioctl().  This
causes sr_do_ioctl() to use the uninitialized 'sense' member as a
pointer, instead of allocating a new request_sense struct.  On my
system, this results in an Oops that kills off hald and others.

This patch restores the 2 memset calls.

Signed-off-by:  Lee Schermerhorn <lee.schermerhorn@hp.com>

Index: linux-2.6.16-rc3-mm1/drivers/scsi/sr_ioctl.c
===================================================================
--- linux-2.6.16-rc3-mm1.orig/drivers/scsi/sr_ioctl.c	2006-02-15 13:06:08.000000000 -0500
+++ linux-2.6.16-rc3-mm1/drivers/scsi/sr_ioctl.c	2006-02-15 13:08:56.000000000 -0500
@@ -48,6 +48,7 @@ static int sr_read_tochdr(struct cdrom_d
 	if (!buffer)
 		return -ENOMEM;
 
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.timeout = IOCTL_TIMEOUT;
 	cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
 	cgc.cmd[8] = 12;		/* LSB of length */
@@ -77,6 +78,7 @@ static int sr_read_tocentry(struct cdrom
 	if (!buffer)
 		return -ENOMEM;
 
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.timeout = IOCTL_TIMEOUT;
 	cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
 	cgc.cmd[1] |= (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0;



                 reply	other threads:[~2006-02-15 19:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1140030457.6619.3.camel@localhost.localdomain \
    --to=lee.schermerhorn@hp.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®