Re: [PATCH v2 security-next 1/4] security: Hornet LSM

2025-04-21 Thread Paul Moore
On Mon, Apr 21, 2025 at 7:48 PM Alexei Starovoitov wrote: > On Mon, Apr 21, 2025 at 3:04 PM Paul Moore wrote: > > On Mon, Apr 21, 2025 at 4:13 PM Alexei Starovoitov > > wrote: > > > On Wed, Apr 16, 2025 at 10:31 AM Blaise Boscaccy > > > wrote: > > > > > > > > > Hacking into bpf internal objects

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
On 2025/4/21 20:05, Herbert Xu wrote: On Mon, Apr 21, 2025 at 01:51:06PM +0800, Su Hui wrote: @@ -433,7 +434,7 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm, { struct aead_request *req; - req = kmalloc(sizeof(*req) + crypto_aead_reqsize(tfm), gfp)

Re: [PATCH v2 security-next 1/4] security: Hornet LSM

2025-04-21 Thread Alexei Starovoitov
On Mon, Apr 21, 2025 at 3:04 PM Paul Moore wrote: > > On Mon, Apr 21, 2025 at 4:13 PM Alexei Starovoitov > wrote: > > On Wed, Apr 16, 2025 at 10:31 AM Blaise Boscaccy > > wrote: > > > > > > > Hacking into bpf internal objects like maps is not acceptable. > > > > > > We've heard your concerns abo

Re: [PATCH v2 security-next 1/4] security: Hornet LSM

2025-04-21 Thread Paul Moore
On Mon, Apr 21, 2025 at 4:13 PM Alexei Starovoitov wrote: > On Wed, Apr 16, 2025 at 10:31 AM Blaise Boscaccy > wrote: > > > > > Hacking into bpf internal objects like maps is not acceptable. > > > > We've heard your concerns about kern_sys_bpf and we agree that the LSM > > should not be calling i

Re: [PATCH v2 security-next 1/4] security: Hornet LSM

2025-04-21 Thread Alexei Starovoitov
On Wed, Apr 16, 2025 at 10:31 AM Blaise Boscaccy wrote: > > > Hacking into bpf internal objects like maps is not acceptable. > > We've heard your concerns about kern_sys_bpf and we agree that the LSM > should not be calling it. The proposal in this email should meet both of > our needs > https://l

Re: [PATCH v2 security-next 1/4] security: Hornet LSM

2025-04-21 Thread James Bottomley
On Mon, 2025-04-21 at 14:52 -0400, Paul Moore wrote: > On Sat, Apr 19, 2025 at 2:43 PM James Bottomley > wrote: > > On Fri, 2025-04-04 at 14:54 -0700, Blaise Boscaccy wrote: > > [...] > > > diff --git a/include/linux/kernel_read_file.h > > > b/include/linux/kernel_read_file.h > > > index 90451e2e1

Re: [PATCH v8 4/5] tpm: Add a driver for Loongson TPM device

2025-04-21 Thread Jarkko Sakkinen
On Fri, Apr 18, 2025 at 05:34:06PM +0800, Qunqin Zhao wrote: > Loongson Security Engine supports random number generation, hash, > symmetric encryption and asymmetric encryption. Based on these > encryption functions, TPM2 have been implemented in the Loongson > Security Engine firmware. This drive

Re: [PATCH v8 5/5] MAINTAINERS: Add tpm_loongson.c to LOONGSON CRYPTO DRIVER entry

2025-04-21 Thread Jarkko Sakkinen
On Fri, Apr 18, 2025 at 05:36:00PM +0800, Qunqin Zhao wrote: > Changes to Loongson TPM driver would be best reviewed by the Loongson > crypto driver maintainers. > > Signed-off-by: Qunqin Zhao > Reviewed-by: Jarkko Sakkinen > Reviewed-by: Huacai Chen > --- > v8: None > v7: Added tag from Jarkko

Re: [PATCH v2 security-next 1/4] security: Hornet LSM

2025-04-21 Thread Paul Moore
On Sat, Apr 19, 2025 at 2:43 PM James Bottomley wrote: > On Fri, 2025-04-04 at 14:54 -0700, Blaise Boscaccy wrote: > [...] > > diff --git a/include/linux/kernel_read_file.h > > b/include/linux/kernel_read_file.h > > index 90451e2e12bd..7ed9337be542 100644 > > --- a/include/linux/kernel_read_file.h

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Herbert Xu
On Mon, Apr 21, 2025 at 01:51:06PM +0800, Su Hui wrote: > > @@ -433,7 +434,7 @@ static inline struct aead_request > *aead_request_alloc(struct crypto_aead *tfm, > { > struct aead_request *req; > > - req = kmalloc(sizeof(*req) + crypto_aead_reqsize(tfm), gfp); > + req = kmalloc(siz

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
On 2025/4/21 16:46, Su Hui wrote: On 2025/4/21 16:32, Christophe JAILLET wrote: Le 21/04/2025 à 09:43, Su Hui a écrit : On 2025/4/21 15:10, Christophe JAILLET wrote: Le 21/04/2025 à 07:51, Su Hui a écrit : It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, b

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
On 2025/4/21 16:32, Christophe JAILLET wrote: Le 21/04/2025 à 09:43, Su Hui a écrit : On 2025/4/21 15:10, Christophe JAILLET wrote: Le 21/04/2025 à 07:51, Su Hui a écrit : It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possi

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Christophe JAILLET
Le 21/04/2025 à 09:43, Su Hui a écrit : On 2025/4/21 15:10, Christophe JAILLET wrote: Le 21/04/2025 à 07:51, Su Hui a écrit : It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possible overflow problem. Signed-off-by: Su Hui -

[PATCH v2 0/2] crypto: some cleanup and hardening

2025-04-21 Thread Su Hui
using size_add() to hardening kmalloc() and remove some redundant include headers. Compile test only. v2: - remove redundant include headers in v1 (). - add a patch to remove other redundant headers. v1: - https://lore.kernel.org/all/20250421055104.663552-1-su...@nfschina.com/ Su Hui (2): c

[PATCH v2 2/2] crypto: remove some redundant include headers

2025-04-21 Thread Su Hui
There are some redundant headers, the include relation is: linux/{list,refcount,slab,types}.h <<== linux/crypto.h linux/container_of.h <<== linux/list.h linux/atomic.h <<== linux/refcount.h linux/cached.h <<== linux/slab.h So it's no need to include when already included . Remove these redundant

[PATCH v2 1/2] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possible overflow problem. Signed-off-by: Su Hui --- include/crypto/aead.h | 2 +- include/crypto/akcipher.h | 3 ++- include/crypto/kpp.h | 2 +- 3 files changed, 4 inser

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
On 2025/4/21 15:10, Christophe JAILLET wrote: Le 21/04/2025 à 07:51, Su Hui a écrit : It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possible overflow problem. Signed-off-by: Su Hui ---   include/crypto/aead.h | 3 ++-  

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Christophe JAILLET
Le 21/04/2025 à 07:51, Su Hui a écrit : It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possible overflow problem. Signed-off-by: Su Hui --- include/crypto/aead.h | 3 ++- include/crypto/akcipher.h | 4 +++- include/cry