Commit graph

60 commits

Author SHA1 Message Date
Steven Edwards 7fb3ebb9f9 move the rest of the alread defined tags to the private tag.h
svn path=/trunk/; revision=15427
2005-05-20 04:33:47 +00:00
Alex Ionescu 00fe79ff10 Object Manager Patch. This patch continues the work done in the previous patch and makes the following changes in order to support OB 2.0 (it basically temporarily fixes a highly incorrect implementation so that caller code will be ready to work with the OB 2.0 without change):
1) The documented Object Create Information Structure and semantics implemented. All Object Attributes and passed data from user-mode is now probed and saved into this object create structure when ObCreateObject is called.
2) ObCreateObject does NOT PERFORM ANY OTHER OPERATION EXCEPT CREATING THE OBJECT ANYMORE. ObCreateObject will NOT insert the Object into the tree and other operations. These are now done correctly by ObInsertObject. Therefore, the biggest hurdle was changing pieces of code which assumed ObCreateObject would be enough.
3) ObInsertObject uses the captured create info for all operations isntead of the Object Attributes.
4) ObFindObject now uses the captured info as well.
5) The OBject name and directory are now stored in the documented Object Name Information, always allocated and freed from non paged pool.

HACKS:
5) Because the registry code is horribly broken and doesn't use ObFindObjectByName, the old ObFindObject had to be temporarily duplicated into CmpFindObject.
7) Win32k used ObInsertObject in CsrInsertObject as a way to create a handle inside csrss. However, OBInsertObject now does more then this. As a temporary hack, ObpCreateHandle is exported from the kernel and called from win32k. A fix needs to be done for this, but I don't know the design of win32k+csrss well enough to find a solution.
8) SEH has been commented out in some places of the new probing code because it breaks smss and explorer. These need to be investigated (seh did not exist in the previous code, so this is not really a hack)
9) Named objects with a parent directory are NOT allowed. However because of bugs in kernel32, the new check has been temporarily disabled. (this check did not exist in the previous code, so this is not really a hack)

The next patch will add a proper ObFindObject which will support a more complete Parse Procedure with context and security information. This is needed for proper registry access (requested by Eric Kohl) and for proper functionality of the Desktop/File creation, which should use the Parse routine, and not the Create Handle Routine. This will also make it possible to remove some previous hacks and pave the way for a fixed Iop/IoCreateFile

svn path=/trunk/; revision=15395
2005-05-18 19:26:47 +00:00
Steven Edwards e4be245882 strip whitespace from end of lines
svn path=/trunk/; revision=15164
2005-05-09 01:38:29 +00:00
Thomas Bluemel ea5929db62 1. added irql checks to various rtl and security functions
2. RtlGetVersion needs to be implemented differently in ntoskrnl and ntdll, ntoskrnl's version must not access the PEB (which might not be present) while ntdlls gets most information from the PEB structure
3. can't use spinlocks to serialize access to the security descriptor cache since it calls sd rtl functions which require to run < apc level

svn path=/trunk/; revision=13712
2005-02-22 17:58:19 +00:00
Alex Ionescu fe6116543e Standardize comment headers. Patch by Trevor McCort
svn path=/trunk/; revision=13311
2005-01-26 13:58:37 +00:00
Thomas Bluemel 72ae3c4197 1. A few Nt vs. Zw fixes
2. Fixed and extended RtlCaptureUnicodeString()
3. securely access buffers in NtQuerySystemEnvironmentValue() and NtSetSystemEnvironmentValue() and check for required SeSystemEnvironmentPrivilege privilege

svn path=/trunk/; revision=13208
2005-01-22 12:20:12 +00:00
Alex Ionescu afbaa12f82 Fix my previous patch and fix ACCESS_TOKEN being declared as a structure. This is incompatible with DDK/W32API because ACCESS_TOKEN is a PVOID. The real structure is TOKEN. Also, structure has been updated.
svn path=/trunk/; revision=12740
2005-01-02 23:12:40 +00:00
Gunnar Dalsnes 24dc4f3595 add missing KeEnter/LeaveCriticalRegion before/after aquireing/releasing resource lock
svn path=/trunk/; revision=11755
2004-11-21 18:35:05 +00:00
Eric Kohl 7cd6c44a8a - Move NtAllocateUuids from the Security Reference Monitor to the Executive.
- Update NtAllocateUuids to W2K signature.
- Add NtSetUuidSeed.

svn path=/trunk/; revision=11628
2004-11-12 12:06:54 +00:00
Thomas Bluemel 4a6dd7de44 fixed prototypes of NtSetEvent(), NtResetEvent(), NtQueryEvent(), NtPulseEvent(), NtOpenEvent() and NtCreateEvent()
svn path=/trunk/; revision=11417
2004-10-24 15:26:14 +00:00
Eric Kohl 2a175cb990 Use upper-case ASSERT macros.
svn path=/trunk/; revision=11393
2004-10-22 20:57:39 +00:00
Art Yerkes 9fd341c9ae Zero the new descriptor so that the Dacl, Sacl etc pointers will be zeroed
if not initialized.  cygwin was exercising this.

