All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Rob Clark <robdclark@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/atomic: fix null dereference
Date: Sun, 12 Jul 2015 11:44:38 +0530	[thread overview]
Message-ID: <20150712061438.GA2649@sudip-PC> (raw)
In-Reply-To: <CAF6AEGsCWrDugJeqCeodFdygyX3DS2Xf-cBQEEqkOcEKdMtoWA@mail.gmail.com>

On Sat, Jul 11, 2015 at 02:17:49PM -0400, Rob Clark wrote:
> On Sat, Jul 11, 2015 at 1:24 PM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > We are checking the size of e->event but we were doing it when e is
> > known to be NULL.
> 
> nak, this will leak event_space..  since it is a sizeof, it isn't
> actually deref'ing e, but rather just using the static type info, so
> it's ok (although perhaps funny looking)
Agreed, and I just verified the same with an userspace code also.
But i think this will confuse people like me who have started to look
at the drm code to start working with some new drm driver.
what about:
file_priv->event_space += sizeof(struct drm_event_vblank);

It will server the same purpose yet it will not be confusing.

regards
sudip
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Rob Clark <robdclark@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/atomic: fix null dereference
Date: Sun, 12 Jul 2015 11:44:38 +0530	[thread overview]
Message-ID: <20150712061438.GA2649@sudip-PC> (raw)
In-Reply-To: <CAF6AEGsCWrDugJeqCeodFdygyX3DS2Xf-cBQEEqkOcEKdMtoWA@mail.gmail.com>

On Sat, Jul 11, 2015 at 02:17:49PM -0400, Rob Clark wrote:
> On Sat, Jul 11, 2015 at 1:24 PM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > We are checking the size of e->event but we were doing it when e is
> > known to be NULL.
> 
> nak, this will leak event_space..  since it is a sizeof, it isn't
> actually deref'ing e, but rather just using the static type info, so
> it's ok (although perhaps funny looking)
Agreed, and I just verified the same with an userspace code also.
But i think this will confuse people like me who have started to look
at the drm code to start working with some new drm driver.
what about:
file_priv->event_space += sizeof(struct drm_event_vblank);

It will server the same purpose yet it will not be confusing.

regards
sudip

  reply	other threads:[~2015-07-12  6:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-11 17:24 [PATCH] drm/atomic: fix null dereference Sudip Mukherjee
2015-07-11 17:24 ` Sudip Mukherjee
2015-07-11 18:17 ` Rob Clark
2015-07-11 18:17   ` Rob Clark
2015-07-12  6:14   ` Sudip Mukherjee [this message]
2015-07-12  6:14     ` Sudip Mukherjee

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=20150712061438.GA2649@sudip-PC \
    --to=sudipm.mukherjee@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.