Browse Source

TT#108350 add kernel module version/size check

Change-Id: I636a234c066922c2db604787057320b62105a0d4
pull/1164/head
Richard Fuchs 5 years ago
parent
commit
68be3d2afb
3 changed files with 5 additions and 1 deletions
  1. +1
    -0
      daemon/kernel.c
  2. +2
    -1
      kernel-module/xt_RTPENGINE.c
  3. +2
    -0
      kernel-module/xt_RTPENGINE.h

+ 1
- 0
daemon/kernel.c View File

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


+ 2
- 1
kernel-module/xt_RTPENGINE.c View File

@ -3261,7 +3261,8 @@ static inline ssize_t proc_control_read_write(struct file *file, char __user *ub
switch (msg->cmd) {
case REMG_NOOP:
DBG("noop.\n");
if (msg->u.size != sizeof(*msg))
err = -EMSGSIZE;
break;
case REMG_ADD:


+ 2
- 0
kernel-module/xt_RTPENGINE.h View File

@ -144,6 +144,7 @@ struct rtpengine_stats_info {
struct rtpengine_message {
enum {
/* size: */
REMG_NOOP = 1,
/* target_info: */
@ -170,6 +171,7 @@ struct rtpengine_message {
} cmd;
union {
size_t size;
struct rtpengine_target_info target;
struct rtpengine_call_info call;
struct rtpengine_stream_info stream;


Loading…
Cancel
Save