patchThe GNU Hurd - Patches: patch #3350, printk may cause buffer overruns

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3350: printk may cause buffer overruns

Submitter:  Neal H. Walfield <neal>
Submitted:  Wed 08 Sep 2004 10:36:14 AM UTC
   
 
Category:  GNU Mach Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  ams Open/Closed:  Closed
Planned Release:  None
Wiki-like text discussion box: 


Tue 07 Dec 2004 02:17:26 PM UTC, comment #1: 

Committed by Alfred 2004-12-05.

Marcus Brinkmann <marcus>
Group administrator
Wed 08 Sep 2004 10:36:14 AM UTC, original submission:  

The implementation of printk in linux/dev/kernel/printk.c assumes that
the formatted string is less than sizeof (buf) - 3 (BUF being a statically
allocated string of 2048 bytes).  Code in Linux violates this assumption.
For instance, linux/src/drivers/pci/pci.c:pci_init which prints out the
pci bus topography if debugging is enabled.  I looked at writing a
linux_vsnprintf to replace the linux_vsprintf, however, the code is a mess
and the Mach printf code is much easier to work with (kern/printf.c).
Hence, I modified that.

Thanks.

2004-09-08  Neal H. Walfield  <neal@cs.uml.edu>

        * linux/dev/kernel/printk.c: Include <kern/assert.h>.
        (printk): Use vsnprintf, not linux_vsprintf to avoid buffer
        overruns.

        * kern/printf.c (struct vsnprintf_cookie): New structure.
        (snputc): New function.
        (vsnprintf): Likewise.


Neal H. Walfield <neal>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #7845:  printf.diff added by neal (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-12-07 marcus StatusNone Done
    Assigned toNone ams
    Open/ClosedOpen Closed
2004-09-08 neal Attached File- Added printf.diff, #3650

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code