Re: Authentication Package and LSA

From: Richard Ward (richardw_at_delete-yellow-dogs.com)
Date: 12/30/03


Date: Mon, 29 Dec 2003 23:41:19 -0800


Hmm, you may be better off using LSA_TOKEN_INFORMATION_V2,
which is the same syntactically, except that it is treated as a monolithic
chunk
of memory, and the variant fields are not freed individually by the LSA
after
the token is constructed.

"tedo" <tedo_423@hotmail.com> wrote in message
news:OdsMSZ5xDHA.1744@TK2MSFTNGP12.phx.gbl...
> Hi all
>
>
>
> I am running into an issue that seems like it might be an XP bug, but I am
> not sure.
>
> Any advice would be much appreciated.
>
> I am writing an authentication package for windows, and I've run into a
> strange problem in my implementation of LsaApLogonUserEx2(also happens
> with
> LsaApLogonUser).
>
> On Win2k(debug/checked), everything works fine, but on Windows
> XP(debug/checked) the LSA hits a debug breakpoint when it tries to release
> the memory allocated for the Groups member of the LSA_TOKEN_INFORMATION_V1
> structure.
>
> The same thing happens when it tries to free the memory allocated for the
> Sid member of the SID_AND_ATTRIBUTE structure in the Groups array.
>
> These are all allocated using the AllocateLsaHeap function passed to the
> authentication package in the LSA_DISPATCH_TABLE.
>
> In all cases, the LSA is complaining that the memory is in the wrong heap.
> I can see from the assertion message in the debugger that the LSA is
> trying
> to free the correct addresses; it just doesn't like the heap they are in.
> Using LocalAlloc and HeapAlloc(GetProcessHeap(), ...) produces the same
> result. This is the message I get:
>
> 696.792> SPM-Error: LsapFreePrivateHeap tried to free 000CC578 from wrong
> heap 696.792> Assert-FAILED: pvMemory == 0
>
> (d:\xpsp1\ds\security\base\lsa\server\sphelp.cxx:649)
>
> And this is the stack at the time of the assertion:
>
> 00cefc30 7454a29a ntdll!DbgBreakPoint
>
> 00cefc40 744e8276 LSASRV!_DsysAssertEx+0x146
>
> 00cefc5c 744f6392 LSASRV!LsapFreePrivateHeap+0x46
>
> 00cefc74 744f63d8 LSASRV!LsapFreeTokenGroups+0x1d
>
> 00cefc84 744f2600 LSASRV!LsapFreeTokenInformationV1+0x17
>
> 00cefc9c 744f3688 LSASRV!LsapAuSetTokenInformation+0xce
>
> 00cefd24 744f68fc LSASRV!LsapAuUserLogonPolicyFilter+0x37d
>
> 00cefe94 744db999 LSASRV!LsapAuApiDispatchLogonUser+0x4ab
>
> 00cefea8 744dcc56 LSASRV!LpcLsaLogonUser+0x20
>
> 00cefec0 744d9d3c LSASRV!DispatchAPI+0x6c
>
> 00ceff50 744eb64e LSASRV!LpcHandler+0x1c0
>
> 00ceff74 744e8960 LSASRV!SpmPoolThreadBase+0xc6
>
> 00ceffb4 7dddb177 LSASRV!LsapThreadBase+0x63
>
> 00ceffec 00000000 kernel32!BaseThreadStart+0x37
>
> Anyone have any idea which memory allocation function to use to keep the
> LSA
> happy, or is this a bug?
>
> Thanks
>
>



Relevant Pages

  • Re: allocating memory.
    ... So what would be the ASM equivalent of new memory ... Memory allocation is primarily an OS responsibility, ... OSes are almost certainly responsible for memory ...
    (alt.lang.asm)
  • Re: Doubts on Defining and declaring variables
    ... 1.Dim iage ... and allocate memory for each of them ... My understanding:-Still No memory allocation done at this ... Now since string is assigned to iage,So will ...
    (microsoft.public.scripting.vbscript)
  • Re: xmalloc string functions
    ... require memory allocations depending on the way the system works. ... Not enough context for most real-world applications to ... It is /more/ reliable to routinely auto-save the user's work (as you ... particularly if your auto-save code is robust against memory allocation ...
    (comp.lang.c)
  • Re: "Criticism of the C programming language ??????"
    ... whatever) is that GC only affects memory allocated by GC_malloc. ... other applications and third party libraries will use it too? ... I didn't see how that could be true since, like KT, I was thinking of garbage collection integrated into the language itself. ... In a later message, after a burst of silly and pointless sarcasm, you were persuaded to explain that you were talking about an additional memory allocation library which would support garbage collection for memory it controlled. ...
    (comp.lang.c)
  • Re: Steady State ?
    ... It helps when you provide the context for the quote. ... which places special emphasis on memory allocation issues ... In the context of the article, non-fragmenting memory allocation ... If dynamic memory allocation is added in, ...
    (comp.lang.c)