SANTA CLARA -- Defensive lineman Justin Smith signed a two-year extension on Wednesday with the 49ers through the 2015 season for what he figures will be the final contract of his career.