Maximizing memory usage

Early last year, I wrote a post that advised using Task Manager to track memory usage. It included this quote:

Some people assume that the goal of memory management is to leave as much memory free as possible. (That attitude is especially prevalent among those who spent a long time working with the notoriously resource-challenged Windows 95/98/Me family.) In fact, for best performance your goal should be to make maximum use of RAM. Empty RAM does you no good. Windows can swap data in and out of RAM very quickly, so if memory is free, the cache manager tries to fill it up with as much data as possible. Likewise, a well-written program can and should load as much data into memory as possible so that it can respond quickly when you make a request.

Ken asks:

Are you suggesting here that you should try to run as many programs as possible at the same time to keep all of them in superfast RAM?

That’s kinda sorta what I do anyway, and I have never experienced any performance hit with XP for doing so. As long as these programs are loaded in RAM, they respond much faster. [Insert “well, duh!” here.] And they don’t hog CPU time except when they are actually doing something.

I’m not sure I would go as far as to say you should run as many programs as possible. In some cases, that strategy would take memory away from the cache manager, making some performance tradeoffs inevitable.

Off the top of my head, I’d say the single biggest piece of advice I would give people is this: Assuming you have sufficient RAM to run the programs you normally use, don’t close programs unless and until you need to close them. I watch people work regularly and I’m always amused at how novice users routinely close one program before opening another. I don’t know whether it’s the clutter or what, but that’s something novices almost always do.

In the case that Ken describes, assuming that your regular suite of programs doesn’t put you close to maxing out physical RAM, then yeah, it’s probably a good idea to open up the programs you’re going to use during a session and leave them open for the duration.

A tale of two patches, part 2

Apparently, some people think I chose a bad example yesterday to illustrate my point that patching complex software takes time. So maybe a different example will help.

This Secunia advisory from September 9, 2005 was rated “highly critical”:

Tom Ferris has discovered a vulnerability in Firefox, which can be exploited by malicious people to cause a DoS (Denial of Service) or to compromise a user’s system.

The vulnerability is caused due to an error in the handling of an IDN URLs that contains the 0xAD character in its domain name. This can be exploited to cause a heap-based buffer overflow.

Successful exploitation crashes Firefox and allows code execution but requires that the user is tricked into visiting a malicious web site or open a specially crafted HTML file.

NOTE: Exploit code is publicly available.

This Mozilla.org advisory offered a workaround that involved disabling the IDN functionality

On September 6 a security vulnerability affecting all versions of Mozilla Firefox and the Mozilla Suite was reported to Mozilla by Tom Ferris and on September 8th was publicly disclosed.

On September 9, the Mozilla team released a configuration change which, as a temporary measure to work around this problem, disables IDN in the browser. IDN functionality will be restored in a future product update. The fix is either a manual configuration change or a small download which will make this configuration change for the user.

Sound familiar? That’s exactly how Microsoft initially responded to the WMF exploit.

The patch for this vulnerability (and remember, there was working exploit code out there) was incorporated into Firefox 1.0.7, which was released 12 days later, on September 21.

I’m not trying to “smear the Open Source community.” In fact, I’m an enthusiastic Firefox user and supporter. In the September 9 vulnerability, I don’t think that the Firefox developers were underestimating the problem, nor were they sitting on a patch. The process took 12 days, period. I don’t think the Windows security team was sitting on the WMF exploit either. The process of developing and testing a fix takes time. That’s true of any complex program, including Firefox and Windows.

WMF exploit patch is out right now

Underpromise, overdeliver. That’s the classic advice from business school, and someone at Microsoft learned that lesson well.

Five days earlier than promised, Microsoft has delivered the January 2006 security update for the WMF vulnerability. Why now? Mike Nash, Corporate Vice President for Security, explains on the Microsoft Security Response Center Blog:

[A]ctually creating the update was a straight forward process. The challenge was testing the update on all of the supported versions of Windows and the 23 languages we support and making sure that the set of applications that might be effected by this update are not negatively affected by this change.

On Tuesday morning, we announced that our goal was to have an update available as part of our regular update cycle on January 10th. That date was based on our forecast on where we would be with quality.

So what changed to make us decide to release an update today? Two things: The first is that we have an update that we believe in. The team worked very hard to run all of the key scenarios that we are concerned about. While we would always like to have more time, we are confident in the quality of the update. The second issue is that while there is no imminent threat, a number of customers are seeing exploit traffic hitting their AV, IDS and IPS systems. Interestingly, when you talk to the security vendors they are seeing the rate of infection and the rate of spread actually decrease. But, when I spoke to a number of customers and asked if the current situation warranted an out of band release of the update, they said yes, if we had hit our quality goals. I reminded them of their past feedback about out of band updates being an inconvenience and their preference for the monthly release schedule. Overall, they felt that we had made these out of band releases so infrequent, that doing it once when it matters was not a big deal.

