From: Andy Furniss Subject: Re: [PATCH] drm/radeon/kms: only warn on mipmap size checks in r600 cs checker Date: Tue, 14 Sep 2010 11:24:05 +0100 Message-ID: <4C8F4D45.9000806@ukfsn.org> References: <1284411894-19276-1-git-send-email-alexdeucher@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.ukfsn.org (mail.ukfsn.org [77.75.108.10]) by gabe.freedesktop.org (Postfix) with ESMTP id D3FFD9E74B for ; Tue, 14 Sep 2010 03:24:06 -0700 (PDT) In-Reply-To: <1284411894-19276-1-git-send-email-alexdeucher@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Alex Deucher Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Alex Deucher wrote: > The texture base address registers are in units of 256 bytes. > The original CS checker treated these offsets as bytes, so the > original check was wrong. I fixed the units in a patch during > the 2.6.36 cycle, but this ended up breaking some existing > userspace (probably due to a bug in either userspace texture allocation > or the drm texture mipmap checker). So for now, until we come > up with a better fix, just warn if the mipmap size it too large. > This will keep existing userspace working and it should be just > as safe as before when we were checking the wrong units. These > are GPU MC addresses, so if they fall outside of the VRAM or > GART apertures, they end up at the GPU default page, so this should > be safe from a security perspective. > > Signed-off-by: Alex Deucher > Cc: Jerome Glisse > --- > drivers/gpu/drm/radeon/r600_cs.c | 1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c > index d886494..27023a3 100644 > --- a/drivers/gpu/drm/radeon/r600_cs.c > +++ b/drivers/gpu/drm/radeon/r600_cs.c > @@ -1172,7 +1172,6 @@ static inline int r600_check_texture_resource(struct radeon_cs_parser *p, u32 i > if ((mipmap_size + word0)> radeon_bo_size(mipmap)) { > dev_warn(p->dev, "mipmap bo too small (%d %d %d %d %d %d -> %d have %ld)\n", > w0, h0, bpe, blevel, nlevels, word0, mipmap_size, radeon_bo_size(texture)); > - return -EINVAL; > } > return 0; > } It fixes ut2004 demo OK, but it spams the logs with 000s of errors.