Bank of America will pay almost $17 billion to end federal investigations into its selling of mortgage securities prior to the recession, the New York Times said.