Amid all the talk about the boom in real estate prices and the concern about the "housing bubble" some day bursting, one fact tends to be forgotten. Far too many families are simply being locked out of decent shelter by the shortage of affordable housing.

The latest official estimate is that the country lacks 1.6 million units of low-income housing. According to the 2003 American Housing Survey, 7.5 million households were "severely burdened" by their housing costs, meaning that more than half their income went for rent or mortgage payments.

It has been 10 years since the federal government put any substantial sums into building affordable housing for families, but last week a glimmer of hope appeared from an unexpected source. A bipartisan bill emerged from the House Financial Services Committee that could generate $400 million a year or more for low-income housing.

The measure's main purpose is to provide new, more stringent regulation for the two giant government-chartered mortgage finance agencies, best known by their nicknames, Fannie Mae and Freddie Mac. Their mandate is to increase the availability of housing. These GSEs, or government-sponsored enterprises, got into hot water because of their accounting practices, and Congress has been figuring out how to keep closer tabs on them.

When the bill was being drafted last week, the two key Republicans, Ohioans Michael G. Oxley and Robert W. Ney, the chairmen, respectively, of the full committee and its housing subcommittee, decided that to lock in Democratic support, they would include a proviso from the committee's top Democrat, Rep. Barney Frank of Massachusetts, to earmark 5 percent of Fannie and Freddie's annual profits for preservation, rehabilitation and construction of low-income housing.

It's estimated that this would produce at least $400 million a year, and perhaps as much as $1 billion, depending on the way the two mortgage giants eventually work out their accounting problems. Economists at the National Low Income Housing Coalition, the leading advocacy group in this field, calculate that with construction costs estimated at $70,000 to $100,000 per unit, the program could build between 4,000 and 14,000 units a year.

Sheila Crowley, the group's president, said that would be "an important step forward in our fight to make sure that safe and decent housing for all Americans, regardless of income, is once again a national priority."

The step is not guaranteed. Committee conservatives tried to knock out the 5 percent set-aside. Their amendment, sponsored by Rep. Ed Royce, a California Republican, failed on a 53 to 17 vote, but backers expect more support when the bill reaches the House floor. They contend that the potential billion-dollar sum would be better applied to lowering the costs of mortgages underwritten by Fannie and Freddie, rather than creating what they term "a slush fund" for the politically well-connected GSEs.

A spokesman for Ney told me that even though he represents a largely rural area, his constituents are all too familiar with the problems of affordable housing, so he joined Oxley in lining up most of the committee Republicans against the Royce amendment. What will happen on the House floor remains to be seen.

On the other side of the Capitol, Sen. Jack Reed, a Rhode Island Democrat, has sponsored similar legislation -- an outgrowth of an interest in housing issues he told me he developed in the 1980s as a young member of the state legislature. The Reed amendment became part of a housing bill that never came to a floor vote in the last Congress. A new bill will be crafted in committee, perhaps later this month.

So far the Bush administration has not weighed in for or against the low-income housing fund, but Housing and Urban Development Secretary Alphonso Jackson said in a statement that his priority is "enforcing the affordable housing goals" for Fannie and Freddie -- something that would not necessarily provide new construction grants.

Over the years, the federal commitment to affordable housing has shrunk steadily, with the only remaining large-scale program being Section 8 vouchers, which help qualified families with rent subsidies but do not expand the supply of housing.

It is more luck than anything else that has made Fannie and Freddie plausible sources of new affordable-housing construction money. Were it not for the regulatory problems that they brought on themselves, it's doubtful this Republican Congress would have thought to tap their profits for such a purpose.

Call it the silver lining in this cloud of financial scandal.