TT#91151 add additional check for kernel module commands

Change-Id: I27f9ca4f03cd979ecbcf01e8fb1801a306f9d396
pull/1194/head
Richard Fuchs 4 years ago
parent fa6d29b45c
commit abb281daac

@ -76,7 +76,8 @@ static int kernel_open_table(unsigned int id) {
ZERO(msg);
msg.cmd = REMG_NOOP;
msg.u.size = sizeof(msg);
msg.u.noop.size = sizeof(msg);
msg.u.noop.last_cmd = __REMG_LAST;
i = write(fd, &msg, sizeof(msg));
if (i <= 0)
goto fail;

@ -3293,8 +3293,10 @@ static inline ssize_t proc_control_read_write(struct file *file, char __user *ub
switch (msg->cmd) {
case REMG_NOOP:
if (msg->u.size != sizeof(*msg))
if (msg->u.noop.size != sizeof(*msg))
err = -EMSGSIZE;
if (msg->u.noop.last_cmd != __REMG_LAST)
err = -ERANGE;
break;
case REMG_ADD:

@ -146,9 +146,14 @@ struct rtpengine_stats_info {
struct rtpengine_ssrc_stats ssrc_stats; // output
};
struct rtpengine_noop_info {
size_t size;
int last_cmd;
};
struct rtpengine_message {
enum {
/* size: */
/* noop_info: */
REMG_NOOP = 1,
/* target_info: */
@ -175,7 +180,7 @@ struct rtpengine_message {
} cmd;
union {
size_t size;
struct rtpengine_noop_info noop;
struct rtpengine_target_info target;
struct rtpengine_call_info call;
struct rtpengine_stream_info stream;

Loading…
Cancel
Save