The 49ers signed All-Pro defensive lineman Justin Smith to a two-year contract extension through the 2015 season, the 49ers announced Wednesday.