Goldman Sachs said it could lose as much as $3.4 billion in damages and other litigation related matters involving securities it underwrote in the last few years for which the purchasers are now suing to recover losses or to force the firm to buy them back.