[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160108101323.GA2532@codeblueprint.co.uk>
Date: Fri, 8 Jan 2016 10:13:23 +0000
From: Matt Fleming <matt@...eblueprint.co.uk>
To: Insu Yun <wuninsu@...il.com>
Cc: linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org,
taesoo@...ech.edu, yeongjin.jang@...ech.edu, insu@...ech.edu,
changwoo@...ech.edu, Tony Luck <tony.luck@...el.com>
Subject: Re: [PATCH] efi: fix out-of-bounds null overwrite vulnerability
On Thu, 07 Jan, at 02:05:30PM, Insu Yun wrote:
> snprintf's return value is not bound by size value.
> (https://www.kernel.org/doc/htmldocs/kernel-api/API-snprintf.html)
> if printed value is larger than buffer size, it can overwrite
> null byte in out-of-bounds buffer.
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.
> Signed-off-by: Insu Yun <wuninsu@...il.com>
> ---
> drivers/firmware/efi/cper.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
> index d425374..77aa75f 100644
> --- a/drivers/firmware/efi/cper.c
> +++ b/drivers/firmware/efi/cper.c
> @@ -267,7 +267,6 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
> "DIMM location: not present. DMI handle: 0x%.4x ",
> mem->mem_dev_handle);
>
> - msg[n] = '\0';
> return n;
> }
>
Calling this a vulnerability is a little extreme. These fields come
from firmware and if you can't trust the firmware you've got bigger
issues.
I'm not even sure this is a bug. Tony?
Powered by blists - more mailing lists