Re: [PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-16 Thread Kent Yoder
On Thu, Aug 16, 2012 at 12:16:33AM +0200, Jesper Juhl wrote: > In drivers/char/tpm/tpm_acpi.c::read_log() we call > acpi_os_map_memory(). That call may fail for a number of reasons > (invalid address, out of memory etc). If the call fails it returns > NULL and we just pass that to memcpy()

Re: [PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-16 Thread Kent Yoder
On Thu, Aug 16, 2012 at 12:16:33AM +0200, Jesper Juhl wrote: In drivers/char/tpm/tpm_acpi.c::read_log() we call acpi_os_map_memory(). That call may fail for a number of reasons (invalid address, out of memory etc). If the call fails it returns NULL and we just pass that to memcpy()

[PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-15 Thread Jesper Juhl
In drivers/char/tpm/tpm_acpi.c::read_log() we call acpi_os_map_memory(). That call may fail for a number of reasons (invalid address, out of memory etc). If the call fails it returns NULL and we just pass that to memcpy() unconditionally, which will go bad when it tries to dereference the pointer.

Re: [PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-15 Thread Jesper Juhl
On Wed, 15 Aug 2012, Kent Yoder wrote: > Hi Jesper, > > > > Unfortunately we just get NULL back, so we can't really tell the user > > > exactely what went wrong, but we can at least avoid crashing and > > > return an error (-EIO seemed more generic and more suitable here than > > > -ENOMEM or

Re: [PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-15 Thread Kent Yoder
Hi Jesper, > > Unfortunately we just get NULL back, so we can't really tell the user > > exactely what went wrong, but we can at least avoid crashing and > > return an error (-EIO seemed more generic and more suitable here than > > -ENOMEM or something else, so I picked that). > > Thanks Jesper.

Re: [PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-15 Thread Kent Yoder
Hi Jesper, Unfortunately we just get NULL back, so we can't really tell the user exactely what went wrong, but we can at least avoid crashing and return an error (-EIO seemed more generic and more suitable here than -ENOMEM or something else, so I picked that). Thanks Jesper. I'd made

Re: [PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-15 Thread Jesper Juhl
On Wed, 15 Aug 2012, Kent Yoder wrote: Hi Jesper, Unfortunately we just get NULL back, so we can't really tell the user exactely what went wrong, but we can at least avoid crashing and return an error (-EIO seemed more generic and more suitable here than -ENOMEM or something else,

[PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-15 Thread Jesper Juhl
In drivers/char/tpm/tpm_acpi.c::read_log() we call acpi_os_map_memory(). That call may fail for a number of reasons (invalid address, out of memory etc). If the call fails it returns NULL and we just pass that to memcpy() unconditionally, which will go bad when it tries to dereference the pointer.

Re: [PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-08 Thread Kent Yoder
On Tue, Aug 07, 2012 at 10:50:56PM +0200, Jesper Juhl wrote: > In drivers/char/tpm/tpm_bios.c::read_log() we call > acpi_os_map_memory(). That call may fail for a number of reasons > (invallid address, out of memory etc). If the call fails it returns > NULL and we just pass that to memcpy()

Re: [PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-08 Thread Kent Yoder
On Tue, Aug 07, 2012 at 10:50:56PM +0200, Jesper Juhl wrote: In drivers/char/tpm/tpm_bios.c::read_log() we call acpi_os_map_memory(). That call may fail for a number of reasons (invallid address, out of memory etc). If the call fails it returns NULL and we just pass that to memcpy()

[PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-07 Thread Jesper Juhl
In drivers/char/tpm/tpm_bios.c::read_log() we call acpi_os_map_memory(). That call may fail for a number of reasons (invallid address, out of memory etc). If the call fails it returns NULL and we just pass that to memcpy() unconditionally, which will go bad when it tries to dereference the

[PATCH] tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.

2012-08-07 Thread Jesper Juhl
In drivers/char/tpm/tpm_bios.c::read_log() we call acpi_os_map_memory(). That call may fail for a number of reasons (invallid address, out of memory etc). If the call fails it returns NULL and we just pass that to memcpy() unconditionally, which will go bad when it tries to dereference the