svn path=/trunk/; revision=11138
2004-10-01 01:28:56 +00:00
Gé van Geldorp 79c3ba475a SeAccessCheck() returns TRUE on success
svn path=/trunk/; revision=11044
2004-09-25 08:49:06 +00:00
Art Yerkes 0089446cc6 cm/regfile.c, ldr/init.c, ldr/loader.c: OBJ_CASE_INSENSITIVE patch I proposed
on the list.  This makes the registry, and dll loading case insensitive when
we are on a case preserving filesystem.

ntoskrnl/ex/power.c: My own contributions to the poweroff message list.

ntoskrnl/mm/npool.c: Fixed bit-rot in whole page alloc.  That's how i found
the bug below.

se/semgr.c, lib/rtl/sd.c:
semgr, when creating a SECURITY_DESCRIPTOR, anded the PRESENT and DEFAULT
flags rather than oring them for group, dacl, and sacl, leading to
RtlLengthSecurityDescriptor giving the wrong length to sdcache.  When
sdcache would copy the security descriptor, it would be too short, and
the bound check from the whole-page allocator would go off.  I fixed this
and made rtl/sd.c use the ROUND_UP macro and RtlLengthSid.  This is cleaner.
It may not be completely correct yet but it no-longer truncates security
descriptors into the cache, which means that the Owner, Group and etc
SIDs should now actually work right when coming from the cache, no matter
what happens in the heap.  They probably seemed to work before simply
because they trashed the ends of their blocks and never moved in the
cache.

