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

Update CHANGELOG for 4.1.0 #6574

Merged
merged 1 commit into from Jan 19, 2024

Conversation

jenswi-linaro
Copy link
Contributor

Update CHANGELOG for 4.1.0 and collect Tested-by tags.

The 4.1.0-rc1 tag will be created on Friday January 12th and the 4.1.0 release is expected on January 19th.

@jforissier
Copy link
Contributor

Commit a39a15f:
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (rockchip-rk3399) (Rockpi4B)

Commit 008031b:
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_virt)
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_armv8a)

@jbech-linaro
Copy link
Contributor

With the 4.1.0-rc1 tag:

# xtest -l15
48103 subtests of which 0 failed
106 test cases of which 0 failed
0 test cases were skipped

As usual for future reference

build -- 8c6a98a qemu: Correct initrd-end in u-boot config fragment
buildroot -- d48a8beb39 Update for 2022.11.1
firmware -- f8939644f7b firmware: Bump firmware (but not kernel) to latest master
linux -- 59b362482dbe rpi3: Enable PSCI support
optee_benchmark -- 875be7f main: fix enum argument for init_emitter()
optee_client -- 333e512 libckteec: Fix CK_ULONG conversions in C_GetTokenInfo()
optee_examples -- 378dc0d hotp: use sess_ctx instead of global variables
optee_os -- 8e9d8acca plat-vexpress: configure CFG_CORE_ASYNC_NOTIF_GIC_INTID
optee_test -- 2e1e7a9 xtest: pkcs11_1000.c: Test support of object checksum value computation
trusted-firmware-a -- a1f02f4f3 Merge "docs(changelog): generate changelog" into integration
u-boot -- d80bb749fa Prepare v2021.10

Tested-by: Joakim Bech <joakim.bech@linaro.org> (RPi 3B v1.2)

@ldts
Copy link
Contributor

ldts commented Jan 15, 2024

On Versal still debugging a Linux 5.15.0 segfault executing test 5006.3 with the 4.1.0-rc1 tag
All other tests ok.

* regression_5006 Tests for Global platform TEEC
o regression_5006.1 CloseSession_null
  regression_5006.1 OK
o regression_5006.2 Allocate_In
  regression_5006.2 OK