If you have Automatic Updates turned on, you’ll get the update without any effort on your part. If you don’t want to wait, visit Windows Update right now.

Windows XP Home reaching the end of the line?

Dwight Silverman passes along news that Windows XP Home users may run out of support options soon:

Microsoft’s support timeline for consumer products differs from that for business products. Thus, XP Home’s mainstream support period will end sooner than that for XP Professional…

The story (which originally appeared in Ars Technica) is based on a literal reading of Microsoft’s Support Lifecycle policies. If the company sticks to its stated policies, support for XP Home would end on December 31, 2006, only a couple months after Windows Vista is due to be released.

Fortunately, a commenter at Dwight’s site read the Windows Service Pack Road Map, which notes that “SP3 for Windows XP Home Edition is currently planned for 2H 2007.” That would suggest that Microsoft has no intention of pulling the plug on Windows XP early.

Sure would be nice if someone in Redmond would actually come out and say so.

A tale of two patches

Update: The point of this post is not “Firefox sucks, too.” The point is that patching complex programs takes time. I’ve posted another example that makes the same point here.

In the comments to yesterday’s post about SANS and the WMF exploit, a visitor remarks:

Bear in mind that when popular open source (such as Firefox) vulnerabilities have been exposed, there were patches available in about 48 to 72 hours. It’s been more than a week since the WMF vulnerability was exposed. The problem is pretty well known by now, and it’s telling that users themselves have managed to generate a fix before Microsoft has.

My, what selective memories people have. Patches in 48-72 hours? Maybe if you’re a developer, but not for mere mortals.

Remember the Firefox IDN exploit? Working exploit code was released on or before February 7, 2005. The updated version that fixed the underlying vulnerability was released on February 24, 2005. That’s 17 days later, for those who don’t have a calculator handy. And on top of that, the Mozilla group didn’t make this available through its auto-update mechanism until roughly a week after the new version was ready.

And yet a chorus of doomsayers are ready to throw Microsoft to the wolves because they plan to release a patch for the WMF exploit via Windows Update 13 days after it was first reported. Based on the Firefox experience, that seems to be about how long it takes to produce a reliable, safe, well-tested patch.

SANS jumps the shark

This rant from Tom Liston at SANS is disgraceful to see on a serious security site. You got problems with Microsoft’s decision? Make your case. Give your readers some evidence. Get angry if you want. But juvenile satire that ignores the business realities of the situation is just stupid, and it’s double-plus-stupid when the rant is completely free of facts or analysis.

My collective opinion of SANS has dropped severely.

OneCare users, you’re safe

In an earlier post, I reprinted a list of which antivirus programs had been successful at blocking the WMF exploit early. (By now, of course, almost everyone has caught up.) One name that was noticeably absent from both lists was the beta release of Microsoft’s Windows OneCare Live, which I’ve been using for a couple months now.

According to Microsoft’s updated Security Advisory 912840, OneCare works:.

If you are a Windows OneCare user and your current status is green, you are already protected from known malware that uses this vulnerability to attempt to attack systems.

That’s a relief.

Help is on the way for the WMF vulnerability

Microsoft has updated Security Advisory 912840, which provides details of the WMF exploit that was sprung on an unsuspecting world last week. The good news? A patch will be available in one week:

Microsoft has completed development of the security update for the vulnerability. The security update is now being localized and tested to ensure quality and application compatibility. Microsoft’s goal is to release the update on Tuesday, January 10, 2006, as part of its monthly release of security bulletins. This release is predicated on successful completion of quality testing.

The update will be released worldwide simultaneously in 23 languages for all affected versions of Windows once it passes a series of rigorous testing procedures. It will be available on Microsoft’s Download Center, as well as through Microsoft Update and Windows Update. Customers who use Windows’ Automatic Updates feature will be delivered the fix automatically.

Based on strong customer feedback, all Microsoft’s security updates must pass a series of quality tests, including testing by third parties, to assure customers that they can be deployed effectively in all languages and for all versions of the Windows platform with minimum down time.

The level of hysteria over the WMF exploit is getting a little silly. Yes, it’s a zero-day exploit, which is a very bad thing. But the drumbeat that this will be “the mother of all Internet worms” has been spreading. Even the normally down-to-earth crew at SANS has melted down. And yet, as Larry Seltzer at eWeek points out, Microsoft’s deliberate pace seems correct. Major antivirus software vendors, who are usually ready to hit the panic button (and sell a lot of software) at the slightest provocation, are surprisingly low-key:

