Skip to content

fix smb1 oob read#525

Closed
SilverPlate3 wants to merge 1 commit intonamjaejeon:masterfrom
SilverPlate3:fix-oob-read-smb1
Closed

fix smb1 oob read#525
SilverPlate3 wants to merge 1 commit intonamjaejeon:masterfrom
SilverPlate3:fix-oob-read-smb1

Conversation

@SilverPlate3
Copy link
Contributor

fix out-of-bounds read in smb_locking_andx()

The Locks field in struct smb_com_lock_req is declared as an array of pointers (char *Locks[1]), which gives it type char **.
This causes pointer arithmetic on req->Locks to scale by sizeof(char *) (8 bytes on 64-bit) instead of by 1 byte.

In smb_locking_andx(), the code computes unlock element pointers as:
req->Locks + (sizeof(struct locking_andx_range64) * lock_count)
With the current char ** type, this advances by 8x the intended offset, reading far beyond the request buffer into adjacent kernel memory.

Fix by declaring Locks as char Locks[1] so that pointer arithmetic operates at byte granularity, matching the intended behavior.

@namjaejeon
Copy link
Owner

Applied it.
Thanks.

@namjaejeon namjaejeon closed this Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants