Re: [PATCH] ksmbd: refuse to write to a handle that is not open for writing

From: Ian Bridges

Date: Tue Dec 01 2026 - 10:03:56 EST


I tested this on ksmbd-for-next 87ff512becd4 on x86_64 with KASAN. A
client opened a character device node and a block device node in a
share with read and write access and sent a WRITE to each. Without
the patch the warning above appeared and both WRITEs failed with
STATUS_INVALID_HANDLE. With the patch both failed with
STATUS_ACCESS_DENIED and no warning appeared. A WRITE to a FIFO and
to a regular file still succeeded. smbtorture gives the same results
as on the base, and KASAN reported nothing.

Reviewed-by: Ian Bridges <icb@xxxxxxxxxxxx>
Tested-by: Ian Bridges <icb@xxxxxxxxxxxx>