From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
Alex Deucher <alexander.deucher@amd.com>,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()
Date: Fri, 9 Oct 2020 09:39:47 -0500 [thread overview]
Message-ID: <20201009143947.GA32493@embeddedor> (raw)
In-Reply-To: <de2282e7-7eb9-db79-1082-36d6508b05dd@amd.com>
On Fri, Oct 09, 2020 at 04:29:55PM +0200, Christian König wrote:
> > > > - entity = kcalloc(1, offsetof(typeof(*entity), fences[amdgpu_sched_jobs]),
> > > > + entity = kmalloc(struct_size(entity, fences, amdgpu_sched_jobs),
> > > NAK. You could use kzalloc() here, but kmalloc won't zero initialize the
> > > memory which could result in unforeseen consequences.
> > Oh I see.. I certainly didn't take that into account.
> >
> > I'll fix that up and respin.
>
> Shit happens, we already have a fix for this. Alex merged it and it
> immediately broke our testing systems.
:/
> So one of our engineers came up with a fix which should already have been
> applied.
Great. Good to know it's already fixed! :)
Thanks
--
Gustavo
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: "Christian König" <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()
Date: Fri, 9 Oct 2020 09:39:47 -0500 [thread overview]
Message-ID: <20201009143947.GA32493@embeddedor> (raw)
In-Reply-To: <de2282e7-7eb9-db79-1082-36d6508b05dd@amd.com>
On Fri, Oct 09, 2020 at 04:29:55PM +0200, Christian König wrote:
> > > > - entity = kcalloc(1, offsetof(typeof(*entity), fences[amdgpu_sched_jobs]),
> > > > + entity = kmalloc(struct_size(entity, fences, amdgpu_sched_jobs),
> > > NAK. You could use kzalloc() here, but kmalloc won't zero initialize the
> > > memory which could result in unforeseen consequences.
> > Oh I see.. I certainly didn't take that into account.
> >
> > I'll fix that up and respin.
>
> Shit happens, we already have a fix for this. Alex merged it and it
> immediately broke our testing systems.
:/
> So one of our engineers came up with a fix which should already have been
> applied.
Great. Good to know it's already fixed! :)
Thanks
--
Gustavo
WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org,
Alex Deucher <alexander.deucher@amd.com>,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()
Date: Fri, 9 Oct 2020 09:39:47 -0500 [thread overview]
Message-ID: <20201009143947.GA32493@embeddedor> (raw)
In-Reply-To: <de2282e7-7eb9-db79-1082-36d6508b05dd@amd.com>
On Fri, Oct 09, 2020 at 04:29:55PM +0200, Christian König wrote:
> > > > - entity = kcalloc(1, offsetof(typeof(*entity), fences[amdgpu_sched_jobs]),
> > > > + entity = kmalloc(struct_size(entity, fences, amdgpu_sched_jobs),
> > > NAK. You could use kzalloc() here, but kmalloc won't zero initialize the
> > > memory which could result in unforeseen consequences.
> > Oh I see.. I certainly didn't take that into account.
> >
> > I'll fix that up and respin.
>
> Shit happens, we already have a fix for this. Alex merged it and it
> immediately broke our testing systems.
:/
> So one of our engineers came up with a fix which should already have been
> applied.
Great. Good to know it's already fixed! :)
Thanks
--
Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-10-09 14:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 14:34 [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc() Gustavo A. R. Silva
2020-10-08 14:34 ` Gustavo A. R. Silva
2020-10-08 14:34 ` Gustavo A. R. Silva
2020-10-08 17:22 ` Alex Deucher
2020-10-08 17:22 ` Alex Deucher
2020-10-08 17:22 ` Alex Deucher
2020-10-09 7:08 ` Christian König
2020-10-09 7:08 ` Christian König
2020-10-09 7:08 ` Christian König
2020-10-09 13:54 ` Gustavo A. R. Silva
2020-10-09 13:54 ` Gustavo A. R. Silva
2020-10-09 13:54 ` Gustavo A. R. Silva
2020-10-09 14:29 ` Christian König
2020-10-09 14:29 ` Christian König
2020-10-09 14:29 ` Christian König
2020-10-09 14:39 ` Gustavo A. R. Silva [this message]
2020-10-09 14:39 ` Gustavo A. R. Silva
2020-10-09 14:39 ` Gustavo A. R. Silva
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=20201009143947.GA32493@embeddedor \
--to=gustavoars@kernel.org \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 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.