* Re: [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
@ 2026-09-17 1:53 ` Edward Adam Davis
2026-09-17 2:10 ` syzbot
2026-09-17 2:22 ` Edward Adam Davis
` (7 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Edward Adam Davis @ 2026-09-17 1:53 UTC (permalink / raw)
To: syzbot+b9529ebe6a9394ddf825; +Cc: linux-kernel, syzkaller-bugs
From: Edward Aadm Davis <eadavis@sina.com>
#syz test: upstream f6e7b42bf05b
diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c
index 6f88b507f927..6bf3e2da7bda 100644
--- a/security/keys/user_defined.c
+++ b/security/keys/user_defined.c
@@ -61,7 +61,8 @@ int user_preparse(struct key_preparsed_payload *prep)
struct user_key_payload *upayload;
size_t datalen = prep->datalen;
- if (datalen == 0 || datalen > 32767 || !prep->data)
+ if (datalen == 0 || datalen > 32767 || datalen < sizeof(*upayload) ||
+ !prep->data)
return -EINVAL;
upayload = kmalloc_flex(*upayload, data, datalen);
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-17 1:53 ` Edward Adam Davis
@ 2026-09-17 2:10 ` syzbot
0 siblings, 0 replies; 13+ messages in thread
From: syzbot @ 2026-09-17 2:10 UTC (permalink / raw)
To: eadavis, linux-kernel, syzkaller-bugs
Hello,
syzbot tried to test the proposed patch but the build/boot failed:
lost connection to test machine
syzkaller login: qemu-system-x86_64: ahci: PRDT length for NCQ command (0x0) is smaller than the requested size (0x400000)
[ 91.925486][ T10] cfg80211: failed to load regulatory.db
Warning: Permanently added '[localhost]:30539' (ED25519) to the list of known hosts.
2026/09/17 02:08:46 parsed 1 programs
2026/09/17 02:08:46 serving rpc on tcp://38533
[ 96.572980][ T5287] cgroup: Unknown subsys name 'net'
[ 96.624230][ T5287] cgroup: Unknown subsys name 'cpuset'
[ 96.628137][ T5287] cgroup: Unknown subsys name 'rlimit'
[ 117.530042][ T1024] ata1.00: exception Emask 0x0 SAct 0x4000 SErr 0x0 action 0x6 frozen
[ 117.530070][ T1024] ata1.00: failed command: WRITE FPDMA QUEUED
[ 117.530078][ T1024] ata1.00: cmd 61/00:70:36:81:04/20:00:00:00:00/40 tag 14 ncq dma 4194304 ou
[ 117.530078][ T1024] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 117.530107][ T1024] ata1.00: status: { DRDY }
[ 117.530148][ T1024] ata1: hard resetting link
[ 117.854290][ T1024] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 117.855240][ T1024] ata1.00: configured for UDMA/100
[ 117.855521][ T1024] ata1: EH complete
Setting up swapspace version 1, size = 127995904 bytes
[ 119.296232][ T5287] Adding 124996k swap on ./swap-file. Priority:0 extents:1 across:124996k
qemu-system-x86_64: ahci: PRDT length for NCQ command (0x0) is smaller than the requested size (0xa8000)
[ 121.760867][ T1024] ata1.00: Read log 0x10 page 0x00 failed, Emask 0x1
[ 121.760887][ T1024] ata1: failed to read log page 10h (errno=-5)
[ 121.760897][ T1024] ata1.00: NCQ disabled due to excessive errors
[ 121.760905][ T1024] ata1.00: exception Emask 0x1 SAct 0xc000 SErr 0x0 action 0x0
[ 121.760915][ T1024] ata1.00: irq_stat 0x41000000
[ 121.760925][ T1024] ata1.00: failed command: READ FPDMA QUEUED
[ 121.760932][ T1024] ata1.00: cmd 60/40:70:36:51:05/05:00:00:00:00/40 tag 14 ncq dma 688128 in
[ 121.760932][ T1024] res 50/04:00:00:00:00/00:00:00:00:00/00 Emask 0x1 (device error)
[ 121.760961][ T1024] ata1.00: status: { DRDY }
[ 121.760968][ T1024] ata1.00: error: { ABRT }
[ 121.760977][ T1024] ata1.00: failed command: READ FPDMA QUEUED
[ 121.760983][ T1024] ata1.00: cmd 60/c0:78:76:56:05/02:00:00:00:00/40 tag 15 ncq dma 360448 in
[ 121.760983][ T1024] res 50/04:00:00:00:00/00:00:00:00:00/00 Emask 0x1 (device error)
[ 121.761010][ T1024] ata1.00: status: { DRDY }
[ 121.761017][ T1024] ata1.00: error: { ABRT }
[ 121.762668][ T1024] ata1.00: configured for UDMA/100
[ 121.763094][ T1024] sd 0:0:0:0: [sda] tag#14 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
[ 121.763126][ T1024] sd 0:0:0:0: [sda] tag#14 Sense Key : Aborted Command [current]
[ 121.763149][ T1024] sd 0:0:0:0: [sda] tag#14 Add. Sense: No additional sense information
[ 121.763173][ T1024] sd 0:0:0:0: [sda] tag#14 CDB: Read(10) 28 00 00 05 51 36 00 05 40 00
[ 121.763186][ T1024] I/O error, dev sda, sector 348470 op 0x0:(READ) flags 0x84700 phys_seg 168 prio class 2
[ 121.763396][ T1024] sd 0:0:0:0: [sda] tag#15 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
[ 121.763421][ T1024] sd 0:0:0:0: [sda] tag#15 Sense Key : Aborted Command [current]
[ 121.763442][ T1024] sd 0:0:0:0: [sda] tag#15 Add. Sense: No additional sense information
[ 121.763464][ T1024] sd 0:0:0:0: [sda] tag#15 CDB: Read(10) 28 00 00 05 56 76 00 02 c0 00
[ 121.763475][ T1024] I/O error, dev sda, sector 349814 op 0x0:(READ) flags 0x84700 phys_seg 88 prio class 2
[ 121.763614][ T1024] ata1: EH complete
[ 124.582483][ T5311] soft_limit_in_bytes is deprecated and will be removed. Writing any value to this file has no effect. Please report your usecase to linux-mm@kvack.org if you depend on this functionality.
qemu-system-x86_64: hw/ide/core.c:925: ide_dma_cb: Assertion `prep_size >= 0 && prep_size <= n * 512' failed.
Connection to localhost closed by remote host.
syzkaller build log:
go env (err=<nil>)
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE='auto'
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/syzkaller/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/syzkaller/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1383433036=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/syzkaller/jobs/linux/gopath/src/github.com/google/syzkaller/go.mod'
GOMODCACHE='/syzkaller/jobs/linux/gopath/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/syzkaller/jobs/linux/gopath'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/syzkaller/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.26.0'
GOWORK=''
PKG_CONFIG='pkg-config'
git status (err=<nil>)
HEAD detached at 12a0a44a11e
nothing to commit, working tree clean
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
go list -f '{{.Stale}}' -ldflags="-s -w -X github.com/google/syzkaller/prog.GitRevision=12a0a44a11e4f0e07457f2b9d76763cd609f4f86 -X github.com/google/syzkaller/prog.gitRevisionDate=20260915-150835" ./sys/syz-sysgen | grep -q false || go install -ldflags="-s -w -X github.com/google/syzkaller/prog.GitRevision=12a0a44a11e4f0e07457f2b9d76763cd609f4f86 -X github.com/google/syzkaller/prog.gitRevisionDate=20260915-150835" ./sys/syz-sysgen
make .descriptions
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
bin/syz-sysgen
touch .descriptions
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X github.com/google/syzkaller/prog.GitRevision=12a0a44a11e4f0e07457f2b9d76763cd609f4f86 -X github.com/google/syzkaller/prog.gitRevisionDate=20260915-150835" -o ./bin/linux_amd64/syz-execprog github.com/google/syzkaller/tools/syz-execprog
mkdir -p ./bin/linux_amd64
g++ -o ./bin/linux_amd64/syz-executor executor/executor.cc \
-m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -std=c++17 -I. -Iexecutor/_include -DGOOS_linux=1 -DGOARCH_amd64=1 \
-DHOSTGOOS_linux=1 -DGIT_REVISION=\"12a0a44a11e4f0e07457f2b9d76763cd609f4f86\"
go: downloading google.golang.org/grpc v1.83.2
go: downloading golang.org/x/crypto v0.55.0
go: downloading golang.org/x/net v0.58.0
go: downloading golang.org/x/text v0.41.0
/usr/bin/ld: /tmp/ccn9ay4F.o: in function `Connection::Connect(char const*, char const*)':
executor.cc:(.text._ZN10Connection7ConnectEPKcS1_[_ZN10Connection7ConnectEPKcS1_]+0x386): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
./tools/check-syzos.sh 2>/dev/null
Tested on:
commit: f6e7b42b Merge tag 'sysctl-7.03-fixes-rc4' of git://gi..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel config: https://syzkaller.appspot.com/x/.config?x=e909ffe6b35dddb7
dashboard link: https://syzkaller.appspot.com/bug?extid=b9529ebe6a9394ddf825
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=14cb93f9580000
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
2026-09-17 1:53 ` Edward Adam Davis
@ 2026-09-17 2:22 ` Edward Adam Davis
2026-09-17 2:46 ` syzbot
2026-09-17 2:46 ` Forwarded: " syzbot
` (6 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Edward Adam Davis @ 2026-09-17 2:22 UTC (permalink / raw)
To: syzbot+b9529ebe6a9394ddf825; +Cc: linux-kernel, syzkaller-bugs
From: Edward Aadm Davis <eadavis@sina.com>
#syz test: upstream f6e7b42bf05b
diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c
index 6f88b507f927..6bf3e2da7bda 100644
--- a/security/keys/user_defined.c
+++ b/security/keys/user_defined.c
@@ -61,7 +61,8 @@ int user_preparse(struct key_preparsed_payload *prep)
struct user_key_payload *upayload;
size_t datalen = prep->datalen;
- if (datalen == 0 || datalen > 32767 || !prep->data)
+ if (datalen == 0 || datalen > 32767 || datalen < 4 ||
+ !prep->data)
return -EINVAL;
upayload = kmalloc_flex(*upayload, data, datalen);
^ permalink raw reply [flat|nested] 13+ messages in thread* Forwarded: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
2026-09-17 1:53 ` Edward Adam Davis
2026-09-17 2:22 ` Edward Adam Davis
@ 2026-09-17 2:46 ` syzbot
2026-09-17 2:54 ` syzbot
` (5 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: syzbot @ 2026-09-17 2:46 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
Author: neganhat@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
index xxxxxxx..xxxxxxx 100644
--- a/fs/ecryptfs/ecryptfs_kernel.h
+++ b/fs/ecryptfs/ecryptfs_kernel.h
@@ -xx,6 +xx,9 @@ ecryptfs_get_key_payload_data(struct key *key)
if (!ukp)
return ERR_PTR(-EKEYREVOKED);
+ if (ukp->datalen < sizeof(struct ecryptfs_auth_tok))
+ return ERR_PTR(-EINVAL);
+
return (struct ecryptfs_auth_tok *)ukp->data;
}
^ permalink raw reply [flat|nested] 13+ messages in thread* Forwarded: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
` (2 preceding siblings ...)
2026-09-17 2:46 ` Forwarded: " syzbot
@ 2026-09-17 2:54 ` syzbot
2026-09-17 3:04 ` syzbot
` (4 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: syzbot @ 2026-09-17 2:54 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
Author: neganhat@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
index 58165928ed1e..3baccd4143e8 100644
--- a/fs/ecryptfs/ecryptfs_kernel.h
+++ b/fs/ecryptfs/ecryptfs_kernel.h
@@ -124,6 +124,9 @@ ecryptfs_get_key_payload_data(struct key *key)
if (!ukp)
return ERR_PTR(-EKEYREVOKED);
+ if (ukp->datalen < sizeof(struct ecryptfs_auth_tok))
+ return ERR_PTR(-EINVAL);
+
return (struct ecryptfs_auth_tok *)ukp->data;
}
^ permalink raw reply [flat|nested] 13+ messages in thread* Forwarded: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
` (3 preceding siblings ...)
2026-09-17 2:54 ` syzbot
@ 2026-09-17 3:04 ` syzbot
2026-09-17 3:15 ` syzbot
` (3 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: syzbot @ 2026-09-17 3:04 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
Author: neganhat@gmail.com
#syz test: upstream master
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
index 58165928ed1e..3baccd4143e8 100644
--- a/fs/ecryptfs/ecryptfs_kernel.h
+++ b/fs/ecryptfs/ecryptfs_kernel.h
@@ -124,6 +124,9 @@ ecryptfs_get_key_payload_data(struct key *key)
if (!ukp)
return ERR_PTR(-EKEYREVOKED);
+ if (ukp->datalen < sizeof(struct ecryptfs_auth_tok))
+ return ERR_PTR(-EINVAL);
+
return (struct ecryptfs_auth_tok *)ukp->data;
}
^ permalink raw reply [flat|nested] 13+ messages in thread* Forwarded: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
` (4 preceding siblings ...)
2026-09-17 3:04 ` syzbot
@ 2026-09-17 3:15 ` syzbot
2026-09-17 3:36 ` syzbot
` (2 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: syzbot @ 2026-09-17 3:15 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
Author: neganhat@gmail.com
#syz test: upstream master
^ permalink raw reply [flat|nested] 13+ messages in thread* Forwarded: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
` (5 preceding siblings ...)
2026-09-17 3:15 ` syzbot
@ 2026-09-17 3:36 ` syzbot
2026-09-17 3:39 ` [syzbot] [ecryptfs?] " Edward Adam Davis
2026-09-17 3:53 ` Forwarded: " syzbot
8 siblings, 0 replies; 13+ messages in thread
From: syzbot @ 2026-09-17 3:36 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
Author: neganhat@gmail.com
#syz test: upstream master
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
` (6 preceding siblings ...)
2026-09-17 3:36 ` syzbot
@ 2026-09-17 3:39 ` Edward Adam Davis
2026-09-17 4:15 ` syzbot
2026-09-17 3:53 ` Forwarded: " syzbot
8 siblings, 1 reply; 13+ messages in thread
From: Edward Adam Davis @ 2026-09-17 3:39 UTC (permalink / raw)
To: syzbot+b9529ebe6a9394ddf825; +Cc: linux-kernel, syzkaller-bugs
From: Edward Aadm Davis <eadavis@sina.com>
#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);
^ permalink raw reply [flat|nested] 13+ messages in thread* Forwarded: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026-09-16 15:53 [syzbot] [ecryptfs?] KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key syzbot
` (7 preceding siblings ...)
2026-09-17 3:39 ` [syzbot] [ecryptfs?] " Edward Adam Davis
@ 2026-09-17 3:53 ` syzbot
8 siblings, 0 replies; 13+ messages in thread
From: syzbot @ 2026-09-17 3:53 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
Author: neganhat@gmail.com
#syz test: upstream f6e7b42bf05b
^ permalink raw reply [flat|nested] 13+ messages in thread