Skip to contentSkip to conversation

TEE shared memory fix for 7.0

GIT PULL Applied Jens Wiklander 6 participants 7 messages Mar 16 – Mar 23

lore
Share & tools
lore
#0 lore raw

Hello arm-soc maintainers,

Please pull this patch removing the refcounting of kernel pages within the TEE shared memory helper.

Thanks,
Jens

The following changes since commit 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f:

Linux 7.0-rc1 (2026-02-22 13:18:59 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee.git tags/tee-fix-for-v7.0

for you to fetch changes up to 08d9a4580f71120be3c5b221af32dca00a48ceb0:

tee: shm: Remove refcounting of kernel pages (2026-03-03 09:03:04 +0100)

----------------------------------------------------------------
TEE shared memory update for 7.0

Remove refcounting of kernel pages in register_shm_helper() to support slab allocations.

----------------------------------------------------------------
Matthew Wilcox (1):
tee: shm: Remove refcounting of kernel pages

 drivers/tee/tee_shm.c | 27 ---------------------------
 1 file changed, 27 deletions(-)
#1 lore raw
Quoted 18 lines · Jens Wiklander

Hello arm-soc maintainers,

Please pull this patch removing the refcounting of kernel pages within the TEE shared memory helper.

Thanks,
Jens

The following changes since commit 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f:

Linux 7.0-rc1 (2026-02-22 13:18:59 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee.git tags/tee-fix-for-v7.0

for you to fetch changes up to 08d9a4580f71120be3c5b221af32dca00a48ceb0:

Quoted 7 lines

tee: shm: Remove refcounting of kernel pages (2026-03-03 09:03:04 +0100)

----------------------------------------------------------------
TEE shared memory update for 7.0

Remove refcounting of kernel pages in register_shm_helper() to support slab allocations.

That's a supposed fix for a year old commit, not current RC, and the commit msg does not explain what is the bug being fixed here. Looks like it is doing improvement, not a fix. Can you provide here more explanation of the actual bug being fixed to justify this going to current RC fixes?

Quoted 1 line

Best regards,
Krzysztof

#2 lore raw

Hi,

Quoted 25 lines · Krzysztof Kozlowski
Quoted 23 lines · Jens Wiklander

Hello arm-soc maintainers,

Please pull this patch removing the refcounting of kernel pages within the TEE shared memory helper.

Thanks,
Jens

The following changes since commit 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f:

Linux 7.0-rc1 (2026-02-22 13:18:59 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee.git tags/tee-fix-for-v7.0

for you to fetch changes up to 08d9a4580f71120be3c5b221af32dca00a48ceb0:

tee: shm: Remove refcounting of kernel pages (2026-03-03 09:03:04 +0100)

----------------------------------------------------------------
TEE shared memory update for 7.0

Quoted 8 lines
Quoted 2 lines

Remove refcounting of kernel pages in register_shm_helper() to support slab allocations.

That's a supposed fix for a year old commit, not current RC, and the commit msg does not explain what is the bug being fixed here. Looks like it is doing improvement, not a fix. Can you provide here more explanation of the actual bug being fixed to justify this going to current RC fixes?

I'm under the impression that it is a fix rather than an improvement. However, since it has been stewing for a while, it's clearly not urgent. I don't have anything specific on the bug fix, other than that we're supposed to stop taking those refcounts. Perhaps Sumit, Marco, or Matthew can add something?

Cheers,
Jens

#3 lore raw
Quoted 37 lines · Jens Wiklander

Hi,

Quoted 25 lines · Krzysztof Kozlowski
Quoted 23 lines · Jens Wiklander

Hello arm-soc maintainers,

Please pull this patch removing the refcounting of kernel pages within the TEE shared memory helper.

Thanks,
Jens

The following changes since commit 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f:

Linux 7.0-rc1 (2026-02-22 13:18:59 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee.git tags/tee-fix-for-v7.0

for you to fetch changes up to 08d9a4580f71120be3c5b221af32dca00a48ceb0:

tee: shm: Remove refcounting of kernel pages (2026-03-03 09:03:04 +0100)

----------------------------------------------------------------
TEE shared memory update for 7.0

Quoted 8 lines
Quoted 2 lines

Remove refcounting of kernel pages in register_shm_helper() to support slab allocations.

That's a supposed fix for a year old commit, not current RC, and the commit msg does not explain what is the bug being fixed here. Looks like it is doing improvement, not a fix. Can you provide here more explanation of the actual bug being fixed to justify this going to current RC fixes?

Quoted 5 lines

I'm under the impression that it is a fix rather than an improvement. However, since it has been stewing for a while, it's clearly not urgent. I don't have anything specific on the bug fix, other than that we're supposed to stop taking those refcounts. Perhaps Sumit, Marco, or Matthew can add something?

It's a long outstanding fix regarding memory page management. The userspace gets informed about this memory API misuse via a warning print incl. a backtrace. This gets triggered only if userspace uses OP-TEE trusted-keys or the OP-TEE EFI variables. Therefore I would like to get it into 7.0 but 7.1 fine too.

Regards,
Marco

Quoted 4 lines

Cheers,
Jens

Signature · 7 lines
#gernperDu 
#CallMeByMyFirstName

Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |
#4 lore raw
Quoted 8 lines · Marco Felsch
Quoted 6 lines · Jens Wiklander

I'm under the impression that it is a fix rather than an improvement. However, since it has been stewing for a while, it's clearly not urgent. I don't have anything specific on the bug fix, other than that we're supposed to stop taking those refcounts. Perhaps Sumit, Marco, or Matthew can add something?

Quoted 5 lines

It's a long outstanding fix regarding memory page management. The userspace gets informed about this memory API misuse via a warning print incl. a backtrace. This gets triggered only if userspace uses OP-TEE trusted-keys or the OP-TEE EFI variables. Therefore I would like to get it into 7.0 but 7.1 fine too.

Yes, that is clearly a bugfix. I think we'd also want this to be marked 'Cc: [email protected]' as it should also apply to 6.18-LTS and 6.19. Greg tends to also pick up bugfixes that don't have this, but it's generally better to be explicit here, especially when it's not obvious what the impact of the fix is.

I've merge the pull request now. If you think this should be in 6.18-lts and Greg doesn't pick it up by himself, maybe let him know about it.

Arnd

#6 lore raw
In reply to Jens Wiklander
This pull request was applied to soc/soc.git (arm/fixes) by Arnd Bergmann <[email protected]>:

Hello:

This pull request was applied to soc/soc.git (arm/fixes) by Arnd Bergmann <[email protected]>:

Quoted 9 lines · On Mon, 16 Mar 2026 08:41:50 +0100 you wrote:

Hello arm-soc maintainers,

Please pull this patch removing the refcounting of kernel pages within the TEE shared memory helper.

Thanks,
Jens

[...]

Here is the summary with links:
- [GIT,PULL] TEE shared memory fix for 7.0

    https://git.kernel.org/soc/soc/c/b3315ba042f2

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#5 lore raw
In reply to Arnd Bergmann
Quoted 21 lines · Arnd Bergmann
Quoted 8 lines · Marco Felsch
Quoted 6 lines · Jens Wiklander

I'm under the impression that it is a fix rather than an improvement. However, since it has been stewing for a while, it's clearly not urgent. I don't have anything specific on the bug fix, other than that we're supposed to stop taking those refcounts. Perhaps Sumit, Marco, or Matthew can add something?

Quoted 5 lines

It's a long outstanding fix regarding memory page management. The userspace gets informed about this memory API misuse via a warning print incl. a backtrace. This gets triggered only if userspace uses OP-TEE trusted-keys or the OP-TEE EFI variables. Therefore I would like to get it into 7.0 but 7.1 fine too.

Yes, that is clearly a bugfix. I think we'd also want this to be marked 'Cc: [email protected]' as it should also apply to 6.18-LTS and 6.19. Greg tends to also pick up bugfixes that don't have this, but it's generally better to be explicit here, especially when it's not obvious what the impact of the fix is.

Quoted 3 lines

I've merge the pull request now. If you think this should be in 6.18-lts and Greg doesn't pick it up by himself, maybe let him know about it.

Thanks Arnd for picking up this fix. Last week I was on business travel hence the delay in my response. I see Sasha already picked it up for backports.

-Sumit