mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 00:00:52 +07:00
fs: dlm: check on minimum msglen size
[ Upstream commit 710176e8363f269c6ecd73d203973b31ace119d3 ] This patch adds an additional check for minimum dlm header size which is an invalid dlm message and signals a broken stream. A msglen field cannot be less than the dlm header size because the field is inclusive header lengths. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ca973d2aea
commit
ff58d1c72e
@ -49,9 +49,10 @@ int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int len)
|
||||
* cannot deliver this message to upper layers
|
||||
*/
|
||||
msglen = get_unaligned_le16(&hd->h_length);
|
||||
if (msglen > DEFAULT_BUFFER_SIZE) {
|
||||
log_print("received invalid length header: %u, will abort message parsing",
|
||||
msglen);
|
||||
if (msglen > DEFAULT_BUFFER_SIZE ||
|
||||
msglen < sizeof(struct dlm_header)) {
|
||||
log_print("received invalid length header: %u from node %d, will abort message parsing",
|
||||
msglen, nodeid);
|
||||
return -EBADMSG;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user