History log of /drivers/char/tpm/tpm_bios.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
/drivers/char/tpm/tpm_bios.c
88e9d34c727883d7d6f02cf1475b3ec98b8480c7 23-Sep-2009 James Morris <jmorris@namei.org> seq_file: constify seq_operations

Make all seq_operations structs const, to help mitigate against
revectoring user-triggerable function pointers.

This is derived from the grsecurity patch, although generated from scratch
because it's simpler than extracting the changes from there.

Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/char/tpm/tpm_bios.c
fbaa58696cef848de818768783ef185bd3f05158 13-May-2009 Eric Paris <eparis@redhat.com> TPM: get_event_name stack corruption

get_event_name uses sprintf to fill a buffer declared on the stack. It fills
the buffer 2 bytes at a time. What the code doesn't take into account is that
sprintf(buf, "%02x", data) actually writes 3 bytes. 2 bytes for the data and
then it nul terminates the string. Since we declare buf to be 40 characters
long and then we write 40 bytes of data into buf sprintf is going to write 41
characters. The fix is to leave room in buf for the nul terminator.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
/drivers/char/tpm/tpm_bios.c
ea7e96e0f2277107d9ea14c3f16c86ba82b2e560 16-Dec-2008 Lin Ming <ming.m.lin@intel.com> ACPI: remove private acpica headers from driver files

External driver files should not include any private acpica headers.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/char/tpm/tpm_bios.c
3bd60464e3224820bc413c45ea2cc371edc63e9d 26-Jul-2008 Adrian Bunk <bunk@kernel.org> tpm_bios.c: make 2 structs static

This patch makes two needlessly global structs static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Marcel Selhorst <tpm@selhorst.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/char/tpm/tpm_bios.c
8e81cc13a88ce486a6b0a6ca56aba6985824917a 22-Aug-2007 Kent Yoder <shpedoikal@gmail.com> tpmdd maintainers

Fix up the maintainers info in the tpm drivers. Kylene will be out for
some time, so copying the sourceforge list is the best way to get some
attention.

Cc: Marcel Selhorst <tpm@selhorst.net>
Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/char/tpm/tpm_bios.c
03ce11048b3832f5f0c471ccdb3363a870a14ac1 20-Jul-2007 Reiner Sailer <sailer@us.ibm.com> Fix memory leak in tpm_binary_bios_measurements_open()

The same problem that was fixed for tpm_ascii_bios_measurements_open()
in commit 178554ae75739e91dc4d7c3e42a3db95448cc5bf also occurs in
tpm_binary_bios measurements(). Thanks for noticing this Satyam!

I tested the attached patch to fix tpm_binary_bios_measurments as well.

Signed-off-by: Reiner Sailer <sailer@watson.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/char/tpm/tpm_bios.c
178554ae75739e91dc4d7c3e42a3db95448cc5bf 20-Jul-2007 Jesper Juhl <jesper.juhl@gmail.com> Memory leak in tpm_ascii_bios_measurements_open()

Coverity found a memory leak in tpm_ascii_bios_measurements_open().

If "read_log(log)" fails, then we may leak 'log' and
'log->bios_event_log'.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Seiji Munetoh <munetoh@jp.ibm.com>
Cc: Stefan Berger <stefanb@us.ibm.com>
Cc: Reiner Sailer <sailer@watson.ibm.com>
Cc: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/char/tpm/tpm_bios.c
2b8693c0617e972fc0b2fd1ebf8de97e15b656c3 12-Feb-2007 Arjan van de Ven <arjan@linux.intel.com> [PATCH] mark struct file_operations const 3

Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/char/tpm/tpm_bios.c
15a58ed12142939d51076380e6e58af477ad96ec 02-Feb-2007 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> ACPICA: Remove duplicate table definitions (non-conflicting), cont

Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/char/tpm/tpm_bios.c
44d7aff035118e8c3993aa3fa05d358d1008e982 31-May-2006 Seiji Munetoh <seiji.munetoh@gmail.com> [PATCH] tpm: more bios log parsing fixes

From: Seiji Munetoh <seiji.munetoh@gmail.com>

Change the binary output format to actual ACPI TCPA log structure since the
current format does not contain all event-data information that need to
verify the PCRs in TPM. tpm_binary_bios_measurements_show() uses
get_event_name() to convert the binary event-data to ascii format, and puts
them as binary. However, to verify the PCRs, the event-data must be a
actual binary event-data used by SHA1 calc. in BIOS.

So, I think actual ACPI TCPA log is good for this binary output format.
That way, any userland tools easily parse this data with reference to TCG
PC specification.

