Akhil R
efa698bed8
crypto: tegra: Do not use IV for AES ECB
...
It may happen that the variable req->iv may have stale values or
zero sized buffer by default and may end up getting used during
encryption/decryption. This in turn may corrupt the results or break
the operation. Ensure not use IV for algorithms like AES ECB where IV
is not expected.
Bug 4883011
Change-Id: I309ad26f99fe54005ff71b270b3b115dc62ac168
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3319062
(cherry picked from commit 4b72ba2c83 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322768
Tested-by: Brad Griffis <bgriffis@nvidia.com >
Reviewed-by: Jon Hunter <jonathanh@nvidia.com >
Reviewed-by: svcacv <svcacv@nvidia.com >
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Reviewed-by: Brad Griffis <bgriffis@nvidia.com >
2025-03-20 09:43:41 -07:00
Akhil R
e7bf6f1444
crypto: tegra: Reserve keyslots to allocate dynamically
...
The HW supports only storing 15 keys at a time. This limits the number
of tfms that can work without failutes. Reserve keyslots to solve this
and use the reserved ones during the encryption/decryption operation.
This allow users to have the capability of hardware protected keys
and faster operations if there are limited number of tfms while not
halting the operation if there are more tfms.
Bug 4883011
Change-Id: I220f1e8205dde1f078be6ed4cb09b699b6d5dfa2
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263283
(cherry picked from commit 15d7ca57b1 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322767
Tested-by: Brad Griffis <bgriffis@nvidia.com >
Reviewed-by: Brad Griffis <bgriffis@nvidia.com >
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Reviewed-by: Jon Hunter <jonathanh@nvidia.com >
2025-03-20 09:43:35 -07:00
Akhil R
e228deeef1
crypto: tegra: Use separate buffer setkey
...
Use a separate buffer for setkey operation. setkey() is called
asynchronous to crypto engine APIs. This causes concurrency issues in
the tegra engine oprations.
Bug 4883011
Change-Id: I1ec7d0a041ee8a0a0bf350d2f3e9915091993034
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263282
(cherry picked from commit 2f3c077115 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322626
Tested-by: Brad Griffis <bgriffis@nvidia.com >
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Reviewed-by: Brad Griffis <bgriffis@nvidia.com >
Reviewed-by: Jon Hunter <jonathanh@nvidia.com >
2025-03-20 09:43:29 -07:00
Brad Griffis
36a712b801
Revert "crypto: tegra: Use separate buffer for each host1x command"
...
This reverts commit f6c3d49e92 .
Reason for revert: Optimize implementation and align with upstream.
Bug 4883011
Change-Id: I32fe35daa30ddb5a272dbeee0c3316134e9ca55b
Signed-off-by: Brad Griffis <bgriffis@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3321697
(cherry picked from commit efeb1061bb )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322625
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Reviewed-by: Jon Hunter <jonathanh@nvidia.com >
2025-03-20 09:43:23 -07:00
Akhil R
087418781c
crypto: tegra: Use separate buffer for each host1x command
...
Allocate separate buffer for each host1x command. The single buffer used
for host1x commands can get corrupted when independent crypto operations
overlap.
Bug 4883011
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I43029364c8e65e5014a5b7068cb45225c039aaf8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3248913
(cherry picked from commit f6c3d49e92 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3262770
Reviewed-by: Brad Griffis <bgriffis@nvidia.com >
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Tested-by: Brad Griffis <bgriffis@nvidia.com >
Reviewed-by: Amulya Yarlagadda <ayarlagadda@nvidia.com >
2024-12-17 15:56:55 -08:00
Akhil R
f41b74b8c3
crypto: tegra: Fix size of buffer allocated
...
Allocate the buffer based on the request instead of a fixed buffer
length. In operations which may require larger buffer size, a fixed
buffer may fail. Similar patch was added for AES algorithms. Fix the
same for HASH algorithms as well.
Bug 4908156
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: Idd2c1ceae1a85434a5a51154a17dce8c927bb66c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3234055
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
(cherry picked from commit 3415677f0f )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3235205
2024-10-24 08:31:48 -07:00
Bitan Biswas
f3b12ead83
crypto: fix crypto_engine_ctx build error
...
struct crypto_engine_ctx removed in k6.6 hence use
conftest helper based macro to select updated data types
Bug 4346767
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com >
Change-Id: Iaf565c4ef74fdd87ea0020b369bc3d882d32326e
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3176823
Reviewed-by: svcacv <svcacv@nvidia.com >
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
(cherry picked from commit cba663d0db )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3196067
2024-08-26 04:08:59 -07:00
Akhil R
f73208daa3
crypto: tegra: Fix size of buffer allocated
...
Allocate the buffer based on the request instead of a fixed buffer
length. In operations which may require larger buffer size, a fixed
buffer may fail.
Bug 4798264
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I0eac3e04aed89b07f5674cf69828d3ac0801a6c7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3194058
(cherry picked from commit 01bdbd8a6679a5e31d0a06e5f21cd20cf0600ba6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3199308
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com >
Tested-by: Brad Griffis <bgriffis@nvidia.com >
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Reviewed-by: Brad Griffis <bgriffis@nvidia.com >
2024-08-24 15:24:02 -07:00
Akhil R
80c7d7a67b
crypto: tegra: Align with upstream
...
Fix the known bugs in the SE driver and align the driver with the
upstream version
Bug 4488964
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I6efa471b6efcd161d36167a0784185f3e0266d7c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3124250
(cherry picked from commit abb0a027b2 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3196063
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
2024-08-20 02:24:41 -07:00
Jon Hunter
233a7eb320
drivers: Fix missing headers for Linux v6.8
...
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.
Bug 4448428
Change-Id: Ia40ab13f865d5631c96855ecc49145848f99c996
Signed-off-by: Jon Hunter <jonathanh@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032442
(cherry picked from commit ab65399274 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063003
Reviewed-by: Brad Griffis <bgriffis@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2024-01-25 13:55:11 -08:00
Laxman Dewangan
259736545b
crypto: Enable few of crypto driver for Linux6.6
...
Enable crypto drivers which are getting build properly
with Linux 6.6 and keep disabling the compilation of
build failed drivers.
Bug 4346767
Change-Id: Ia5c67759b6c839a874ea9e38d601c722596e0008
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3010492
(cherry picked from commit 9b0b059027 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053821
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com >
Tested-by: Jonathan Hunter <jonathanh@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2024-01-16 14:56:09 -08:00
Bitan Biswas
34fd7d68dc
crypto: fix crypto_engine_ctx build error
...
struct crypto_engine_ctx removed in k6.6 hence use
conftest helper based macro to select updated data types
Bug 4346767
Change-Id: I2c00f99251e90f0dd3641703ba24a2a8ac23e927
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994021
(cherry picked from commit 48e59e9d42 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053820
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com >
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
Tested-by: Jonathan Hunter <jonathanh@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2024-01-16 14:56:04 -08:00
Jon Hunter
069d6bb3eb
drivers: Enable -Wmissing-prototypes
...
The compiler option -Wmissing-prototypes is being enabled globally in
the upstream Linux kernel and this causes build failures for various
drivers. The build failures occur because either the driver is missing
an include file which has the prototype or because the function is not
declared statically when it should be (ie. there are no external users).
Fix the various build failures and enable -Wmissing-prototypes to
prevent any new instances from occurring. Note that the only driver that
is not fixed at the moment is rtl8822ce due to large number of failures
and so build this with '-Wno-missing-prototypes' for now, which is not
different to how it was being compiled prior to this change.
Bug 4404965
Change-Id: Ie5572d23659e0346fa035d645d9043b0a6da5fdc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027488
(cherry picked from commit d5391a25ab )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3034644
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-12-18 09:11:10 -08:00
Akhil R
7cf41996cb
crypto: tegra: Free CMAC fallback tfm during exit
...
Free the CMAC fallback tfm to fix the memory leak during CMAC operation.
The fallback tfm is setup during init but never freed.
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: Icb9ccf330f94e93459c241ed7105a221832c0514
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2998701
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-10-22 03:23:04 -07:00
Akhil R
3926014666
crypto: tegra: Fix coverity and CERT C defects
...
Fix the following coverity defects.
ID 10181328, CID 687742 - Uninitialized variable
ID 10181331 - Dead code
ID 10181330, CID 687711 - Uninitialize variable
ID 10181332 - Potential overflow
ID 10181329 - Wrong data type
Bug 3952896
Bug 3959323
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I62064ee9b0cef4ad78a1aa4980637fcd3df682d6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2995805
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
Reviewed-by: svcacv <svcacv@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-10-12 20:38:15 -07:00
Manish Bhardwaj
25bd4163f9
crypto: increase buffer support for SHA operation
...
Using this patches we are making below changes:-
1. increase buffer support for SHA operation from 1MB to 2MB
2. get the IVC DB during init call.
Bug 4141706
Change-Id: I8101430117569049f3420db58ed06e0158cc2dcc
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984637
Reviewed-by: Advaya Andhare <aandhare@nvidia.com >
Reviewed-by: Sandeep Trasi <strasi@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-10-03 19:01:22 -07:00
Akhil R
e7f2897cee
crypto: tegra: Deprecate Tegra Nvhost driver for k5.15
...
Remove Tegra SE Nvhost driver to deprecate the support for T186
and T194 Security Engines in kernel-5.15.
Bug 4221414
Bug 3579794
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I425bc7068f2139e73dd14f0187d10ea856260cac
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984417
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-10-03 18:59:34 -07:00
Akhil R
2659fcd46a
crypto: tegra: Add updated Tegra SE driver
...
Add the updated Tegra SE driver with the below improvements.
- Remove dependency with nvhost apis and use upstream Host1x APIs.
- Implement software fallbacks for keys/plaintexts unsupported by
hardware.
- Support only T234 and later. Prior chips will use tegra-se-nvhost
driver.
Bug 4221414
Bug 3579794
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I398a5b7cc3f752b44d01d6d1c81f813f862e4cd9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2977810
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-10-03 18:59:24 -07:00
Manish Bhardwaj
f6227e9c57
crypto: check buffer size before allocing DMA memory
...
Passing zero size to dma_alloc API is causing below crash.
Added check on requested size before sending request to
dma layer.
[ 4178.581558] sg_alloc_append_table_from_pages+0x28c/0x480
[ 4178.581790] sg_alloc_table_from_pages_segment+0x40/0xb0
[ 4178.582009] __iommu_dma_alloc_noncontiguous.isra.0+0x244/0x3a0
[ 4178.582258] iommu_dma_alloc+0x280/0x3b0
[ 4178.582424] dma_alloc_attrs+0xf8/0x110
[ 4178.582588] tegra_hv_vse_get_db+0x76c/0x70e0 [tegra_hv_vse_safety]
[ 4178.582850] hash_sendmsg+0xa8/0x290
[ 4178.583001] sock_sendmsg+0x68/0x90
[ 4178.583146] __sys_sendto+0xf0/0x170
[ 4178.583298] __arm64_sys_sendto+0x38/0x60
[ 4178.583466] invoke_syscall+0x5c/0x150
[ 4178.583628] el0_svc_common.constprop.0+0x100/0x120
[ 4178.583829] do_el0_svc+0x3c/0xb0
[ 4178.583966] el0_svc+0x20/0x70
[ 4178.584098] el0t_64_sync_handler+0xc0/0xd0
[ 4178.584270] el0t_64_sync+0x1a4/0x1a8
Bug 4259208
Change-Id: I134bc84e7b5cbda7db4ed7dbcad4e1c6955429d8
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983402
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com >
Reviewed-by: Vipin Kumar <vipink@nvidia.com >
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-09-22 20:08:52 -07:00
Manish Bhardwaj
1b6b4f8746
crypto: Fix compilation warning
...
Bug 4213877
Change-Id: Ic7fd0496473c5e3225e6235a18176faa8fe3e1be
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2982158
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com >
Reviewed-by: Vipin Kumar <vipink@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-09-21 21:32:13 -07:00
Manish Bhardwaj
90953fc012
Revert "crypto: nvvse: Fix compilation warning"
...
Bug 4213877
This reverts commit 88af3f4d9f .
Reason for revert: <Proper fix is being merged>
Change-Id: I3442f9a06cd752a5bc9f9c328a8d311a195f1574
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2982104
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com >
Reviewed-by: Vipin Kumar <vipink@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-09-21 21:32:08 -07:00
Advaya Andhare
7d1a687636
nvvse: Allowing multiple access to dev node
...
- This CL partially reverts the changes done in CL - 2891721
- Current implementation checks if multiple process/threads/apps
try to access same dev node when it is already open by another
process/thread/app, and throws an error if condition is true causing
new process/threads/apps to fail as in bug mentioned below
- This change allows multiple process/threads/apps to access the same
dev node.
bug 4126726
jira ESSS-759
Change-Id: Ibe18449014e69148ae2feebd854b6c5d278f5bc4
Signed-off-by: Advaya Andhare <aandhare@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2946094
(cherry picked from commit 615a1aba49e2662d767a23e47fed329627f6f91e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2956815
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Nagaraj P N <nagarajp@nvidia.com >
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-by: Vipin Kumar <vipink@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-08-17 20:29:44 -07:00
Jian-Min Liu
1df2ef7d23
nvidia-oot: Fix compilation warning for ack build
...
Refine the compiler flags for ACK make command and fix compilation
warnings from the new command.
Bug 4187941
Bug 4223187
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com >
Change-Id: Iff7bf5839c585a6c3d3ef6daefb64eb113c739e2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954087
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-08-14 01:54:51 -07:00
Akhil R
37cf697fb1
crypto: tegra: Init keyslot for SHA as well
...
Inititalize keyslot for SHA algorithms as well since SHA-HMAC
uses the same keyslots.
Also reduce the log level of some prints. The scenario does not
have any functional impact that the user need to be notified.
Bug 4221414
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I73449144ce56aaf35fae52aa1c4c5b0bb8c01d9c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2952640
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-08-13 00:37:29 -07:00
Jian-Min Liu
fc93f2390c
Separate -Werror=frame-larger-than as clang can't recognize
...
Use '-Werror' and '-Wframe-larger-than' to replace
'-Werror=frame-larger-than' since clang compiler can't
ecognize the combination.
Build failure:
error: unknown warning option '-Werror=frame-larger-than=2560'; did you
mean '-Werror=frame-larger-than='? [-Werror,-Wunknown-warning-option]
Bug 4187941
Change-Id: I4d05a8dc96820517e1047b982a24ed97bb21327f
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938229
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-07-20 01:19:53 -07:00
Jon Hunter
06f4bc788a
crypto: Remove -Wno-implicit-fallthrough flag
...
The crypto drivers compile fine without the ccflag
-Wno-implicit-fallthrough so remove this flag to catch any new warnings
that might be introduced.
Bug 4190030
Change-Id: Ibddbd9d76ea1faa4fa4d5b3a1ed12e1eaf36b40d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2936714
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-07-19 08:46:53 -07:00
Jon Hunter
88af3f4d9f
crypto: nvvse: Fix compilation warning
...
Building the nvvse-cryptodev driver generates the following warning ...
drivers/crypto/tegra-nvvse-cryptodev.c:2118:1: error: the frame size of
2224 bytes is larger than 2048 bytes [-Werror=fra
me-larger-than=]
2118 | }
| ^
For now allow the frame size to be 2560 bytes to resolve the warning
while a proper fix is implemented.
Bug 4190030
Change-Id: Id361aebc9f3d83181afc820d8d9cf2ef90e33d55
Signed-off-by: Jon Hunter <jonathanh@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934696
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-07-17 14:37:49 -07:00
Advaya Andhare
883ddf60ca
NVVSE: protect shared resources through mutex
...
Concurrent access of shared variable causing the issue intermittently.
Conditions to wait/handle shared variable updated.
Added mutex locks to protect shared resources.
bug 4155882
Bug 4159212
jira ESSS-707
Change-Id: I3b50e39abf2dfec2ef33b813c7227fcd0634222a
Signed-off-by: Advaya Andhare <aandhare@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2928908
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-by: Leo Chiu <lchiu@nvidia.com >
Reviewed-by: Vipin Kumar <vipink@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-07-12 04:42:12 -07:00
Advaya Andhare
967fa5d4b4
NVVSE: Implement dummy-message functionality
...
- Introduced interrupt state for dummy message functionality
- Added functionality for dummy-message
Change-Id: I3bac031159ea9398b4515ca354fdbc2c7d4274c6
Signed-off-by: Advaya Andhare <aandhare@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913263
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-by: Leo Chiu <lchiu@nvidia.com >
Reviewed-by: Vipin Kumar <vipink@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913361
2023-07-12 04:42:06 -07:00
Neelansh Mittal
34288b623d
crypto: Single shot processing of input buffers
...
Support single shot processing for AES GMAC/CMAC/ENC/DEC
and SHA operations.
Bug 4155882
Bug 4086302
Change-Id: Ib2ef39b2fbb7493285947b118b9d1fcdeaefe5b6
Signed-off-by: Neelansh Mittal <neelanshm@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2931625
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-by: Vipin Kumar <vipink@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-07-07 06:59:25 -07:00
Akhil R
02c4ecb369
crypto: tegra-se-nvhost: Use GFP_ATOMIC if in atomic context
...
Check if the request may sleep and adjust the GFP flag. This fixes
the issue of sleep during atomic context in tegra-se driver.
Bug 4146804
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I40006fd0898a85ced75f49565106a9b47ed0dfd0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2931331
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-07-07 06:58:01 -07:00
Manish Bhardwaj
5e3551960b
crypto: fix cert error
...
Using this patch we are fixing below cert error:-
1. cert_mem30_c_violation: Dereferencing freed pointer ctx.
CID 660103
Bug 3512545
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Change-Id: I4a37aa7743d07669805254ec2fc088a3835f5f3e
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2898370
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Sachin Nikam <snikam@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-05-04 11:50:45 -07:00
Laxman Dewangan
e27ba12d27
crypto: Get rid of explicit header inclusion
...
The required headers for crypto driver are already
included in the master makefile. Hence, it is not
required to add include path explicitly.
Bug 4087103
Change-Id: I54ca12ab6de8de802ab75473419be3e77cfbad1f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2894609
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-27 02:55:32 -07:00
Manish Bhardwaj
afd475c259
crypto: perform only single SHA op at one time
...
perform single SHA operatin at one time. Multiple
SHA operations at single dev node lead to SHA failure
issues.
Bug 4075005
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Change-Id: Ifc610b278e6a74c82813f564c98c0ee16783b69e
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2891724
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Advaya Andhare <aandhare@nvidia.com >
Reviewed-by: Sandeep Trasi <strasi@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-26 09:42:31 -07:00
Manish Bhardwaj
e7075688b1
crypto: open nvvse node only once during operation
...
open nvvse node only once during vse operation,
if another thread try to open then return error.
Bug 4075005
Change-Id: Iea88799bf761442cecc8e6336e9743e0fe7cd6e2
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2891721
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Advaya Andhare <aandhare@nvidia.com >
Reviewed-by: Sandeep Trasi <strasi@nvidia.com >
Reviewed-by: svcacv <svcacv@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-26 09:42:26 -07:00
Laxman Dewangan
13556fa7d2
crypto: Use SPDX GPL 2.0 license format
...
Use SPDX license format for license and copyright
information. Update year also.
Bug 4078035
Change-Id: I8a5b0f60c702b7fb9a30b5b50ca4058165d38cc9
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890632
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-21 11:40:45 -07:00
Manish Bhardwaj
f9a0264f89
crypto: fix memory leak issue
...
Using this patch we are fixing memory leak
issue
Bug 4064812
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Change-Id: Ifd2e74e5d1b9b6cbd91a6ec65e45626066c9a1f5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2888604
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com >
Reviewed-by: Sandeep Trasi <strasi@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-20 06:47:15 -07:00
Manish Bhardwaj
fe2085dcef
crypto: fix compilation warning
...
local variables size is more then recommended values leading
to compilation warning. So usign this patch we are fixing
below compilation warnigs:-
nvidia-oot/drivers/crypto/tegra-nvvse-cryptodev.c:
In function ‘tnvvse_crypto_dev_ioctl’:
nvidia-oot/drivers/crypto/tegra-nvvse-cryptodev.c:2103:1:
warning: the frame size of 2224 bytes is larger than 2048 bytes
[-Wframe-larger-than=]
Bug 4064812
Change-Id: Ie5f0489c9733451f9a132e146790a18d3dd4d6f9
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2887287
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Sandeep Trasi <strasi@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-14 08:21:59 -07:00
Rounak Agarwal
f5e605c3da
Use new numbers for VSE commands
...
In the change I527644b9f9b8b8ff7f5d1382e3fee0627b9deeb8, VSE commands
have been renumbered. This commit copies the new numbers to VSE driver.
JIRA ESSS-503
Change-Id: I9d6318ccfef6fc8d3a022dbf36200d1a1bb5ec39
Signed-off-by: Rounak Agarwal <rounaka@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2872675
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-04-10 20:47:13 -07:00
Manish Bhardwaj
ac315cf5ad
nvvse: Enable Multipart/Singlepart UserNonce
...
crypto: hvvse: UserNonce enable for CBC/CTR
- Using SE server for CBC mode
- Updating counter for CTR mode
- Copying IV to userspace from kernelspace only for non userNonce
Jira ESSS-467
crypto: Support Multipart CBC/CTR
- Updated update_counter function
- Added support for mulitpart CBC/CTR
Jira ESSS-525
Signed-off-by: Advaya Andhare <aandhare@nvidia.com >
Change-Id: I3a85f510d28a6bd26b4b6b5b216c2659ec4052c6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2874482
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-04-05 05:59:35 -07:00
Manish Bhardwaj
ba066d3e58
crypto: fix memory leak in crypto driver
...
when SHA operation gets started using SHA_INIT and
it did not gets finished using SHA_FINAL leads to memory
leak. So Using this patch we are fixing the memory leak
in crypto driver.
Bug 4039712
Change-Id: I3ef9f93afc7677f3a7317c85d82cbab44d1fed82
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2878402
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com >
Reviewed-by: Sandeep Trasi <strasi@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-03-31 04:18:32 -07:00
Akhil R
698c663564
crypto: tegra: Check return value for clk_*() calls
...
Check return value for clk_prepare_enable calls to fix the
coverity issue.
ID 10162284
ID 10162277
ID 10162262
Bug 3952896
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I881a806b1f810c1c99c068dd45196c7e9bb49f39
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2870248
Reviewed-by: Kartik . <kkartik@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com >
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-03-24 17:12:06 -07:00
Akhil R
da3ddb1fcb
crypto: tegra: Fix list_del corruption
...
Update the cmdbuf management to fix the list_del corruption
and few improvements.
Bug 3995933
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: I8a692ef042d045813cea0494073832a1b87bcaa3
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2871670
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-03-22 18:57:26 -07:00
Manish Bhardwaj
d02c050207
crypto: use 4 byte keyhandle for tsec operation
...
TSEC operation is using 4 byte keyhandle only, whereas
other operations are using 16 byte keyhandle.
Bug 4031715
Bug 4030215
Change-Id: I19e2ca6afaef903824b6a0e99f94e6e68e533af7
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2873636
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-03-21 09:48:31 -07:00
Manish Bhardwaj
a14b439800
nvidia: fix ioctl call and tsec operation
...
Using this patch we are fixing below 2 issues:-
1. Fixes below issue of invalid ioctl call.
tnvvse_crypto_dev_ioctl(): invalid ioctl code(-1073440754[0xc004980e])
2. Fixes below crash issue once we introduced
[ 50.137568] Unable to handle kernel paging request at virtual address
ffffffffffffff80
l c00498[ 50.172247] Mem abort info:
[ 50.172248] printk: console [ttyS2]: printing thread stopped
[ 50.172773] ESR = 0x96000004
[ 50.178757] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000081c8f000
[ 50.202663] Hardware name: p3710-0010 (DT)
[ 50.203353] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 50.204464] pc : tegra_ivc_notified+0x1c/0x160
[ 50.205194] lr : tegra_ivc_notified+0x1c/0x160
[ 50.205890] sp : ffff8000136733c0
[ 50.218023] Call trace:
[ 50.218425] tegra_ivc_notified+0x1c/0x160
[ 50.219088] tegra_hv_ivc_channel_notified+0x24/0x1f0 [tegra_hv]
[ 50.220077] tegra_hv_vse_get_db+0x1f80/0x6680 [tegra_hv_vse_safety]
[ 50.221129] tegra_hv_vse_safety_tsec_get_keyload_status+0xf4/0x37c
[tegra_hv_vse_safety]
[ 50.222478] tnvvse_crypto_dev_ioctl+0x23bc/0x277c [tegra_nvvse_cryptodev]
Bug 4030215
Bug 4031715
Change-Id: I25be3ab0708a5238daf342dcd20e8a948ee39508
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2872785
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Kasinadha Dendukuri <kdendukuri@nvidia.com >
Reviewed-by: Sandeep Trasi <strasi@nvidia.com >
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com >
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-03-21 02:35:10 -07:00
Jon Hunter
cadbbe3f1f
nvvse: cryptodev: Fix build for Linux v6.3
...
Commit 255e48eb1768 ("crypto: api - Use data directly in completion
function") updates the typedef crypto_completion_t such that a pointer
to the data is directly passed to the completion function instead of a
structure of type crypto_async_request. This breaks building the Tegra
NVVSE Cryptodev driver for Linux v6.3 and so update the driver
accordingly to fix the build.
Bug 4014315
Change-Id: I6e9ed50f5c226548efa5f52d094243f466ad399d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2867127
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-03-18 16:18:49 -07:00
Manish Bhardwaj
a8830def61
nvidia-oot: Increase keyslot size to 16 bytes
...
syncing changes b/w nvidia and nvidia-oot repo
Bug 3697677
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Change-Id: I0faa4d3107de5d9430ca91b407903990254e3b49
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2872402
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com >
Reviewed-by: Sandeep Trasi <strasi@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-03-17 10:18:08 -07:00
Akhil R
8a61c9f119
crypto: tegra: Fix Coverity defects
...
Fix resource leak and dead code which causes coverity defects.
ID 10162255
ID 10162275
ID 10162278
ID 10162282
ID 10162263
ID 10162268
Bug 3952896
Signed-off-by: Akhil R <akhilrajeev@nvidia.com >
Change-Id: Ib09dde2b65a3fc74bd30a4fb0e1bd594caf826ec
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2850397
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-03-10 19:08:38 -08:00
Manish Bhardwaj
c4ede4ec86
nvidia-oot: fix sparse error in vse driver.
...
Using this patch we are fixing below sparse
errors :-
1. drivers/crypto/tegra-hv-vse-safety.c:158:15:
warning: symbol 'gpcdma_dev' was not declared.
Should it be static?
Bug 3954363
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Change-Id: I00da50a74392fc43e6728cf57abed2545c509e4e
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2863098
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-03-01 10:27:17 -08:00
Advaya Andhare
9fdc09d25a
nvvse: cryptodev: user nonce, TSEC alg, ivcDB
...
Updating Kernel 5.15 with recent linux driver changes.
Jira ESSS-504
bug 3979224
Mentioned below are the details of merging changes -
NVVSE: Added support for TSEC algorithm.
- Add support for TSEC CMAC Sign/Verify commands
- Add support for command to check TSEC Keyload status
- Don't use skip_key parameter as keyslot id is always needed by VSE driver
Jira ESSS-267
nvvse: cryptodev: Add support for user nonce
Changes:
- Add support for userNonce and zero copy flag for
TLS and zero copy features
- Updaeted encrypt/decrypt function call to use
user nonce.
Jira ESSS-415
nvvse: Updated IVCCFG offset, IVC DB parameters
- Reading max buffer size and gcm dec buffer size from DT
- Update elements of IVC DB.
Jira ESSS-417
Jira ESSS-484
Jira ESSS-468
bug 3974121
Signed-off-by: Advaya Andhare <aandhare@nvidia.com >
Change-Id: Ic7c4580dc4f443db9f7e4fabfb7ec49de2973ed3
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2862329
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com >
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com >
Reviewed-by: Nagaraj P N <nagarajp@nvidia.com >
Reviewed-by: Leo Chiu <lchiu@nvidia.com >
Reviewed-by: Vipin Kumar <vipink@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-02-25 16:07:35 -08:00