o regression_5006.3 Allocate_out_of_memory
Segmentation fault
D/LD:  ldelf:176 ELF (cb3e5ba0-adf1-11e0-998b-0002a5d5c51b) at 0xc0060000                                                                                                                                                                                                                                                             
D/TC:? 0 tee_ta_close_session:463 csess 0x600c8cb0 id 7                                                                                                                                                                                                                                                                               
D/TC:? 0 tee_ta_close_session:482 Destroy session                                                                                                                                                                                                                                                                                     
D/TC:? 0 destroy_context:321 Destroy TA ctx (0x600c8c50)                                                                                                                                                                                                                                                                              
[  279.376274] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010                                                                                                                                                                                                                                   
[  279.385057] Mem abort info:                                                                                                                                                                                                                                                                                                        
[  279.387839]   ESR = 0x96000044                                                                                                                                                                                                                                                                                                     
[  279.390882]   EC = 0x25: DABT (current EL), IL = 32 bits                                                                                                                                                                                                                                                                           
[  279.396183]   SET = 0, FnV = 0                                                                                                                                                                                                                                                                                                     
[  279.399226]   EA = 0, S1PTW = 0                                                                                                                                                                                                                                                                                                    
[  279.402355]   FSC = 0x04: level 0 translation fault                                                                                                                                                                                                                                                                                
[  279.407220] Data abort info:                                                                                                                                                                                                                                                                                                       
[  279.410089]   ISV = 0, ISS = 0x00000044                                                                                                                                                                                                                                                                                            
[  279.413912]   CM = 0, WnR = 1                                                                                                                                                                                                                                                                                                      
[  279.416867] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000804501000                                                                                                                                                                                                                                                              
[  279.423297] [0000000000000010] pgd=0000000000000000, p4d=0000000000000000                                                                                                                                                                                                                                                          
[  279.430078] Internal error: Oops: 96000044 [#1] SMP                                                                                                                                                                                                                                                                                
[  279.434945] Modules linked in:                                                                                                                                                                                                                                                                                                     
[  279.437990] CPU: 1 PID: 360 Comm: xtest Not tainted 5.15.0 #1                                                                                                                                                                                                                                                                      
[  279.443727] Hardware name: Xilinx Versal vck190 Eval board revA (QSPI) (DT)                                                                                                                                                                                                                                                        
[  279.450677] pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)                                                                                                                                                                                                                                                        
[  279.457628] pc : internal_get_user_pages_fast+0x2ec/0x660                                                                                                                                                                                                                                                                          
[  279.463026] lr : internal_get_user_pages_fast+0x2a8/0x660                                                                                                                                                                                                                                                                          
[  279.468415] sp : ffff80001151bb70                                                                                                                                                                                                                                                                                                  
[  279.471718] x29: ffff80001151bb70 x28: ffff00080451e320 x27: 0000000000000000                                                                                                                                                                                                                                                      
[  279.478847] x26: fffffc001c0fe680 x25: ffff800010d21138 x24: 0000000000040001                                                                                                                                                                                                                                                      
[  279.485975] x23: 0000aaab0c8ad000 x22: 0000aaab0c8ae000 x21: 0000aaab0c8ad000                                                                                                                                                                                                                                                      
[  279.493103] x20: ffff00080451f570 x19: 00e80008048b0f43 x18: 0000000000000000                                                                                                                                                                                                                                                      
[  279.500230] x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffca837d20                                                                                                                                                                                                                                                      
[  279.507357] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000022                                                                                                                                                                                                                                                      
[  279.514484] x11: ffff800010df8cf0 x10: 0000000000000000 x9 : 0000000000000000                                                                                                                                                                                                                                                      
[  279.521611] x8 : 0000000000000001 x7 : 0000000000000041 x6 : ffff800010df8d13                                                                                                                                                                                                                                                      
[  279.528738] x5 : ffff00097efbcd13 x4 : 0000000000000019 x3 : 0000000000000000                                                                                                                                                                                                                                                      
[  279.535865] x2 : 0000000000000000 x1 : 4000000000080016 x0 : 0000000000000010                                                                                                                                                                                                                                                      
[  279.542992] Call trace:                                                                                                                                                                                                                                                                                                            
[  279.545427]  internal_get_user_pages_fast+0x2ec/0x660                                                                                                                                                                                                                                                                              
[  279.550469]  pin_user_pages_fast+0x20/0x3c                                                                                                                                                                                                                                                                                         
[  279.554555]  tee_shm_register+0x140/0x360                                                                                                                                                                                                                                                                                          
[  279.558559]  tee_ioctl+0xdc/0x12f0                                                                                                                                                                                                                                                                                                 
[  279.561952]  __arm64_sys_ioctl+0xb8/0xe0                                                                                                                                                                                                                                                                                           
[  279.565867]  invoke_syscall+0x54/0x124                                                                                                                                                                                                                                                                                             
[  279.569608]  el0_svc_common.constprop.0+0x44/0xfc                                                                                                                                                                                                                                                                                  
[  279.574302]  do_el0_svc+0x48/0xb0                                                                                                                                                                                                                                                                                                  
[  279.577608]  el0_svc+0x28/0x80                                                                                                                                                                                                                                                                                                     
[  279.580653]  el0t_64_sync_handler+0xa4/0x130                                                                                                                                                                                                                                                                                       
[  279.584914]  el0t_64_sync+0x1a0/0x1a4                                                                                                                                                                                                                                                                                              
[  279.588567] Code: 35ffffa2 f94043e0 914006d6 91002294 (f83bd81a)                                                                                                                                                                                                                                                                   
[  279.594649] ---[ end trace 667859ace662d40c ]--- 

@jenswi-linaro
Copy link
Contributor Author

@ldts, that kernel is a bit old. Perhaps it's fixed by commit dfd0743f1d9e ("tee: handle lookup of shm with reference count 0") or maybe it's some other fix missing. It might be worth checking if there's a corresponding stable kernel with more patches on drivers/tee.

@jenswi-linaro
Copy link
Contributor Author

Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (imx-mx8mqevk)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Hikey + GP)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (FVP)

@igoropaniuk
Copy link
Contributor

igoropaniuk commented Jan 15, 2024

U-Boot fixes for Poplar:
OP-TEE/manifest#263

xtest:

I/TC: OP-TEE version: 4.1.0-rc1 (gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)) #1 Mon Jan 15 17:21:14 UTC 2024 aarch64

+-----------------------------------------------------
28168 subtests of which 0 failed
106 test cases of which 0 failed
0 test cases were skipped

Tested-by: Igor Opaniuk <igor.opaniuk@foundries.io> (Poplar)

@ldts
Copy link
Contributor

ldts commented Jan 15, 2024

dfd0743f1d9e

@ldts, that kernel is a bit old. Perhaps it's fixed by commit dfd0743f1d9e ("tee: handle lookup of shm with reference count 0") or maybe it's some other fix missing. It might be worth checking if there's a corresponding stable kernel with more patches on drivers/tee.

Not yet sure of the root cause.

