diff -NurpP linux-2.6.18-vs2.1.1-rc37.2/kernel/vserver/history.c linux-2.6.18-vs2.1.1-rc37.3/kernel/vserver/history.c --- linux-2.6.18-vs2.1.1-rc37.2/kernel/vserver/history.c 2006-10-07 18:25:19 +0200 +++ linux-2.6.18-vs2.1.1-rc37.3/kernel/vserver/history.c 2006-10-08 17:15:24 +0200 @@ -203,9 +203,9 @@ int do_read_history(struct __user _vx_hi if (idx < start) idx = start; - for (pos = 0; (pos < *count) && (idx <= end); pos++, idx++) { + for (pos = 0; (pos < *count) && (idx < end); pos++, idx++) { struct _vx_hist_entry *entry = - &hist->entry[idx & VXH_SIZE]; + &hist->entry[idx % VXH_SIZE]; /* send entry to userspace */ ret = copy_to_user (&data[pos], entry, sizeof(*entry)); diff -NurpP linux-2.6.18-vs2.1.1-rc37.2/kernel/vserver/monitor.c linux-2.6.18-vs2.1.1-rc37.3/kernel/vserver/monitor.c --- linux-2.6.18-vs2.1.1-rc37.2/kernel/vserver/monitor.c 2006-10-07 18:28:41 +0200 +++ linux-2.6.18-vs2.1.1-rc37.3/kernel/vserver/monitor.c 2006-10-08 17:14:54 +0200 @@ -83,9 +83,9 @@ int do_read_monitor(struct __user _vx_mo if (idx < start) idx = start; - for (pos = 0; (pos < *count) && (idx <= end); pos++, idx++) { + for (pos = 0; (pos < *count) && (idx < end); pos++, idx++) { struct _vx_mon_entry *entry = - &mon->entry[idx & VXM_SIZE]; + &mon->entry[idx % VXM_SIZE]; /* send entry to userspace */ ret = copy_to_user (&data[pos], entry, sizeof(*entry));