Skip to contentSkip to conversation

kernel-kexecc-use-vscnprintf-instead-of-vsnprintf-in-vmcoreinfo_append_str.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jan 28, 2014 kexec

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] kernel-kexecc-use-vscnprintf-instead-of-vsnprintf-in-vmcoreinfo_append_str.patch removed from -mm tree
To: [email protected],[email protected]
From: [email protected]
Date: Tue, 28 Jan 2014 11:09:47 -0800

The patch titled
Subject: kernel/kexec.c: use vscnprintf() instead of vsnprintf() in vmcoreinfo_append_str()
has been removed from the -mm tree. Its filename was
kernel-kexecc-use-vscnprintf-instead-of-vsnprintf-in-vmcoreinfo_append_str.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Chen Gang <[email protected]>
Subject: kernel/kexec.c: use vscnprintf() instead of vsnprintf() in vmcoreinfo_append_str()

vsnprintf() may let 'r' larger than sizeof(buf), in this case, if 'r' is also less than "vmcoreinfo_max_size - vmcoreinfo_size" (left size of destination buffer), next memcpy() will read the unexpected addresses.

---

 kernel/kexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kexec.c renamed from kernel/kexec.c~kernel-kexecc-use-vscnprintf-instead-of-vsnprintf-in-vmcoreinfo_append_str +1 -1
diff -puN kernel/kexec.c~kernel-kexecc-use-vscnprintf-instead-of-vsnprintf-in-vmcoreinfo_append_str kernel/kexec.c
@@ -1537,7 +1537,7 @@ void vmcoreinfo_append_str(const char *f
 	size_t r;
 
 	va_start(args, fmt);
-	r = vsnprintf(buf, sizeof(buf), fmt, args);
+	r = vscnprintf(buf, sizeof(buf), fmt, args);
 	va_end(args);
 
 	r = min(r, vmcoreinfo_max_size - vmcoreinfo_size);

_

Patches currently in -mm which might be from [email protected] are

origin.patch
linux-next.patch