Skip to content

Map 403 and 416 to the errors they mean, and fix the subdirectory vector type - #67

Closed
Chuccle wants to merge 9 commits into
masterfrom
driver-errors
Closed

Chuccle wants to merge 9 commits into
masterfrom
driver-errors

Conversation

@Chuccle

@Chuccle Chuccle commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Before: any unexpected HTTP status other than 404 became STATUS_INVALID_PARAMETER. A file the server refuses (403) showed up as "The parameter is incorrect", and a read past the end of a file that shrank on the server (416) failed the same way.

After: 403 becomes STATUS_ACCESS_DENIED and 416 becomes STATUS_END_OF_FILE. 404 is unchanged.

How: a small HttpStatusToNtStatus switch in Client.c handles these mappings, with two sandbox tests in ClientTest.cpp next to the existing 404 test. This PR also fixes HttpDeserializeDirectoryInfo, which declared the subdirectory vector as a FileEntryMetadata vector; the schema's Directory.subdirectories is a SubdirectoryMetadata vector.

This is the driver part of #65. The rest of #65 is either dropped or moves to the packaging PR.

…tor type

An unexpected HTTP status became STATUS_INVALID_PARAMETER unless it was
404. A 403 (host permissions, or a path the server refuses as escaping its
root) now surfaces as STATUS_ACCESS_DENIED, and a 416 (a read starting at
or past the file's current end: the file shrank under a cached size) as
STATUS_END_OF_FILE. Sandbox tests cover both.

HttpDeserializeDirectoryInfo declared the subdirectory vector as
FileEntryMetadata_vec_t; the schema's Directory.subdirectories is a
SubdirectoryMetadata vector.
DriverEntry passes ai_addr, which lives in paged pool. Reading it under
SocketPool.Lock touches pageable memory at DISPATCH_LEVEL: bugcheck 0xD1
at service start under Driver Verifier.
A connect completion arrives at DISPATCH_LEVEL, and the pump chained the
next WskSocketConnect from there. With no owning process the transport
captures the caller's security context in pageable code, so under Driver
Verifier the second pre-warm connect bugchecked 0xA in
SeCaptureSubjectContextEx. A completion above PASSIVE now hands the step
to a work item, and the step stays in flight until it has run, so teardown
still waits for it. The WSK model enforces the IRQL, so the sandbox catches
a connect issued above PASSIVE.
@Chuccle
Chuccle force-pushed the driver-errors branch 2 times, most recently from 56f3489 to 6715dc7 Compare October 4, 2026 01:32
A send can complete inline, and on the failure path its completion frees
the request context before BlorgSendWskAsync returns. Writing
SendIssuedQpc after the call wrote into freed memory: bugcheck 0x50 in
HttpKick under Driver Verifier's special pool.
// both until neither has anything left.
//
while (WskModelReleaseDeferred() + ShimDrainWorkItems() > 0)
{

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

A query after a failed fetch keeps its search pattern and so skipped the
posts to the FSP, issuing the fetch from the FSD without the IRP marked
pending. Also correct the receive comment, which described the opposite of
the issue contract the code relies on.

Chuccle commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner Author

Replaced by #69, which has the same content squashed into one commit.

@Chuccle Chuccle closed this Oct 4, 2026
@Chuccle
Chuccle deleted the driver-errors branch October 4, 2026 17:00
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.

1 participant