The issue is that somehow the length in drivers/tee/tee_shm.c:tee_shm_register is -1 as shown when dumped with printk(KERN_ERR "length = %ld\n", length)
This happens when executing 5006.3 (out of memory) and it is the reason for the segfault since there is no safeguard against this case.

How can that length hold that negative value -root cause- I still haven't figured it out. Other than the TEE_CLIENT Allocate_out_of_memory test selecting SIZE_MAX=0xffffffffffffffff which I guess is -1. But this code hasnt changed...maybe the toolchain..

@ldts
Copy link
Contributor

ldts commented Jan 15, 2024

dfd0743f1d9e

@ldts, that kernel is a bit old. Perhaps it's fixed by commit dfd0743f1d9e ("tee: handle lookup of shm with reference count 0") or maybe it's some other fix missing. It might be worth checking if there's a corresponding stable kernel with more patches on drivers/tee.

Not yet sure of the root cause.

The issue is that somehow the length in drivers/tee/tee_shm.c:tee_shm_register is -1 as shown when dumped with printk(KERN_ERR "length = %ld\n", length) This happens when executing 5006.3 (out of memory) and it is the reason for the segfault since there is no safeguard against this case.

How can that length hold that negative value -root cause- I still haven't figured it out. Other than the TEE_CLIENT Allocate_out_of_memory test selecting SIZE_MAX=0xffffffffffffffff which I guess is -1. But this code hasnt changed...maybe the toolchain..

um sorry yes, it seems that something has changed WRT to the previous versions. anyway still debugging. should be done tomorrow (something in teec_paged_aligned_alloc ): it seems posix_memalign with a size 0 (the result of aligning SIZE_MAX) returns null with a valid pointer hence the kernel segfault

 jramirez $ ./a.out
size = 0xffffffffffffffff, page_size = 0x1000, aligned_size = 0x0p ==> 0x5621eaac7000 !!!!
 jramirez $ cat file.c

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>

int main()
{
        size_t sz = SIZE_MAX;
        void *p = NULL;

        size_t page_sz = sysconf(_SC_PAGESIZE);
        size_t aligned_sz = ((sz + page_sz - 1) / page_sz) * page_sz;

        printf("size = 0x%lx, page_size = 0x%lx, aligned_size = 0x%lx", sz, page_sz, aligned_sz);

        if (!posix_memalign(&p, page_sz, aligned_sz))
             printf( "p ==> %p !!!!\n", p);

        return 0;
}

this function (teec_paged_aligned_alloc) should have returned a NULL when SIZE_MAX allocation was request... so out of memory can be reported back to the client instead of the request reaching the kernel.

@ldts
Copy link
Contributor

ldts commented Jan 16, 2024

@jenswi-linaro something like this as a fix?
OP-TEE/optee_client#372

with the above fix and 4.1.0-rc1

Tested-by: Jorge Ramirez-Ortiz <jorge@foundries.io> (versal)

+-----------------------------------------------------
31427 subtests of which 2 failed
136 test cases of which 1 failed
0 test cases were skipped
TEE test application done!

Failing test (4005) needs a PLM firmware fix

regression_4005.7 AE case 6 algo 0x40000810 line 2591
regression_4000.c:606:

Reason:
PLM firmware does not accept unaligned payloads (AES-GCM)

Trace information:
E/TC:? 0 update_payload:479 Versal AES payload length not word aligned (len = 0)

@jenswi-linaro
Copy link
Contributor Author

@jenswi-linaro something like this as a fix?
OP-TEE/optee_client#372

It makes sense to catch it early, but I believe that the kernel should also be able to handle invalid input from userspace gracefully.

@b49020
Copy link
Contributor

b49020 commented Jan 16, 2024

With following PRs included:

#6605
OP-TEE/build#717
OP-TEE/manifest#265

Tested-by: Sumit Garg <sumit.garg@linaro.org> (vexpress-qemu_armv8a) (Rust 64-bit TAs)
Tested-by: Sumit Garg <sumit.garg@linaro.org> (vexpress-qemu_armv8a) (Rust 32-bit TAs)

I would love to get Rust example TAs support (especially 32-bit Rust TAs) incorporated in this release. However, if its too late for this release cycle then I can wait for the next OP-TEE release.

@ricardosalveti
Copy link
Contributor

am62xx-evm:

4.1.0-rc1 (8e9d8acc):

+-----------------------------------------------------
32293 subtests of which 0 failed
135 test cases of which 0 failed
0 test cases were skipped
TEE test application done!

am64xx-evm:

4.1.0-rc1 (8e9d8acc):

