Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5ca9d3a4
Commit
5ca9d3a4
authored
Nov 12, 2015
by
James Morris
Browse files
Options
Browse Files
Download
Plain Diff
Merge tag 'tpmdd-next-20151110' of
https://github.com/jsakkine/linux-tpmdd
into for-linus
parents
5d50ac70
d56e4f75
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
16 deletions
+30
-16
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm-chip.c
+11
-9
drivers/char/tpm/tpm2-cmd.c
drivers/char/tpm/tpm2-cmd.c
+10
-5
drivers/char/tpm/tpm_of.c
drivers/char/tpm/tpm_of.c
+2
-1
drivers/char/tpm/tpm_tis.c
drivers/char/tpm/tpm_tis.c
+7
-1
No files found.
drivers/char/tpm/tpm-chip.c
View file @
5ca9d3a4
...
...
@@ -226,21 +226,23 @@ int tpm_chip_register(struct tpm_chip *chip)
if
(
rc
)
goto
out_err
;
if
(
!
(
chip
->
flags
&
TPM_CHIP_FLAG_TPM2
))
{
rc
=
__compat_only_sysfs_link_entry_to_kobj
(
&
chip
->
pdev
->
kobj
,
&
chip
->
dev
.
kobj
,
"ppi"
);
if
(
rc
)
goto
out_err
;
}
/* Make the chip available. */
spin_lock
(
&
driver_lock
);
list_add_rcu
(
&
chip
->
list
,
&
tpm_chip_list
);
list_add_
tail_
rcu
(
&
chip
->
list
,
&
tpm_chip_list
);
spin_unlock
(
&
driver_lock
);
chip
->
flags
|=
TPM_CHIP_FLAG_REGISTERED
;
if
(
!
(
chip
->
flags
&
TPM_CHIP_FLAG_TPM2
))
{
rc
=
__compat_only_sysfs_link_entry_to_kobj
(
&
chip
->
pdev
->
kobj
,
&
chip
->
dev
.
kobj
,
"ppi"
);
if
(
rc
&&
rc
!=
-
ENOENT
)
{
tpm_chip_unregister
(
chip
);
return
rc
;
}
}
return
0
;
out_err:
tpm1_chip_unregister
(
chip
);
...
...
drivers/char/tpm/tpm2-cmd.c
View file @
5ca9d3a4
...
...
@@ -443,12 +443,13 @@ int tpm2_seal_trusted(struct tpm_chip *chip,
TPM_DIGEST_SIZE
);
/* sensitive */
tpm_buf_append_u16
(
&
buf
,
4
+
TPM_DIGEST_SIZE
+
payload
->
key_len
);
tpm_buf_append_u16
(
&
buf
,
4
+
TPM_DIGEST_SIZE
+
payload
->
key_len
+
1
);
tpm_buf_append_u16
(
&
buf
,
TPM_DIGEST_SIZE
);
tpm_buf_append
(
&
buf
,
options
->
blobauth
,
TPM_DIGEST_SIZE
);
tpm_buf_append_u16
(
&
buf
,
payload
->
key_len
);
tpm_buf_append_u16
(
&
buf
,
payload
->
key_len
+
1
);
tpm_buf_append
(
&
buf
,
payload
->
key
,
payload
->
key_len
);
tpm_buf_append_u8
(
&
buf
,
payload
->
migratable
);
/* public */
tpm_buf_append_u16
(
&
buf
,
14
);
...
...
@@ -573,6 +574,8 @@ static int tpm2_unseal(struct tpm_chip *chip,
u32
blob_handle
)
{
struct
tpm_buf
buf
;
u16
data_len
;
u8
*
data
;
int
rc
;
rc
=
tpm_buf_init
(
&
buf
,
TPM2_ST_SESSIONS
,
TPM2_CC_UNSEAL
);
...
...
@@ -591,11 +594,13 @@ static int tpm2_unseal(struct tpm_chip *chip,
rc
=
-
EPERM
;
if
(
!
rc
)
{
payload
->
key
_len
=
be16_to_cpup
(
data
_len
=
be16_to_cpup
(
(
__be16
*
)
&
buf
.
data
[
TPM_HEADER_SIZE
+
4
]);
data
=
&
buf
.
data
[
TPM_HEADER_SIZE
+
6
];
memcpy
(
payload
->
key
,
&
buf
.
data
[
TPM_HEADER_SIZE
+
6
],
payload
->
key_len
);
memcpy
(
payload
->
key
,
data
,
data_len
-
1
);
payload
->
key_len
=
data_len
-
1
;
payload
->
migratable
=
data
[
data_len
-
1
];
}
tpm_buf_destroy
(
&
buf
);
...
...
drivers/char/tpm/tpm_of.c
View file @
5ca9d3a4
...
...
@@ -53,17 +53,18 @@ int read_log(struct tpm_bios_log *log)
goto
cleanup_eio
;
}
of_node_put
(
np
);
log
->
bios_event_log
=
kmalloc
(
*
sizep
,
GFP_KERNEL
);
if
(
!
log
->
bios_event_log
)
{
pr_err
(
"%s: ERROR - Not enough memory for BIOS measurements
\n
"
,
__func__
);
of_node_put
(
np
);
return
-
ENOMEM
;
}
log
->
bios_event_log_end
=
log
->
bios_event_log
+
*
sizep
;
memcpy
(
log
->
bios_event_log
,
__va
(
*
basep
),
*
sizep
);
of_node_put
(
np
);
return
0
;
...
...
drivers/char/tpm/tpm_tis.c
View file @
5ca9d3a4
...
...
@@ -645,6 +645,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
{
u32
vendor
,
intfcaps
,
intmask
;
int
rc
,
i
,
irq_s
,
irq_e
,
probe
;
int
irq_r
=
-
1
;
struct
tpm_chip
*
chip
;
struct
priv_data
*
priv
;
...
...
@@ -751,6 +752,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
irq_s
=
ioread8
(
chip
->
vendor
.
iobase
+
TPM_INT_VECTOR
(
chip
->
vendor
.
locality
));
irq_r
=
irq_s
;
if
(
irq_s
)
{
irq_e
=
irq_s
;
}
else
{
...
...
@@ -805,6 +807,8 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
iowrite32
(
intmask
,
chip
->
vendor
.
iobase
+
TPM_INT_ENABLE
(
chip
->
vendor
.
locality
));
devm_free_irq
(
dev
,
i
,
chip
);
}
}
if
(
chip
->
vendor
.
irq
)
{
...
...
@@ -831,7 +835,9 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
chip
->
vendor
.
iobase
+
TPM_INT_ENABLE
(
chip
->
vendor
.
locality
));
}
}
}
else
if
(
irq_r
!=
-
1
)
iowrite8
(
irq_r
,
chip
->
vendor
.
iobase
+
TPM_INT_VECTOR
(
chip
->
vendor
.
locality
));
if
(
chip
->
flags
&
TPM_CHIP_FLAG_TPM2
)
{
chip
->
vendor
.
timeout_a
=
msecs_to_jiffies
(
TPM2_TIMEOUT_A
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment