U.S. stocks turned green by mid-afternoon Tuesday as rising tensions between Russia and Turkey pushed crude oil higher. 

The S&P 500 was up 0.3%, the Dow Jones Industrial Average added 0.35%, and the Nasdaq rose 0.13%.

The energy sector moved higher as crude oil rallied on a possible stop in oil trade between Turkey and Russia. West Texas Intermediate rose 3.1% to $43.05 a barrel. The Energy Select Sector SPDR ETF (XLE - Get Report) added 2.4%.

"The petroleum markets are staging a short-covering rally, sparked at least in part by Turkey's downing of a Russian warplane near its border with Syria," Timothy Evans, Citi energy futures specialist, wrote in a note. "The market reaction so far suggests a chilling of relations and a drop in trade between the two countries rather than the start of a major war."

The Turkish military overnight shot down a Russian fighter jet on the Syrian side of the Turkey-Syria border. Officials said the aircraft intentionally violated Turkish airspace. The incident marks another flare-up in already-tense relations in the region.

Russian President Vladimir Putin said the attack was a "stab in the back by the accomplices of terrorists," accusing Turkey of abetting the Islamic State by selling its oil. 

Third-quarter GDP in the U.S. was revised up to 2.1% growth, as economists expected, from a previous reading of 1.5%, according to the U.S. Commerce Department. The upward revision was driven by less inventory accumulation than previously expected.

Consumer confidence fell to its lowest level in 14 months in November, the Conference Board said Tuesday. The consumer confidence index fell to 90.4 from a revised reading of 99.1 in October. Sentiment was hit by increasing pessimism over the labor market with a rising number of people saying that jobs were harder to find.

"While it is important to not make to much out of one data release, the big decline in consumer confidence in November is concerning," said Steve Murphy, U.S. economist at Capital Economics. "Nevertheless, we still think the conditions remain in place for 3% annualized growth in real consumption in the final quarter of the year."

Home prices rose 0.2% in the three months ended in September, according to the S&P/Case-Shiller 20-city composite index. San Francisco, Denver and Portland led gains, reporting double-digit yearly growth over the quarter.

Bill Ackman's Pershing Square raised its stake in Valeant Pharmaceuticals (VRX) as shares continue to face pressure from accusations of sales fraud. The activist investment firm raised its stake to 9.9% from 5.7%. Valeant shares have nearly halved in value since mid-October.

Activist investor Carl Icahn has disclosed a new 7.1% stake in Xerox (XRX - Get Report) to become the company's second-largest shareholder. Icahn called the company's shares "undervalued" and said he was looking to gain a position on the board. 

Microsemi (MSCC) agreed to acquire PMC-Sierra (PMCS) for $2.5 billion after Skyworks Solutions (SWKS - Get Report) bowed out of negotiations for the semiconductor company. PMC-Sierra allegedly backed out of any merger after Skyworks did not modify its offer. Skyworks said it is is owed $88.5 million in termination fees from the nullified merger agreement. PMC-Sierra shares were down 1.6% on Tuesday.

Palo Alto Networks (PANW - Get Report) moved 6.9% higher after beating quarterly estimates. The security tech developer earned an adjusted 35 cents a share in its recent quarter, 3 cents above estimates. Billings, a measure of future sales, also exceeded estimates.

Brocade Communications (BRCD) tumbled 8% after it issued a disappointing outlook. The networking equipment developer expects first-quarter profit of between 23 cents and 25 cents a share. Analysts had expected earnings of 27 cents a share.