Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The defination of the struct SECPKG_CLIENT_INFO is old #328

Closed
wanglei-source opened this issue Mar 8, 2023 · 3 comments
Closed

The defination of the struct SECPKG_CLIENT_INFO is old #328

wanglei-source opened this issue Mar 8, 2023 · 3 comments

Comments

@wanglei-source
Copy link

in ntsecpkg, the defination of SECPKG_CLIENT_INFO is:

typedef struct _SECPKG_CLIENT_INFO {
LUID LogonId;
ULONG ProcessID;
ULONG ThreadID;
BOOLEAN HasTcbPrivilege;
BOOLEAN Impersonating;
BOOLEAN Restricted;
UCHAR ClientFlags;
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
} SECPKG_CLIENT_INFO,*PSECPKG_CLIENT_INFO;

but in Windows SDK 8.1 and 10, it is

typedef struct _SECPKG_CLIENT_INFO {
LUID LogonId; // Effective Logon Id
ULONG ProcessID; // Process Id of caller
ULONG ThreadID; // Thread Id of caller
BOOLEAN HasTcbPrivilege; // Client has TCB
BOOLEAN Impersonating; // Client is impersonating
BOOLEAN Restricted; // Client is restricted
//
// NT 5.1
//
UCHAR ClientFlags; // Extra flags about the client
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; // Impersonation level of client
//
// NT 6
//
HANDLE ClientToken;
} SECPKG_CLIENT_INFO, * PSECPKG_CLIENT_INFO;

it has an extra HANDLE field.
when calling GetClientInfo (in this header file), the type of the parameter is PSECPKG_CLIENT_INFO, a stack overflow would happen, and I have not found a method to know the actual size of the SECPKG_CLIENT_INFO in advance in runtime.

@Biswa96
Copy link

Biswa96 commented Mar 8, 2023

Patch to fix the issue was sent to upstream here https://sourceforge.net/p/mingw-w64/mailman/message/37787494/

@Biswa96
Copy link

Biswa96 commented Mar 8, 2023

The patch was applied in upstream with this commit https://sourceforge.net/p/mingw-w64/mingw-w64/ci/7a23b33d05b2de95dff5fd3306daa45d2d1896ae/

@mstorsjo
Copy link
Owner

This issue should have been fixed in the latest release that now is available at https://github.com/mstorsjo/llvm-mingw/releases/tag/20230320.

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

No branches or pull requests

3 participants