Re: [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
From: Edward Adam Davis
Date: Wed Sep 16 2026 - 23:39:52 EST
From: Edward Aadm Davis <eadavis@xxxxxxxx>
#syz test: upstream f6e7b42bf05b
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index 51651314b7a6..a52ede408f1c 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -455,6 +455,9 @@ ecryptfs_verify_auth_tok_from_key(struct key *auth_tok_key,
{
int rc = 0;
+ if (auth_tok_key->datalen < sizeof(**auth_tok))
+ return -EINVAL;
+
(*auth_tok) = ecryptfs_get_key_payload_data(auth_tok_key);
if (IS_ERR(*auth_tok)) {
rc = PTR_ERR(*auth_tok);