lkml.org 
[lkml]   [2021]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] RDMA/core: Use flexible array for mad data
On Wed, Jun 16, 2021 at 01:26:15PM -0700, Kees Cook wrote:
> In preparation for FORTIFY_SOURCE performing compile-time and run-time
> field bounds checking for memcpy(), memmove(), and memset(), avoid
> intentionally read across neighboring array fields.
>
> Without a flexible array, this looks like an attempt to perform a
> memcpy() read beyond the end of the packet->mad.data array:
>
> drivers/infiniband/core/user_mad.c:
> memcpy(packet->msg->mad, packet->mad.data, IB_MGMT_MAD_HDR);
>
> Switch from [0] to [] to use the appropriately handled type for trailing
> bytes.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> include/uapi/rdma/ib_user_mad.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason

\
 
 \ /
  Last update: 2021-06-22 19:10    [W:0.069 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site