]> sourceware.org Git - systemtap.git/commitdiff
2007-09-20 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Thu, 20 Sep 2007 17:03:45 +0000 (17:03 +0000)
committerhunt <hunt>
Thu, 20 Sep 2007 17:03:45 +0000 (17:03 +0000)
* transport.h: Increase default buffer size.
* control.c (_stp_ctl_read_cmd): Check buffer size.

runtime/transport/ChangeLog
runtime/transport/control.c
runtime/transport/transport.h

index b720b112927e9f6a61a1e5edc38c68072441192b..b03b4b0aef342a8cfd2d9958e4ddb8d79b01c667 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-20  Martin Hunt  <hunt@redhat.com>
+
+       * transport.h: Increase default buffer size.
+       * control.c (_stp_ctl_read_cmd): Check buffer size.
+
 2007-09-10  Martin Hunt  <hunt@redhat.com>
 
        * procfs.c (_stp_register_ctl_channel): Call 
index 5242af4954859878cc0277620a5c5fb94414d5fc..6df9a8af83762d5a2db089c2fe6d24088fee9f94 100644 (file)
@@ -195,8 +195,6 @@ _stp_ctl_read_cmd (struct file *file, char __user *buf, size_t count, loff_t *pp
        int len;
        unsigned long flags;
 
-       /* FIXME FIXME FIXME. assuming count is large enough to hold buffer!! */
-
        /* wait for nonempty ready queue */
        spin_lock_irqsave(&_stp_ready_lock, flags);
        while (list_empty(&_stp_ready_q)) {
@@ -215,11 +213,12 @@ _stp_ctl_read_cmd (struct file *file, char __user *buf, size_t count, loff_t *pp
 
        /* write it out */
        len = bptr->len + 4;
-       if (copy_to_user(buf, &bptr->type, len)) {
+       if (len > count || copy_to_user(buf, &bptr->type, len)) {
                /* now what?  We took it off the queue then failed to send it */
                /* we can't put it back on the queue because it will likely be out-of-order */
                /* fortunately this should never happen */
                /* FIXME need to mark this as a transport failure */
+               errk("Supplied buffer too small. count:%d len:%d\n", count, len);
                return -EFAULT;
        }
 
index 78b011810decee13a3aa3f010fec0b69ecbd83e6..0a83001e7840fab9c23d7f2d1efcd7ab4ce0c1b7 100644 (file)
@@ -14,8 +14,8 @@ void _stp_warn (const char *fmt, ...);
 /* how often the work queue wakes up and checks buffers */
 #define STP_WORK_TIMER (HZ/100)
 
-static unsigned _stp_nsubbufs = 4;
-static unsigned _stp_subbuf_size = 65536*2;
+static unsigned _stp_nsubbufs = 8;
+static unsigned _stp_subbuf_size = 65536*4;
 extern void _stp_transport_close(void);
 extern int _stp_print_init(void);
 extern void _stp_print_cleanup(void);
This page took 0.033997 seconds and 5 git commands to generate.