diff options
author | Daniel Mack <daniel@zonque.org> | 2014-12-08 10:28:00 +0100 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2014-12-08 10:28:00 +0100 |
commit | 3b2fffd644e009aa93b4554ace4276244b44bfd4 (patch) | |
tree | 0ed5b263b4c578636e15178b178d004585c65fe3 /handle.c | |
parent | 939db15e726af38eb5978f1aa1927634e9118cdb (diff) | |
download | kdbus-bus-3b2fffd644e009aa93b4554ace4276244b44bfd4.tar.gz kdbus-bus-3b2fffd644e009aa93b4554ace4276244b44bfd4.tar.bz2 kdbus-bus-3b2fffd644e009aa93b4554ace4276244b44bfd4.zip |
resources: make sure vec sources are not accessed illegally
VEC source addresses are no longer valid after the SEND ioctl
returns. Add a boolean flag to track that, and BUG_ON() in case
someone calls kdbus_kmsg_make_vec_slice() from invalid contexts.
Signed-off-by: Daniel Mack <daniel@zonque.org>
Diffstat (limited to 'handle.c')
-rw-r--r-- | handle.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -615,6 +615,12 @@ static long handle_ep_ioctl_connected(struct file *file, unsigned int cmd, ret = -EFAULT; } + /* + * Once the ioctl returns, the src_addr pointers stored in + * the message resources are no longer valid. Make sure + * nobody accesses them by accident. + */ + kmsg->res->vec_src_valid = false; kdbus_kmsg_free(kmsg); break; } |