This mail is an automated notification from the patch tracker
 of the project: The GNU Hurd.

/**************************************************************************/
[patch #3350] Latest Modifications:

Changes by: 
                Marcus Brinkmann <[EMAIL PROTECTED]>
'Date: 
                Tue 12/07/04 at 14:17 (Europe/Berlin)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Applied
         Assigned to | None                      | ams
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
Committed by Alfred 2004-12-05.






/**************************************************************************/
[patch #3350] Full Item Snapshot:

URL: <http://savannah.gnu.org/patch/?func=detailitem&item_id=3350>
Project: The GNU Hurd
Submitted by: Neal H. Walfield
On: Wed 09/08/04 at 10:36

Category:  GNU Mach
Priority:  5 - Normal
Resolution:  Applied
Privacy:  Public
Assigned to:  ams
Originator Email:  
Status:  Closed


Summary:  printk may cause buffer overruns

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  <[EMAIL PROTECTED]>

        * 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.



Follow-up Comments
------------------


-------------------------------------------------------
Date: Tue 12/07/04 at 14:17         By: Marcus Brinkmann <marcus>
Committed by Alfred 2004-12-05.






File Attachments
-------------------

-------------------------------------------------------
Date: Wed 09/08/04 at 10:36  Name: printf.diff  Size: 2.18KB   By: neal

http://savannah.gnu.org/patch/download.php?item_id=3350&amp;item_file_id=3650






For detailed info, follow this link:
<http://savannah.gnu.org/patch/?func=detailitem&item_id=3350>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-hurd

Reply via email to