Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Mark Russinovich on Windows Kernel Security 181

An anonymous reader writes to mention that in the final part of his three part series, Mark Russinovich wraps up his look at changes made in the Windows Vista Kernel by exploring advancements in reliability, recovery, and security. "Applications written for Windows Vista can, with very little effort, gain automatic error recovery capabilities by using the new transactional support in NTFS and the registry with the Kernel Transaction Manager. When an application wants to make a number of related changes, it can either create a Distributed Transaction Coordinator (DTC) transaction and a KTM transaction handle, or create a KTM handle directly and associate the modifications of the files and registry keys with the transaction. If all the changes succeed, the application commits the transaction and the changes are applied, but at any time up to that point the application can roll back the transaction and the changes are then discarded."
This discussion has been archived. No new comments can be posted.

Mark Russinovich on Windows Kernel Security

Comments Filter:
  • by nanosquid ( 1074949 ) on Wednesday March 21, 2007 @05:15PM (#18434779)
    There is little reason to put these kinds of transactional services into the kernel: they don't involve security or user permissions and they must be efficiently implementable in user code anyway (otherwise, most databases wouldn't work well on NT). So, I'd classify this as "kernel bloat".
  • by suv4x4 ( 956391 ) on Wednesday March 21, 2007 @05:15PM (#18434791)
    On topic now, I don't like the way Russinovich is blowing Vista's horn now. I liked him more when he was more critical and analytical on what could be improved, instead of what has already been done.

    He's working at Microsoft now, you do realize that "what could be improved" he's actually doing right now, so he can call it "already been done".

    You don't really prefer pointless critique with no improvement, do you.
  • by Applekid ( 993327 ) on Wednesday March 21, 2007 @05:24PM (#18434935)
    According to the bottom of just one function of the KTM reference [microsoft.com]:

    "Requires Ktmw32.dll."

    Why would a kernel add-on require a .dll, exactly? Did I miss some Windows fundamental about it's kernel? And if it's not really a result of a kernel enhancement, is this yet another potentially useful technology specificly excluded from earlier versions of Windows entirely for business purposes instead of technological limitations?
  • by Bacon Bits ( 926911 ) on Wednesday March 21, 2007 @05:27PM (#18434967)
    Yet PS3 portability was *absolutely vital*.
  • by dedazo ( 737510 ) on Wednesday March 21, 2007 @05:29PM (#18434991) Journal

    On topic now, I don't like the way Russinovich is blowing Vista's horn now. I liked him more when he was more critical and analytical on what could be improved, instead of what has already been done.

    Fresh blood always brings fresh perspectives. Mark has been on the outside looking in for long enough that he probably has a fairly asymetrical view of the NT kernel to that of the core MS developers, and in software development (especially at that level) that tends to be extremely useful.

  • by Ancient_Hacker ( 751168 ) on Wednesday March 21, 2007 @05:46PM (#18435239)
    Recovery? The Windows Registry is the exact opposite of recoverable:

    • "Regedit" has no Undo command. It applies changes immediately.
    • The Registry file is in a proprietary and undocumented format.
    • One scrozzled byte in the Registry can make it completely broken and make the system unbootable.

    Not exactly most people's idea of robust and recoverable.

  • A fairly common trend these days in PC games (mostly multiplayer ones) is the use of a kernel-mode windows driver (effectively a rootkit in most cases) to 'protect' the game from hacking. Many eastern (korean, taiwanese, etc.) game development companies opt to use this mechanism to secure their games instead of writing secure client and server code - for example, GunBound, Maple Story, Ragnarok Online, Rakion, etc... pretty much any MMO you see an ad for these days that isn't from a US or European studio uses this stuff for security. The basic mechanism it uses is that it hooks all the low level operations you can do on your system (file access, process access, etc.) and prevents you from touching anything related to the game. The end result is that you can't even so much as end-task a misbehaving game 'protected' by this driver.

    With the huge amount of popularity this approach seems to have (I personally suspect it's a result of some very, very aggressive marketing on the part of the driver's developers), I wouldn't be suprised to see many games start demanding that users run them on Windows Vista, so that the 'protected process' mechanism can be used to fully 'protect' the games from users' interference. While you'd at least be able to end-task them, I can't say I see this as an improvement. It's saddening that many companies believe the solution to security is a series of hacks, workarounds, and black boxes - the only real solution is careful, methodical design and engineering. It seems very likely to me that within a few years, many PC games will refuse to run on anything except a Vista system with nothing but signed drivers loaded, and that's saddening. I dislike the notion that I am denied even basic rights to investigate what an application is doing on my machine simply for the sake of 'security', when it's trivial to set up a second machine to inspect and modify a game's network packets and cheat all I want.
  • by Anonymous Coward on Wednesday March 21, 2007 @05:54PM (#18435345)
    Think outside your small box. These features can provide significantly more than current user-mode transaction management that databases (or OLTP monitors) provide today.

    For instance, how does a user-mode controlled file-system transactions rollback changes on reboot? Consider what happens when the change involves system files. NTFS handles this cleanly in Vista but any attempt to do this with a user-mode service would fail because the system files would already be in-use by the time the service started. Further, any transactions in-doubt would remain in-doubt until the service started (if you could get that far).

    Similarly, what about settings in the registry? Consider if the transaction spanned installing a driver and updating its settings. What happens if the system powers down midway through that update? Without kernel-level transactions that are available at boot-time you cannot easily recover before inconsistent settings are used with the driver.

    Beyond the boot-level support; another exciting aspect about the KTM is that this is a transaction-manager that provides transactions that can be shared across multiple processes. Try that with a user-mode transaction manager like XA or DTC and see your per transaction performance. By managing the transaction in the kernel, the 2PC performance is significantly improved.

    In the end, NTFS and the registry live in the kernel -- so their tramsaction manager also has to live in the kernel. That is just the way it works.

    Another exciting aspect covered is the ability to coordinate DTC transactions with KTM transactions. Meaning, you can coordinate your SQL Server (or Oracle) updates with your file-system updates. This is cool! No longer do you have to worry about finding orphan-files in workflow applications or other applications that manage both files and relational data.

    Lastly, they are talking about full ACID properties with NTFS's transactions. Think about it -- you could update every file on your web server, in place, while its wild with activity. All your changes are isolated from the users until you say "commit" in your application.
  • by mpapet ( 761907 ) on Wednesday March 21, 2007 @06:06PM (#18435551) Homepage
    the solution to security is a series of hacks, workarounds, and black boxes

    Outside of some very specific gov't spooks contract work, no one is willing to adopt the other because it's more expensive and requires more thought and risk than the average PHB can handle.

    Case in point: The number of cashless casino gaming systems that are centrally managed. The average casino manager understands their casino systems are a single, massive, point of failure. Just wait till they go to cashless floors and someone engineers a jackpot for themselves.

    Security programming is hard. Really hard. The developers at these companies may _want_ to do the right thing, but they don't because of the complexity and limited resources.

    The big-digital-bank-robbery just hasn't happened yet.
  • by bmajik ( 96670 ) <matt@mattevans.org> on Wednesday March 21, 2007 @06:13PM (#18435653) Homepage Journal
    The registry can be backed up and restored, in whole or in subsections.

    The format of the registry is largely irrelevant, but it is described to some extent in the "Inside Windows xxx" series of books (which Russinovich co-authored)

    Which specific byte would you "scrozzle" in the registry to render a machine unbootable? How and why would you do it?

    Extra credit:
    Which files under /boot, /etc, /sbin, and so on would you be willing to stake your career on being "safe to corrupt by 1 byte" and still guarantee a bootable system?

    There are things to like or dislike about either a registry based approach (opaque data storage with a defined interface) vs a flat text based approach (clear data storage with an undefined interface). I don't think you make a compelling "anti-registry" argument with the points you list, however.

  • by EvanED ( 569694 ) <{evaned} {at} {gmail.com}> on Wednesday March 21, 2007 @06:23PM (#18435759)
    C is a language, not a program.

    Yes, I realize that.

    And the preprocessor directives are part of that language. Or perhaps you missed sections 5.1.1 and 6.10 of the description [open-std.org] of that language? (Assuming the numbering stayed the same from draft to final.)
  • by EllynGeek ( 824747 ) on Wednesday March 21, 2007 @06:36PM (#18435937)
    Sysinternals was one the very few companies with the expertise to dissect and analyze Windowses truthfully. It's no accident that after the Sony rootkit fiasco they were quietly acquired by microsoft. Just one more assimilation.
  • by EvanED ( 569694 ) <{evaned} {at} {gmail.com}> on Wednesday March 21, 2007 @06:40PM (#18435977)
    It seems to be: every database more complex than a flat file processed by a pair of simple perl scripts has support for transactions like this.

    Yes, DBs do. But traditionally file systems don't. The only other system that provides this that I know of that isn't a full-fledged database is VMS.
  • by fabs64 ( 657132 ) <beaufabry+slashdot,org&gmail,com> on Wednesday March 21, 2007 @06:58PM (#18436197)
    Difference being you're not supposed to modify things in /boot and /sbin for all your settings, and /etc is text and therefore much harder to screw up. (you could put an EOF as the first byte in the file, but the system will still probably at least give you a "file x is empty" error message).

    What you've said is correct, the gp's gripe is really about using a binary configuration file.. a fairly stupid decision but that is only my opinion.

    My argument for flat text (or xml or whatever) over binary, is the same as every argument about the two for the past 5 years, binary is too system specific, reading/writing it is almost always more painful (faster though), reverse-engineering the format is always a much bigger job.

    The "defined interfaces" argument doesn't really wash, you can define an interface just as easily for a text file as you can for binary, however with text someone may be able to edit it by hand or write their own interface, with binary this is much more difficult.

    I think what it really comes down to is this; If you decided to write a new OS today from scratch and wanted to have a central configuration database (a good idea, as shown by /etc), would YOU come up with the windows registry?
  • by swillden ( 191260 ) * <shawn-ds@willden.org> on Wednesday March 21, 2007 @07:02PM (#18436245) Journal

    They also involve atomic I/O to multiple systems simultaneously. Userland can't do this.

    Of course it can. As long as the OS provides atomic I/O operations on individual files, the logic for implementing two-phase commit is the same in userland or in kernel space. For that matter, atomic I/O can be implemented entirely in userspace, as long as the OS provides a mechanism for userspace to find out when the data has actually been written. It's more convenient to put single-file atomic I/O in the kernel, though (or at least in the file system).

    Besides, I'd rather have this code once in a DLL than 10 times in 10 different apps.

    That's not an argument for putting it in the kernel.

  • by Penguinisto ( 415985 ) on Wednesday March 21, 2007 @07:05PM (#18436279) Journal

    What is that magic, dangerous byte? If it ever existed, wouldn't be trivially easy to write a virus and scrozzle it? Where are these viruses?

    You can't pump V1@grA spam or DDoS packets out of a dead machine, and malware writers are definitely in it for the cash nowadays. (IIRC, a large percentage of malware specifically hides in the registry...)

    /P

  • by Anonymous Coward on Wednesday March 21, 2007 @08:22PM (#18437091)
    Yes, it is innovation. The feature you linked to in VMS is a distributed transaction coordinator. Windows has had this component (called DTC) for years.

    The actual innovation is making a Kernel Transaction Manager, along with a resource manager for the filesystem. The KTM means that transactions can be inherited from parent process to child or joined by a cooperating process. Having a transactional filesystem means that all file operations can be all-or-nothing. Power goes out during a major update? No problem, because when you boot up again the filesystem will be recovered and it will be like the update was never started. And the beauty of having the resource manager in the filesystem is that you can combine the filesystem transactions with any other ones in the system (via the DTC). In fact, they could even make it so that you can combine transactions across systems so that moving files from one server to another would be atomic.

    dom
  • by drsmithy ( 35869 ) <drsmithy@nOSPAm.gmail.com> on Wednesday March 21, 2007 @09:08PM (#18437577)

    Difference being you're not supposed to modify things in /boot and /sbin for all your settings, and /etc is text and therefore much harder to screw up. (you could put an EOF as the first byte in the file, but the system will still probably at least give you a "file x is empty" error message).

    Users aren't supposed to modify the Registry, either.

    What you've said is correct, the gp's gripe is really about using a binary configuration file.. a fairly stupid decision but that is only my opinion.

    It was designed in the late '80s (well, arguably the late '70s) when a 20Mhz 386 with 4MB of RAM was "bleeding edge". Text-parsing is expensive.

    I think what it really comes down to is this; If you decided to write a new OS today from scratch and wanted to have a central configuration database (a good idea, as shown by /etc), would YOU come up with the windows registry?

    Windows NT wasn't designed today, it was designed in the late 80s.

  • by bmajik ( 96670 ) <matt@mattevans.org> on Wednesday March 21, 2007 @11:07PM (#18438697) Homepage Journal
    Are you seriously asking?

    what is the comment convention?
    What is the whitespace convention?
    Does this version of this flavor use spaces or tabs in /etc/fstab (or is it /etc/vfstab on today's OS?)
    What are the file locking semantics?
    Which set(s) of files are logically related to the same peice of functionality?
    What character encodings are supported?
    What _line termination_ is supported?

    nfs export your /etc directory r/w some time. Let someone edit your /etc/fstab in TextEdit on a Mac. Make sure they cut-and-paste from a sample they saw on a website, or that they got via an email. Are you willing to bet your uptime on that working correctly? Even if you control the email or webpage they're pasting from.. are you _sure_ it would work? That there'd be no conversion problems?

    Have you ever done a *nix upgrade on a machine? What happens to most of the files in /etc? The answer is NOT "your changes are seamlessly rolled forward"

Work without a vision is slavery, Vision without work is a pipe dream, But vision with work is the hope of the world.

Working...