Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[PATCH -tip] x86,ioapic: use snrpintf while set names for ..

 
   Soft32 Home -> Linux -> Kernel RSS
Next:  [PATCH] trivial: fix checking socket() in net tst..  
Author Message
Cyrill Gorcunov

External


Since: Apr 19, 2009
Posts: 8



(Msg. 1) Posted: Sun Nov 08, 2009 11:20 am
Post subject: [PATCH -tip] x86,ioapic: use snrpintf while set names for IO-APIC resourses
Archived from groups: linux>kernel (more info?)

We should be ready that one day MAX_IO_APICS may raise its
number. To prevent memory overwrite we're to use safe
snprintf while set IO-APIC resourse name.

Signed-off-by: Cyrill Gorcunov <gorcunov.DeleteThis@openvz.org>
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.git/arch/x86/kernel/apic/io_apic.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6.git/arch/x86/kernel/apic/io_apic.c
@@ -4099,7 +4099,7 @@ static struct resource * __init ioapic_s
for (i = 0; i < nr_ioapics; i++) {
res[i].name = mem;
res[i].flags = IORESOURCE_MEM | IORESOURCE_BUSY;
- sprintf(mem, "IOAPIC %u", i);
+ snprintf(mem, IOAPIC_RESOURCE_NAME_SIZE, "IOAPIC %u", i);
mem += IOAPIC_RESOURCE_NAME_SIZE;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
tip-bot for Cyrill Gorcun

External


Since: Apr 19, 2009
Posts: 5



(Msg. 2) Posted: Sun Nov 08, 2009 11:20 am
Post subject: [tip:x86/apic] x86, ioapic: Use snrpintf while set names for IO-APIC resourses [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Commit-ID: 4343fe1024e09e17667f95620ed3e69a7a5f4389
Gitweb: http://git.kernel.org/tip/4343fe1024e09e17667f95620ed3e69a7a5f4389
Author: Cyrill Gorcunov <gorcunov.TakeThisOut@openvz.org>
AuthorDate: Sun, 8 Nov 2009 18:54:31 +0300
Committer: Ingo Molnar <mingo.TakeThisOut@elte.hu>
CommitDate: Sun, 8 Nov 2009 17:06:23 +0100

x86, ioapic: Use snrpintf while set names for IO-APIC resourses

We should be ready that one day MAX_IO_APICS may raise its
number. To prevent memory overwrite we're to use safe
snprintf while set IO-APIC resourse name.

Signed-off-by: Cyrill Gorcunov <gorcunov.TakeThisOut@openvz.org>
Cc: Yinghai Lu <yinghai.TakeThisOut@kernel.org>
LKML-Reference: <20091108155431.GC25940@lenovo>
Signed-off-by: Ingo Molnar <mingo.TakeThisOut@elte.hu>
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 9ee1c16..24d1458 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -4066,7 +4066,7 @@ static struct resource * __init ioapic_setup_resources(int nr_ioapics)
for (i = 0; i < nr_ioapics; i++) {
res[i].name = mem;
res[i].flags = IORESOURCE_MEM | IORESOURCE_BUSY;
- sprintf(mem, "IOAPIC %u", i);
+ snprintf(mem, IOAPIC_RESOURCE_NAME_SIZE, "IOAPIC %u", i);
mem += IOAPIC_RESOURCE_NAME_SIZE;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[patch] i386: more ioapic checks - Coverity reports apic numbers are being passed to functions without checking to see if they are legal. (This is Kernel...

[PATCH] - Add IOAPIC NMI support on x86_64 - Add support for IOAPIC NMI interrupts on x86_64. Changes include the following: - Obtain the NMI IOAPIC info via an...

[PATCH] - x86_64-add-ioapic-nmi-support-fix-3 - Place all the IOACPI NMI support code under CONFIG_ACPI to clear up build errors with certain configs. Signed-off-by:....

[PATCH] namespaces: update some function names - From: Serge E. Hallyn <serue@us.ibm.com> Subject: [PATCH] namespaces: update some function names The..

[PATCH] AF_RXRPC: Make call state names available if CONFI.. - Make the call state names array available even if CONFIG_PROC_FS is disabled as it's used in other places (such as..

[PATCH] Correct bad CONFIG names in drivers/usb/input/Make.. - Correct the incorrect CONFIG_ variables currently in drivers/usb/input/Makefile that prevent three of the touchscreen..
       Soft32 Home -> Linux -> Kernel All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]