<div dir="ltr">Sorry, no I am not a developer working on libdrm, this is my first contribution to it in fact. How would I go about adding my Signed-Off?</div><br><div class="gmail_quote"><div dir="ltr">On Mon, 24 Aug 2015 at 09:59 Zhou, Jammy <<a href="mailto:Jammy.Zhou@amd.com">Jammy.Zhou@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> Would be more convenient if Mathias would add his Signed-off-by as well and send out the patch, cause he is the original author.<br>
<br>
Agreed. Just was not quite sure if Mathias is working on the libdrm project directly or not based on the comments in the bugzilla "hopefully the fix can be pushed to master soon".<br>
<br>
Regards,<br>
Jammy<br>
<br>
-----Original Message-----<br>
From: Christian König [mailto:<a href="mailto:deathsimple@vodafone.de" target="_blank">deathsimple@vodafone.de</a>]<br>
Sent: Monday, August 24, 2015 3:52 PM<br>
To: Zhou, Jammy; <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a>; <a href="mailto:master.homer@gmail.com" target="_blank">master.homer@gmail.com</a><br>
Subject: Re: [PATCH] drm: fix the usage after free<br>
<br>
On 24.08.2015 05:56, Jammy Zhou wrote:<br>
> From: Mathias Tillman <<a href="mailto:master.homer@gmail.com" target="_blank">master.homer@gmail.com</a>><br>
><br>
> For readdir_r(), the next directory entry is returned in<br>
> caller-allocted buffer (pointered by pent here).<br>
><br>
> <a href="https://bugs.freedesktop.org/show_bug.cgi?id=91704" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=91704</a><br>
><br>
> Signed-off-by: Jammy Zhou <<a href="mailto:Jammy.Zhou@amd.com" target="_blank">Jammy.Zhou@amd.com</a>><br>
<br>
Would be more convenient if Mathias would add his Signed-off-by as well and send out the patch, cause he is the original author.<br>
<br>
Anyway the patch is clearly a nice catch and Reviewed-by: Christian König <<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>><br>
<br>
Regards,<br>
Christian.<br>
<br>
> ---<br>
> xf86drm.c | 5 +++--<br>
> 1 file changed, 3 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/xf86drm.c b/xf86drm.c<br>
> index 5e02969..a7cc643 100644<br>
> --- a/xf86drm.c<br>
> +++ b/xf86drm.c<br>
> @@ -2803,11 +2803,12 @@ static char *drmGetMinorNameForFD(int fd, int<br>
> type)<br>
><br>
> while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) {<br>
> if (strncmp(ent->d_name, name, len) == 0) {<br>
> + snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",<br>
> + ent->d_name);<br>
> +<br>
> free(pent);<br>
> closedir(sysdir);<br>
><br>
> - snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",<br>
> - ent->d_name);<br>
> return strdup(dev_name);<br>
> }<br>
> }<br>
<br>
</blockquote></div>