+-----------------------------------------------------
32289 subtests of which 0 failed
135 test cases of which 0 failed
0 test cases were skipped
TEE test application done!

kv260:

4.1.0-rc1 (8e9d8acc):

+-----------------------------------------------------
32269 subtests of which 0 failed
135 test cases of which 0 failed
0 test cases were skipped
TEE test application done!
Tested-by: Ricardo Salveti <ricardo@foundries.io> (ZynqMP)
Tested-by: Ricardo Salveti <ricardo@foundries.io> (k3-am62x)
Tested-by: Ricardo Salveti <ricardo@foundries.io> (k3-am64x)

@lorc
Copy link
Contributor

lorc commented Jan 18, 2024

With #6616 applied and "tee: add overflow check in register_shm_helper()" backported to Linux 5.10:

Tested-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> (rcar-salvator_m3_2x4g / virt)
Tested-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> (rcar-salvator_m3_2x4g)

@clementfaure
Copy link
Contributor

Hello,
With #6619 merged,

Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabresd)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6qsabresd)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6sllevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6sxsabresd)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ullevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulzevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7dsabresd)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7ulpevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mmevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mnevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mqevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mpevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qmmek)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qxpmek)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8ulpevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx93evk)

@jenswi-linaro
Copy link
Contributor Author

I plan to merge this PR in a few hours. Anything that should be included in the release should have been merged by then. I believe we'd like to see at least the Rust fixes for Sumit's Rust Tested-bys:
#6605
OP-TEE/build#717
OP-TEE/manifest#265

Anything else?

@jforissier
Copy link
Contributor

I plan to merge this PR in a few hours. Anything that should be included in the release should have been merged by then. I believe we'd like to see at least the Rust fixes for Sumit's Rust Tested-bys:
#6605

Merged

OP-TEE/build#717

That one is not a fix, it's bringing more test coverage for Rust. But I agree it's good to have. Merged.

OP-TEE/manifest#265

Merged.

I will launch a new batch of my QEMUv8 tests and report back.

@etienne-lms
Copy link
Contributor

Based on latest master branch tip from optee_os.git and build.git:
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-135F_DK)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-157C_DK2_SCMI)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-157C_EV1_SCMI)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-157C_DK2)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-157C_EV1)

@jforissier
Copy link
Contributor

I will launch a new batch of my QEMUv8 tests and report back.

All good, my Tested-bys still apply!

@jenswi-linaro
Copy link
Contributor Author

jenswi-linaro commented Jan 19, 2024

I will launch a new batch of my QEMUv8 tests and report back.

All good, my Tested-bys still apply!

Perfect, so we have no blocking issues, unless I'm missing something.

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for info: a new-line char is missing in the commit log:

Tested-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> (rcar-salvator_m3_2x4g)Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabresd)

Update CHANGELOG for 4.1.0 and collect Tested-by tags.

Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (rockchip-rk3399) (Rockpi4B)
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_virt)
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_armv8a)
Tested-by: Joakim Bech <joakim.bech@linaro.org> (RPi 3B v1.2)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (imx-mx8mqevk)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Hikey + GP)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (FVP)
Tested-by: Igor Opaniuk <igor.opaniuk@foundries.io> (Poplar)
Tested-by: Jorge Ramirez-Ortiz <jorge@foundries.io> (versal)
Tested-by: Sumit Garg <sumit.garg@linaro.org> (vexpress-qemu_armv8a) (Rust 64-bit TAs)
Tested-by: Sumit Garg <sumit.garg@linaro.org> (vexpress-qemu_armv8a) (Rust 32-bit TAs)
Tested-by: Ricardo Salveti <ricardo@foundries.io> (ZynqMP)
Tested-by: Ricardo Salveti <ricardo@foundries.io> (k3-am62x)
Tested-by: Ricardo Salveti <ricardo@foundries.io> (k3-am64x)
Tested-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> (rcar-salvator_m3_2x4g / virt)
Tested-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> (rcar-salvator_m3_2x4g)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabresd)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6qsabresd)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6sllevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6sxsabresd)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ullevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulzevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7dsabresd)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7ulpevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mmevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mnevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mqevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mpevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qmmek)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qxpmek)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8ulpevk)
Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx93evk)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-135F_DK)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-157C_DK2_SCMI)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-157C_EV1_SCMI)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-157C_DK2)
Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp1-157C_EV1)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
@jenswi-linaro
Copy link
Contributor Author

Thanks, I'll update.

@jenswi-linaro jenswi-linaro merged commit 18b424c into OP-TEE:master Jan 19, 2024
7 checks passed
@jenswi-linaro jenswi-linaro deleted the changelog-4.1.0 branch January 19, 2024 17:15
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.

None yet

10 participants