lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 23 Aug 2021 07:23:14 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Christian König <christian.koenig@....com>,
        Lijo Lazar <lijo.lazar@....com>
CC:     "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Hawking Zhang <Hawking.Zhang@....com>,
        Feifei Xu <Feifei.Xu@....com>, Likun Gao <Likun.Gao@....com>,
        Jiawei Gu <Jiawei.Gu@....com>, Evan Quan <evan.quan@....com>,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        Alex Deucher <alexander.deucher@....com>,
        Luben Tuikov <luben.tuikov@....com>,
        Andrey Grodzovsky <andrey.grodzovsky@....com>,
        Dennis Li <Dennis.Li@....com>,
        Sathishkumar S <sathishkumar.sundararaju@....com>,
        Jonathan Kim <jonathan.kim@....com>,
        Kevin Wang <kevin1.wang@....com>,
        David M Nieto <David.Nieto@....com>,
        Kenneth Feng <kenneth.feng@....com>,
        Lee Jones <lee.jones@...aro.org>,
        John Clements <John.Clements@....com>,
        linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] drm/amd/pm: And destination bounds checking to struct copy



On August 22, 2021 11:28:54 PM PDT, "Christian König" <christian.koenig@....com> wrote:
>
>
>Am 19.08.21 um 22:14 schrieb Kees Cook:
>> [...]
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 96e895d6be35..4605934a4fb7 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -1446,4 +1446,29 @@ static inline int amdgpu_in_reset(struct amdgpu_device *adev)
>>   {
>>   	return atomic_read(&adev->in_gpu_reset);
>>   }
>> +
>> +/**
>> + * memcpy_trailing - Copy the end of one structure into the middle of another
>> + *
>> + * @dst: Pointer to destination struct
>> + * @first_dst_member: The member name in @dst where the overwrite begins
>> + * @last_dst_member: The member name in @dst where the overwrite ends after
>> + * @src: Pointer to the source struct
>> + * @first_src_member: The member name in @src where the copy begins
>> + *
>> + */
>> +#define memcpy_trailing(dst, first_dst_member, last_dst_member,		   \
>> +		        src, first_src_member)				   \
>
>Please don't add a function like this into amdgpu.h, especially when it 
>is only used by the SMU code.

Sure, I'm happy to move it. It wasn't clear to me which headers were considered "immutable". Which header should I put this in?

>And please give it an amdgpu_ prefix so that we are not confusing it 
>with a core function.

Sure, I will include that.

>Apart from that looks good to me.

Thanks!

-Kees

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