mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: Ben Skeggs <bskeggs@redhat.com>
Cc: Kyle Spaans <kspaans@uwaterloo.ca>,
	linux-kernel@vger.kernel.org,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	airlied@redhat.com, dri-devel@lists.freedesktop.org,
	mjg@redhat.com, maciej.rutecki@gmail.com,
	nouveau@lists.freedesktop.org,
	Nigel Cunningham <lkml@nigelcunningham.com.au>,
	Nick Piggin <npiggin@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Pekka Paalanen <pq@iki.fi>
Subject: [PATCH 1/2] drm/nouveau: fix notifier memory corruption bug
Date: Tue, 19 Apr 2011 23:50:48 +0200	[thread overview]
Message-ID: <20110419215048.GB2965@joi.lan> (raw)
In-Reply-To: <20110419214747.GA2965@joi.lan>

nouveau_bo_wr32 expects offset to be in words, but we pass value in bytes,
so after commit 73412c3854c877e5f37ad944ee8977addde4d35a ("drm/nouveau: allocate
kernel's notifier object at end of block") we started to overwrite some memory
after notifier buffer object (previously m2mf_ntfy was always 0, so it didn't
matter it was a value in bytes).

Reported-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reported-by: Nigel Cunningham <lkml@nigelcunningham.com.au>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Pekka Paalanen <pq@iki.fi>
Cc: stable@kernel.org    [2.6.38]
---
 drivers/gpu/drm/nouveau/nouveau_fbcon.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 889c445..39aee6d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -181,13 +181,13 @@ nouveau_fbcon_sync(struct fb_info *info)
 		OUT_RING  (chan, 0);
 	}
 
-	nouveau_bo_wr32(chan->notifier_bo, chan->m2mf_ntfy + 3, 0xffffffff);
+	nouveau_bo_wr32(chan->notifier_bo, chan->m2mf_ntfy/4 + 3, 0xffffffff);
 	FIRE_RING(chan);
 	mutex_unlock(&chan->mutex);
 
 	ret = -EBUSY;
 	for (i = 0; i < 100000; i++) {
-		if (!nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy + 3)) {
+		if (!nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy/4 + 3)) {
 			ret = 0;
 			break;
 		}
-- 
1.7.4.1


  reply	other threads:[~2011-04-19 21:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-03 18:12 2.6.39-rc1 noveau trouble and regression (bad commit: 38f1cff0863809587b5fd10ecd0c24c8b543a48c ) Dominik Brodowski
2011-04-07 15:11 ` Dominik Brodowski
2011-04-14 17:05   ` 2.6.39-rc1 nouveau regression (bisected) Dominik Brodowski
2011-04-14 19:02     ` Marcin Slusarz
2011-04-15  6:11       ` Dominik Brodowski
2011-04-16 22:12         ` Nigel Cunningham
2011-04-16 23:50           ` Kyle Spaans
2011-04-17 15:12             ` Kyle Spaans
2011-04-17 15:45               ` Marcin Slusarz
2011-04-17 16:24                 ` Kyle Spaans
2011-04-17 16:49                   ` Marcin Slusarz
2011-04-18 20:02                     ` 2.6.39-rc1 nouveau(?) " Marcin Slusarz
2011-04-18 20:27                       ` Linus Torvalds
2011-04-19 21:47                         ` Marcin Slusarz
2011-04-19 21:50                           ` Marcin Slusarz [this message]
2011-04-19 21:52                           ` [PATCH 2/2] drm/nouveau: fix allocation of notifier object Marcin Slusarz
2011-04-19 22:34                           ` 2.6.39-rc1 nouveau(?) regression (bisected) Ben Skeggs
2011-04-20 14:18                           ` Kyle Spaans
2011-04-22 16:29                           ` Dominik Brodowski
2011-04-17 16:23               ` 2.6.39-rc1 nouveau " Marcin Slusarz
2011-04-17 17:20           ` Dominik Brodowski

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=20110419215048.GB2965@joi.lan \
    --to=marcin.slusarz@gmail.com \
    --cc=airlied@redhat.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kspaans@uwaterloo.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=lkml@nigelcunningham.com.au \
    --cc=maciej.rutecki@gmail.com \
    --cc=mjg@redhat.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=npiggin@gmail.com \
    --cc=pq@iki.fi \
    --cc=torvalds@linux-foundation.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

Powered by JetHome