mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: akpm <akpm@osdl.org>, lkml <linux-kernel@vger.kernel.org>,
	zwane@linuxpower.ca, axboe@suse.de
Cc: arvidjaar@mail.ru, stoffel@lucent.com, barryn@pobox.com,
	torvalds@osdl.org
Subject: [PATCH] floppy I/O error handling => Oops
Date: Sun, 21 Sep 2003 11:39:30 -0700	[thread overview]
Message-ID: <20030921113930.4ce1f0a1.rddunlap@osdl.org> (raw)


bad_flp_intr() in floppy.c can cause an Oops if the I/O request is
freed but <errors> still points into the I/O request block.

Here is a simple patch that fixes it.  The ordering of the if/else
conditionals might be improved, but this works (for me).

bad_flp_intr() oopsen reports:

Andrey: http://marc.theaimsgroup.com/?l=linux-kernel&m=105837886921297&w=2
John:   http://marc.theaimsgroup.com/?l=linux-kernel&m=106303650007125&w=2
Barry:  http://bugme.osdl.org/show_bug.cgi?id=1033

--
~Randy


patch_name:	floppyio_errors.patch
patch_version:	2003-09-21.11:10:08
author:		Randy.Dunlap <rddunlap@osdl.org>
description:	don't use the <errors> pointer after calling cont->done();
		it can be invalid since it points into a req block
		which may have been freed;
product:	Linux
product_versions: 2.6.0-test5
diffstat:	=
 drivers/block/floppy.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

The ordering of the if/else conditionals may need to change.

diff -Naur ./drivers/block/floppy.c~flopio ./drivers/block/floppy.c
--- ./drivers/block/floppy.c~flopio	2003-09-08 12:49:53.000000000 -0700
+++ ./drivers/block/floppy.c	2003-09-21 11:03:17.000000000 -0700
@@ -2161,7 +2174,7 @@
 	INFBOUND(DRWE->badness, *errors);
 	if (*errors > DP->max_errors.abort)
 		cont->done(0);
-	if (*errors > DP->max_errors.reset)
+	else if (*errors > DP->max_errors.reset)
 		FDCS->reset = 1;
 	else if (*errors > DP->max_errors.recal)
 		DRS->track = NEED_2_RECAL;

             reply	other threads:[~2003-09-21 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-21 18:39 Randy.Dunlap [this message]
2003-09-21 19:40 ` Randy.Dunlap

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=20030921113930.4ce1f0a1.rddunlap@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=akpm@osdl.org \
    --cc=arvidjaar@mail.ru \
    --cc=axboe@suse.de \
    --cc=barryn@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stoffel@lucent.com \
    --cc=torvalds@osdl.org \
    --cc=zwane@linuxpower.ca \
    /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®