Re: Security bug in 2.1.103: old style stat(2)

Alexander Kjeldaas (astor@guardian.no)
Mon, 25 May 1998 11:30:50 +0200


--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii

On Sun, May 24, 1998 at 08:38:13PM +0100, Tigran Aivazian wrote:
> Hello guys,
>
> IN fs/stat.c cp_old_stat() issues warning about old style stat() usage
> continuously; this can be used by a malicious person to fill up system
> logs.
>
> Just thought would let you know, since /proc/pci and /dev/cua? behave in a
> different manner (only one warning until next reboot).
>

Attached is a patch (not tested).

astor

-- 
 Alexander Kjeldaas, Guardian Networks AS, Trondheim, Norway
 http://www.guardian.no/

--FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sec1.patch"

--- linux/fs/stat.c Mon Feb 23 21:55:58 1998 +++ l/fs/stat.c Mon May 25 11:29:15 1998 @@ -39,9 +39,12 @@ static int cp_old_stat(struct inode * inode, struct __old_kernel_stat * statbuf) { struct __old_kernel_stat tmp; + static int nagcount = 0; - printk("VFS: Warning: %s using old stat() call. Recompile your binary.\n", - current->comm); + if (++nagcount < 5) + printk("VFS: Warning: %s using old stat() call. " + "Recompile your binary.\n", + current->comm); tmp.st_dev = kdev_t_to_nr(inode->i_dev); tmp.st_ino = inode->i_ino; tmp.st_mode = inode->i_mode;

--FCuugMFkClbJLl1L--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu