lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 May 2015 09:02:05 -0400
From:	Stefan Berger <stefanb@...ux.vnet.ibm.com>
To:	"Hon Ching(Vicky) Lo" <honclo@...ux.vnet.ibm.com>,
	tpmdd-devel@...ts.sourceforge.net
CC:	Joy Latten <jmlatten@...ux.vnet.ibm.com>,
	Ashley Lai <ashley@...leylai.com>,
	linux-kernel@...r.kernel.org, Peter Huewe <PeterHuewe@....de>
Subject: Re: [tpmdd-devel] [PATCH 1/3] vTPM: fixed the limit checking

On 05/05/2015 08:51 PM, Hon Ching(Vicky) Lo wrote:
> Do not skip the last entry of the event log.
>
> Signed-off-by: Hon Ching(Vicky) Lo <honclo@...ux.vnet.ibm.com>
> Signed-off-by: Joy Latten <jmlatten@...ux.vnet.ibm.com>
>
> Changelog:
> - remove redundant code
> ---
>   drivers/char/tpm/tpm_eventlog.c |    5 +----
>   1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c
> index 3a56a13..e77d8c1 100644
> --- a/drivers/char/tpm/tpm_eventlog.c
> +++ b/drivers/char/tpm/tpm_eventlog.c
> @@ -116,11 +116,8 @@ static void *tpm_bios_measurements_next(struct seq_file *m, void *v,
>
>   	event = v;
>
> -	if (event->event_type == 0 && event->event_size == 0)
> -		return NULL;
> -
>   	if ((event->event_type == 0 && event->event_size == 0) ||
> -	    ((v + sizeof(struct tcpa_event) + event->event_size) >= limit))
> +	    ((v + sizeof(struct tcpa_event) + event->event_size) > limit))
>   		return NULL;
>
>   	(*pos)++;

The limit stems from log->bios_event_log_end and is calculated as follows:

  log->bios_event_log_end = log->bios_event_log + len;

The '>=' above is correct since the limit address itself is not part of 
the log anymore.

The log is the following sequence of addresses:

[log->bios_event_log ... log->bios_event_log + len - 1 ]

or

[log->bios_event_log ... log->bios_event_log + len [

with ']' meaning inclusive and '[' meaning exclusive.

     Stefan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