Skip to content

Commit 49994f4

Browse files
Copilotneargle
andauthored
fix: check ALG_SET_AEAD_AUTHSIZE setsockopt error per code review
Agent-Logs-Url: https://github.com/cdk-team/CDK/sessions/b45e6530-86b8-4285-923b-168cc69d0249 Co-authored-by: neargle <7868679+neargle@users.noreply.github.com>
1 parent 0b8f7ba commit 49994f4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/exploit/privilege_escalation/copy_fail_cve_2026_31431.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,17 @@ func copyFailWriteChunk(fd int, offset int, chunk []byte) error {
123123
}
124124

125125
// ALG_SET_AEAD_AUTHSIZE: pass a NULL optval with optlen = auth-tag size (4).
126-
syscall.Syscall6( //nolint:errcheck
126+
if _, _, errno := syscall.Syscall6(
127127
syscall.SYS_SETSOCKOPT,
128128
uintptr(algFd),
129129
uintptr(unix.SOL_ALG),
130130
uintptr(unix.ALG_SET_AEAD_AUTHSIZE),
131131
0,
132132
4,
133133
0,
134-
)
134+
); errno != 0 {
135+
return fmt.Errorf("setsockopt ALG_SET_AEAD_AUTHSIZE: %v", errno)
136+
}
135137

136138
// Accept returns the operation socket used for actual encrypt/decrypt calls.
137139
opFd, _, errno := syscall.Syscall(syscall.SYS_ACCEPT, uintptr(algFd), 0, 0)

0 commit comments

Comments
 (0)