[lkml]   [2001]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: PROPOSAL: dot-proc interface [was: /proc stuff]
On Tue Nov 06, 2001 at 02:49:23PM -0500, wrote:
> In article <> Erik Anderson wrote:
> > Come now, it really isn't that difficult:
> > char name[80];
> > if (sscanf(line, "%4u %4u %llu %s", &major, &minor, &size, name) == 4)
> if it's so easy to do, why do you have a great big buffer overflow here?

Sorry, no doughnut for you. drivers/block/genhd.c:

int get_partition_list(char *page, char **start, off_t offset, int count)
char buf[64];


len += snprintf(page + len, 63, "%4d %4d %10d %s\n", gp->major, n,
gp->sizes[n], disk_name(gp, n, buf));

so each /proc/partitions line maxes out at 63 bytes. So not only
is there no overflow, I am providing 16 extra bytes of padding.


Erik B. Andersen
--This message was written using 73% post-consumer electrons--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:12    [W:0.232 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site