Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: ccp: Implement CSV_HGSC_CERT_IMPORT ioctl command #342

Merged

Conversation

Avenger-285714
Copy link
Collaborator

Hygon General Security Certificates (HGSC) are the basic certificates that enable Hygon CPUs' security functions. The security functions, such as CSV, will not work until the HGSC is imported.

Test reference: see the comments in https://gitee.com/openeuler/kernel/issues/I98M2W

hygon inclusion
category: feature
CVE: NA


The CSV_HGSC_CERT_IMPORT command can be used to import hygon general secure cert to the Secure Proccessor, to enable Hygon Secure Functions, such as CSV, TPM, TPCM, TDM.

Link: https://gitee.com/deepin-kernelsig/kernel/pulls/3

hygon inclusion
category: feature
CVE: NA

---------------------------

The CSV_HGSC_CERT_IMPORT command can be used to import hygon
general secure cert to the Secure Proccessor, to enable Hygon
Secure Functions, such as CSV, TPM, TPCM, TDM.

Signed-off-by: fangbaoshun <fangbaoshun@hygon.cn>
Signed-off-by: hanliyang <hanliyang@hygon.cn>
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • csv_ioctl函数中,hygon_psp_hooks.sev_cmd_mutexmutex_lockmutex_unlock之间没有释放,可能会导致死锁。
  • csv_ioctl函数中的argp参数应该使用void __user *argp类型,而不是void *argp,以避免潜在的类型安全问题。
  • csv_ioctl_do_hgsc_import函数中的hgscsk_blobhgsc_blob变量在kfree之前应该检查是否为NULL,以避免潜在的空指针解引用错误。
  • csv_cmd_buffer_len函数的实现没有考虑到CSV_CMD_HGSC_CERT_IMPORT命令的特定需求,例如可能需要更大的缓冲区大小。
  • csv_fops结构体的owner字段应该设置为THIS_MODULE,以确保正确的模块加载和卸载操作。
  • sev_issue_cmd_external_user函数中的filep参数应该使用struct file *filep类型,而不是void *filep,以避免潜在的类型安全问题。
  • sev_issue_cmd_external_user函数中的error参数应该使用int *error类型,而不是void *error,以避免潜在的类型安全问题。
  • sev_misc_init函数中的misc结构体没有正确初始化minor字段,可能会导致问题。
  • sev_dev_destroy函数中的psp参数应该使用struct psp_device *psp类型,而不是void *psp,以避免潜在的类型安全问题。

是否建议立即修改:

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign goldendeng for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Avenger-285714 Avenger-285714 merged commit eb71f89 into deepin-community:linux-6.6.y Jul 29, 2024
4 of 5 checks passed
opsiff pushed a commit to opsiff/UOS-kernel that referenced this pull request Jul 29, 2024
[ Upstream commit 5f1d18de79180deac2822c93e431bbe547f7d3ce ]

Add a test case which replaces an active ingress qdisc while keeping the
miniq in-tact during the transition period to the new clsact qdisc.

  # ./vmtest.sh -- ./test_progs -t tc_link
  [...]
  ./test_progs -t tc_link
  [    3.412871] bpf_testmod: loading out-of-tree module taints kernel.
  [    3.413343] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  deepin-community#332     tc_links_after:OK
  deepin-community#333     tc_links_append:OK
  deepin-community#334     tc_links_basic:OK
  deepin-community#335     tc_links_before:OK
  deepin-community#336     tc_links_chain_classic:OK
  deepin-community#337     tc_links_chain_mixed:OK
  deepin-community#338     tc_links_dev_chain0:OK
  deepin-community#339     tc_links_dev_cleanup:OK
  deepin-community#340     tc_links_dev_mixed:OK
  deepin-community#341     tc_links_ingress:OK
  deepin-community#342     tc_links_invalid:OK
  deepin-community#343     tc_links_prepend:OK
  deepin-community#344     tc_links_replace:OK
  deepin-community#345     tc_links_revision:OK
  Summary: 14/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20240708133130.11609-2-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit e41db26543ef24b6906a832f73119cfadcd99f35)
Avenger-285714 pushed a commit that referenced this pull request Aug 12, 2024
[ Upstream commit 5f1d18de79180deac2822c93e431bbe547f7d3ce ]

Add a test case which replaces an active ingress qdisc while keeping the
miniq in-tact during the transition period to the new clsact qdisc.

  # ./vmtest.sh -- ./test_progs -t tc_link
  [...]
  ./test_progs -t tc_link
  [    3.412871] bpf_testmod: loading out-of-tree module taints kernel.
  [    3.413343] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  #332     tc_links_after:OK
  #333     tc_links_append:OK
  #334     tc_links_basic:OK
  #335     tc_links_before:OK
  #336     tc_links_chain_classic:OK
  #337     tc_links_chain_mixed:OK
  #338     tc_links_dev_chain0:OK
  #339     tc_links_dev_cleanup:OK
  #340     tc_links_dev_mixed:OK
  #341     tc_links_ingress:OK
  #342     tc_links_invalid:OK
  #343     tc_links_prepend:OK
  #344     tc_links_replace:OK
  #345     tc_links_revision:OK
  Summary: 14/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20240708133130.11609-2-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit e41db26543ef24b6906a832f73119cfadcd99f35)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants