[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3908561D78D1C84285E8C5FCA982C28F39FA7208@ORSMSX114.amr.corp.intel.com>
Date: Fri, 8 Jan 2016 16:47:17 +0000
From: "Luck, Tony" <tony.luck@...el.com>
To: Matt Fleming <matt@...eblueprint.co.uk>,
Insu Yun <wuninsu@...il.com>
CC: "linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"taesoo@...ech.edu" <taesoo@...ech.edu>,
"yeongjin.jang@...ech.edu" <yeongjin.jang@...ech.edu>,
"insu@...ech.edu" <insu@...ech.edu>,
"changwoo@...ech.edu" <changwoo@...ech.edu>
Subject: RE: [PATCH] efi: fix out-of-bounds null overwrite vulnerability
> But this function doesn't use snprintf(), it uses scnprintf() which
> returns the number of characters written into buf and, because
> scnprintf() largely follows vnsprintf(), it will never write more than
> 'size' bytes into the buffer.
if (bank && device)
n = snprintf(msg, len, "DIMM location: %s %s ", bank, device);
That looks like "snprintf", not "scnprintf" to me :-)
What about using:
msg[len] = '\0';
to guarantee NUL termination?
-Tony
Powered by blists - more mailing lists