Fix: deny overwrite mode and num subbuf less than 2
authorDavid Goulet <dgoulet@efficios.com>
Fri, 23 May 2014 14:57:37 +0000 (10:57 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 23 May 2014 14:57:37 +0000 (10:57 -0400)
Also fixed in UST and modules with commit:

(modules) 5140d2b3070f211e6d8a0ad7cb0a190e8b6f3e28
(ust) 3d8e9399b2fb9000b3b55e488a7d04184b5bb56e

Fixes #793

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/cmd.c

index 339a7659e5ae63b00d8547d6ac47656cb81e69a8..9ef9686bd40b3c29727451a9d52d11a4367e64f0 100644 (file)
@@ -850,6 +850,16 @@ int cmd_enable_channel(struct ltt_session *session,
 
        rcu_read_lock();
 
+       /*
+        * The ringbuffer (both in user space and kernel) behave badly in overwrite
+        * mode and with less than 2 subbuf so block it right away and send back an
+        * invalid attribute error.
+        */
+       if (attr->attr.overwrite && attr->attr.num_subbuf < 2) {
+               ret = LTTNG_ERR_INVALID;
+               goto error;
+       }
+
        switch (domain->type) {
        case LTTNG_DOMAIN_KERNEL:
        {
This page took 0.027524 seconds and 4 git commands to generate.