svn path=/trunk/; revision=11040
2004-09-25 06:41:16 +00:00
Eric Kohl 4a4dcb92cf Implement SeLockSubjectContext and SeUnlockSubjectContext.
svn path=/trunk/; revision=10855
2004-09-14 11:04:48 +00:00
Eric Kohl 539582375e - Fix a typo in NtSetSecurityObject().
svn path=/trunk/; revision=10803
2004-09-08 11:39:59 +00:00
Thomas Bluemel cb968187d0 silence debug messages
svn path=/trunk/; revision=10732
2004-08-29 15:50:53 +00:00
Filip Navara a48983fc6d - Use ULONG_PTR instead of ULONG for integer arithmetics on pointers.
svn path=/trunk/; revision=10729
2004-08-28 22:22:39 +00:00
Casper Hornstrup 1bf0775833 2004-08-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
* ntoskrnl/include/.cvsignore: New file.
	* ntoskrnl/include/ntoskrnl.h: Ditto.
	* ntoskrnl/*/*.c: Use pre-compiled header.
	* ntoskrnl/Makefile: Support pre-compiled header.
	* tools/helper.mk: .pch files are now .gch files.

svn path=/trunk/; revision=10550
2004-08-15 16:39:12 +00:00
Alex Ionescu c5a9f20753 Added Se Stubs, Prototypes and Exports.
svn path=/trunk/; revision=10370
2004-08-03 19:20:39 +00:00
Eric Kohl f0d259c7bc SeAssignSecurity():
- Inherit SACL.
- Make sure SIDs and ACLs are 4 byte aligned.

svn path=/trunk/; revision=10367
2004-08-03 13:58:56 +00:00
Eric Kohl 5d44bfe942 Implement simple DACL inheritance.
svn path=/trunk/; revision=10242
2004-07-21 23:38:15 +00:00
Eric Kohl c5ad1ab780 SeAssignSecurity:
- Build a self-relative security descriptor.
- Inherit owner and group SIDs or assign useful default SIDs.
- Copy DACL from explicit secuity descriptor.

svn path=/trunk/; revision=10232
2004-07-20 12:08:04 +00:00
Eric Kohl ae95148c4b SeCaptureSubjectContext() must not crash if no current thread exists.
svn path=/trunk/; revision=10226
2004-07-19 12:45:56 +00:00
Eric Kohl 9e08323787 Implement most simple code path of SeAssignSecurity().
svn path=/trunk/; revision=10193
2004-07-18 13:02:28 +00:00
Eric Kohl c6ec21e207 - Move access checks from NtAccessCheck() to SeAccessCheck().
- Check for 'take ownership' privilege.

svn path=/trunk/; revision=10111
2004-07-14 14:25:31 +00:00
Eric Kohl 91946de006 First experimental implementstion of NtAccessCheck().
This should fix bug #362.

svn path=/trunk/; revision=10108
2004-07-13 16:59:35 +00:00
Eric Kohl 72b6ef30e7 Fix NtAccessCheck() prototype.
svn path=/trunk/; revision=10087
2004-07-12 12:05:49 +00:00
Eric Kohl f44bcb1cdb Add some security function stubs.
svn path=/trunk/; revision=9446
2004-05-20 12:42:51 +00:00
Eric Kohl 2ce08a79bb Fix some prototypes.
svn path=/trunk/; revision=8722
2004-03-14 18:13:19 +00:00
Hartmut Birr e9568da21e - Added return values to some unimplemented functions.
svn path=/trunk/; revision=7039
2003-12-14 17:44:02 +00:00
Hartmut Birr 2a1821394f - Fixed the freeing of memory from boot load drivers.
- Put all init functions in a special section and do free
  the memory from this section after system initialization.

svn path=/trunk/; revision=6296
2003-10-12 17:05:50 +00:00
Eric Kohl 54fd76554e Moved audit functions to a separate file.
Fixed audit function prototypes.

svn path=/trunk/; revision=5192
2003-07-20 22:10:38 +00:00
Royce Mitchell III 59d5c9f016 finished applying @implemented and @unimplemented comments and remove the comments from non-api functions
svn path=/trunk/; revision=5068
2003-07-11 01:23:16 +00:00
Eric Kohl 0c2028b391 Added missing Acl and SD functions from ntdll.
svn path=/trunk/; revision=4156
2003-02-15 21:07:49 +00:00
Casper Hornstrup c28439db70 2002-10-25 Casper S. Hornstrup <chorns@users.sourceforge.net>
* apps/tests/tokentest/tokentest.c (ROS_ACE_HEADER): Move field
	AccessMask ...
	(ROS_ACE): ... here.
	(DisplayDacl): Make pAce an ROS_ACE*; Use new path for AceType; Use
	sizeof(ACE) instead of sizeof(ACE_HEADER).
	* include/ntos/security.h (ACE_HEADER): Move field AccessMask ...
	(ACE): ... here.
	* lib/ntdll/rtl/acl.c: Use new path for AccessMask.
	* ntoskrnl/se/semgr.c: Ditto.
	* ntoskrnl/se/acl.c (SepInitDACLs): Use new path for AccessMask; Use
	sizeof(ACE) instead of sizeof(ACE_HEADER).
	* ntoskrnl/se/token.c (SepCreateSystemProcessToken): Use sizeof(ACE)
	instead of sizeof(ACE_HEADER).

svn path=/trunk/; revision=3654
2002-10-25 21:48:00 +00:00
Casper Hornstrup 17c0b5798e Reverted latest changes.
svn path=/trunk/; revision=3473
2002-09-08 10:23:54 +00:00
Casper Hornstrup 387d432884 Use free Windows DDK and compile with latest MinGW releases.
svn path=/trunk/; revision=3466
2002-09-07 15:13:13 +00:00
Eric Kohl a7a6f4a353 Fixed typo!
svn path=/trunk/; revision=2999
2002-06-04 14:14:07 +00:00
Eric Kohl 0fae9a2eac Fixed token type initialization.
svn path=/trunk/; revision=2998
2002-06-04 13:44:06 +00:00
Eric Kohl 8393800e76 Started security manager initialization.
Some cleanup.

svn path=/trunk/; revision=2637
2002-02-20 20:16:49 +00:00
Eric Kohl c0159ad5c8 Some minor fixes
svn path=/trunk/; revision=1330
2000-09-03 14:53:13 +00:00
David Welch d351d182ef Added working set functions
Seperated memory manager initialization
Seperated trap functions
Removed process/thread definitions from ddk headers
Changed indentation back to sane style (please don't change)

svn path=/trunk/; revision=1224
2000-07-04 08:52:47 +00:00
David Welch d24a48cd94 More improvements to LPC code
Updated TEB structure
Changed selectors value to be closer to nt
Some bugfixes

svn path=/trunk/; revision=965
2000-01-26 10:07:30 +00:00
David Welch 623093eaaa Implemented more security functions
Moved general security types into new header file
Implemented ThreadImpersonationToken info class
Bug fixes to queuing code

svn path=/trunk/; revision=919
2000-01-05 21:57:00 +00:00
Emanuele Aliberti ea5959a772 Some missing __stdcall declarations added in headers and in code.
svn path=/trunk/; revision=903
1999-12-26 17:22:19 +00:00
David Welch 4d5643a96a Added some security functions
Changes to csrss console support
Fixed bug in gdt.c

svn path=/trunk/; revision=901
1999-12-26 15:50:53 +00:00
David Welch b986ce1cac Began converting minix fsd to work with new caching mechanism
Implemented user-mode APCs (still some bugs)
Began implementing shared memory, still some locking issues

svn path=/trunk/; revision=792
1999-11-24 11:51:55 +00:00
Eric Kohl 648301897c Fixed header inclusion order.
svn path=/trunk/; revision=687
1999-10-07 23:46:27 +00:00
Rex Jolliff 9957d94c20 Various small changes for registry work
svn path=/trunk/; revision=614
1999-08-14 18:59:28 +00:00