+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
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)) {
/* 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;
}
/* 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);