[I]t’s Monday morning, Jan. 2, and none of the major anti-virus has a serious alert up. McAfee, Symantec, Trend and Panda all show no alarm, and the ones that have a general level of alertness are all showing a low level. Panda can usually be counted on for some hysteria at a time like this, and Computer Associates doesn’t even seem aware of the threat on its site.

There is F-Secure, who is showing a Level 2 (out of 3) alert. F-Secure has been on top of this situation from the very beginning …

As I pointed out in an earlier piece, actual testing of 73 variants of this threat shows excellent protection common among anti-virus vendors. As of Saturday morning, the 100 percent list included AntiVir, Avast, BitDefender, ClamAV, Command, Dr Web, eSafe, eTrust-INO, eTrust-VET, Ewido, F-Secure, Fortinet, Kaspersky, McAfee, Nod32, Norman, Panda, Sophos, Symantec, Trend Micro and VirusBuster. If you’re a user of one of these products and you keep your anti-virus updated, odds are good that you’re protected against any exploits you’re likely to see.

And as one of the anti-virus vendors pointed out to me, there may be dozens of variants out there and a first attempt at an IM worm, but there is no major attack yet. In other words, there may be a major vulnerability, but there is no major exploit, and you’re unlikely to encounter one unless you spend a lot of time on porn sites or already are running adware.

So let’s review:

  • Disabling the Windows Picture and Fax Viewer is a proven workaround for all variants to date.
  • If you’re running auto-updating antivirus software from a major vendor, it’s able to detect and block all known variants of this exploit.
  • The average person is extremely unlikely to get hit with this thing in everyday browsing.
  • No one has come up with an e-mail-based vector yet, aside from the usual spammy attempts to entice you to a shady Web site.

In short, it’s not time to panic. I directly support about a dozen users – family and friends. None of them are shy about calling for help, and none of them have encountered this exploit. I have an extended family of correspondents who reach out when they encounter viruses and spyware. I haven’t heard a word from them. In fact, although lots of security sites are finding examples of this exploit in the usual dark corners of the Web, no one has reported widespread infections. The updated security bulletin confirms what the antivirus companies are saying:

Microsoft has been carefully monitoring the attempted exploitation of the WMF vulnerability since it became public last week, through its own forensic capabilities and through partnerships within the industry and law enforcement. Although the issue is serious and malicious attacks are being attempted, Microsoft’s intelligence sources indicate that the scope of the attacks are not widespread.

In addition, anti-virus companies indicate that attacks based on exploiting the WMF vulnerability are being effectively mitigated through up-to-date signatures.

One skilled and apparently trustworthy coder has released an unauthorized patch for this vulnerability. SANS recommended that everyone install it. I haven’t recommended this patch, because in my view the risk is greater than the benefit. I think Microsoft has made a perfectly reasonable trade-off in developing and testing this patch. A seemingly small change can have a ripple effect in unexpected places. The nightmare scenario is a poorly tested patch that renders a system unstable or causes data loss.

If this had been the Slammer worm, which spread like wildfire over the Internet back in 2003, a more aggressive approach would be called for. In this case, I think the response from Microsoft has been appropriate.

How effective is your antivirus software?

eWeek points to an authoritative analysis of how security software companies have responded to the WMF exploit:

AV-Test, which tests anti-malware products, has been tracking the situation closely and has, so far, analyzed 73 variants of malicious WMF files. Products from the following companies have identified all 73:

* Alwil Software (Avast)
* Softwin (BitDefender)
* ClamAV
* F-Secure Inc.
* Fortinet Inc.
* McAfee Inc.
* ESET (Nod32)
* Panda Software
* Sophos Plc
* Symantec Corp.
* Trend Micro Inc.
* VirusBuster

These products detected fewer variants:

* 62 — eTrust-VET
* 62 — QuickHeal
* 61 — AntiVir
* 61 — Dr Web
* 61 — Kaspersky
* 60 — AVG
* 19 — Command
* 19 — F-Prot
* 11 — Ewido
* 7 — eSafe
* 7 — eTrust-INO
* 6 — Ikarus
* 6 — VBA32
* 0 — Norman

The difference for the more effective products is likely to be heuristic detection, tracking the threat by identifying the basic techniques of the exploit, rather than looking for specific patterns for specific exploits.

I know a lot of people who use various free antivirus programs, especially AVG. I don’t recommend them, and this study is one giant data point in my argument.

Anyone with an updated subscription to any of the AV programs on the first list above is fully protected from the WMF exploit. Anyone using a program on the second list should ask themselves whether it’s time to switch.