bug in /dev/full ??

Steven S. Dick (ssd@nevets.oau.org)
Tue, 1 Apr 97 03:09 EST

A friend of mine noticed these [probably incorrect] permissions on /dev/full
cr--r--r-- 1 root sys 1, 7 Jul 17 1994 /dev/full
(Redhat 4.x) and wondered what reading from /dev/full meant...
He tried it, and got random junk...

Looking at 2.0.28/drivers/char/mem.c, I find this:

static int read_full(struct inode * node, struct file * file, char * buf,int count)
file->f_pos += count;
return count;

It appears that read_full advances the file position as if data had been
read, but doesn't put any data in the buffer... So whatever data was
last read on this file descriptor shows up over and over.

Is this what /dev/full should do on read?
What would a more correct behavior be?

I searched the kernel archives, and found that someone else posted
about this bug around January 7, but there were no replies, and
the bug was not fixed. There are no patches to mem.c in 2.0.29.