Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
5ca9d3a4
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5ca9d3a4
编写于
11月 12, 2015
作者:
J
James Morris
浏览文件
操作
浏览文件
下载
差异文件
Merge tag 'tpmdd-next-20151110' of
https://github.com/jsakkine/linux-tpmdd
into for-linus
上级
5d50ac70
d56e4f75
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
16 deletion
+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
未找到文件。
drivers/char/tpm/tpm-chip.c
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录