4
0
Эх сурвалжийг харах

ipc: Check for the libraries sending invalid message IDs

If the library sent an invalid (ie too high) message ID to
corosync, then it could cause the daemon to crash.

Now we check the message ID before indexing the function array

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Christine Caulfield 8 жил өмнө
parent
commit
876910d8ff
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      exec/main.c

+ 5 - 0
exec/main.c

@@ -758,6 +758,11 @@ int corosync_sending_allowed (
 		return -EINVAL;
 	}
 
+	/* Message ID out of range */
+	if (id >= corosync_service[service]->lib_engine_count) {
+		return -EINVAL;
+	}
+
 	sending_allowed = QB_FALSE;
 	if (corosync_quorum_is_quorate() == 1 ||
 	    corosync_service[service]->allow_inquorate == CS_LIB_ALLOW_INQUORATE) {