Signed-off-by: Seiji Munetoh <seiji.munetoh@gmail.com>
Acked-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
de66a695bef17264b2472c06e981c068bfa0636e 31-May-2006 Seiji Munetoh <seiji.munetoh@gmail.com> [PATCH] tpm: bios log parsing fixes

From: Seiji Munetoh <seiji.munetoh@gmail.com>

Fix "tcpa_pc_event" misalignment between enum, strings and TCG PC spec and
output of the event which contains a hash data.

Signed-off-by: Seiji Munetoh <seiji.munetoh@gmail.com>
Acked-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
8b006db604527c566dc1dd0aebae37714143aaef 22-Apr-2006 Kylene Jo Hall <kjhall@us.ibm.com> [PATCH] tpm: update bios log code for 1.2

The acpi table which contains the BIOS log events was updated for 1.2.
There are now client and server modes as defined in the specifications with
slightly different formats. Additionally, the start field was even too
small for the 1.1 version but had been working anyway. This patch updates
the code to deal with any of the three types of headers probperly (1.1, 1.2
client and 1.2 server).

Signed-off-by: Kylie Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
7c69a47f1badf40dfa2febac71df98d32b1b56d7 22-Apr-2006 Kylene Jo Hall <kjhall@us.ibm.com> [PATCH] tpm: fix missing string

A string corresponding to the tcpa_pc_event_id POST_CONTENTS was missing
causing an overflow bug when access was attempted in the get_event_name
function.

This bug was found by Coverity.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
59e89f3a091d5cf93f4b176aedcfded61ece5252 22-Apr-2006 Kylene Jo Hall <kjhall@us.ibm.com> [PATCH] tpm: fix memory leak

The eventname was kmalloc'd and not freed in the *_show functions.

This bug was found by Coverity.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
295b117ef334bcc3c9596117cb0aa640054e35fc 01-Feb-2006 Kylene Jo Hall <kjhall@us.ibm.com> [PATCH] tpm: tpm_bios remove unused variable

Remove event_data_size since it was pointed out in tpm_bios-indexing-
fix.patch that is was ugly and it wasn't actually being used.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
10296cb0b2b0b0eb312f81032216504a64ee675a 01-Feb-2006 Kylene Jo Hall <kjhall@us.ibm.com> [PATCH] tpm: tpm_bios fix sparse warnings

Fixing the sparse warnings on the acpi_os_map_memory calls pointed out by
Randy.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
7bcee5b86a8d9f8a0f2c1848fd9abd675e09e969 01-Feb-2006 Kylene Jo Hall <kjhall@us.ibm.com> [PATCH] tpm: tpm-bios: fix module license issue

Attempting to insert the tpm modules fails because the tpm_bios file is
missing a license statement.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
1c40f7d4f0a9d5242f19b02b00e3e5a8ee218a20 01-Feb-2006 Andrew Morton <akpm@osdl.org> [PATCH] tpm_bios indexing fix

It generates warnings:

drivers/char/tpm/tpm_bios.c: In function `get_event_name':
drivers/char/tpm/tpm_bios.c:223: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:223: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:223: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:224: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:224: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:224: warning: cast from pointer to integer of different size

and I'm not sure what the code is doing there, but it seems wrong. We're
using the address of the buffer rather than the contents of it.

The patch adds more nasty typecasting, but I think the whole arrangement could
be done in a more typesafe manner.

Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
ca4a031f6b43edb8745ebc0a1b7307c24719dae4 01-Feb-2006 Andrew Morton <akpm@osdl.org> [PATCH] tpm_bios: securityfs error checking fix

These functions return ERR_PTR()s on error, not NULL.

Spotted by Randy.

Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Acked-by: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
d09cf7d77f62f6fb2f6d63fe5980583805f2d559 08-Jan-2006 Kylene Jo Hall <kjhall@us.ibm.com> [PATCH] tpmdd: remove global event log

Remove global event log in the tpm bios event measurement log code that
would have caused problems when the code was run concurrently. A log is
now allocated and attached to the seq file upon open and destroyed
appropriately.

Signed-off-by: Kylene Jo Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c
55a82ab3181be039c6440d3f2f69260ad6fe2988 08-Jan-2006 Kylene Jo Hall <kjhall@us.ibm.com> [PATCH] tpm: add bios measurement log

According to the TCG specifications measurements or hashes of the BIOS code
and data are extended into TPM PCRS and a log is kept in an ACPI table of
these extensions for later validation if desired. This patch exports the
values in the ACPI table through a security-fs seq_file.

Signed-off-by: Seiji Munetoh <munetoh@jp.ibm.com>
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/char/tpm/tpm_bios.c