diff --git a/net/lnet/lnet/lib-md.c b/net/lnet/lnet/lib-md.c index 7ea0f5e..4a70c76 100644 --- a/net/lnet/lnet/lib-md.c +++ b/net/lnet/lnet/lib-md.c @@ -325,6 +325,10 @@ int lnet_cpt_of_md(struct lnet_libmd *md, unsigned int offset) CERROR("Invalid option: too many fragments %u, %d max\n", umd->length, LNET_MAX_IOV); return -EINVAL; + } else if (umd->length > LNET_MTU) { + CERROR("Invalid length: too big fragment size %u, %d max\n", + umd->length, LNET_MTU); + return -EINVAL; } return 0;