Fix out of bounds memory clobber in GGML_OP_ROPE

This commit is contained in:
Justine Tunney 2024-01-31 08:20:53 -08:00
parent 5cb04dbc16
commit 99892be490
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

2
ggml.c
View file

@ -17151,7 +17151,7 @@ struct ggml_cplan ggml_graph_plan(const struct ggml_cgraph * cgraph, int n_threa
case GGML_OP_SOFT_MAX:
case GGML_OP_ROPE:
{
cur = ggml_type_size(GGML_TYPE_F32) * node->ne[0] * n_tasks;
cur = ggml_type_size(GGML_TYPE_F32) * (node->ne[0] + CACHE_LINE_SIZE_F32) * n_tasks;
} break;
case GGML_OP_CONV_TRANSPOSE_1D:
{