Terms were not disclosed for Gash, who returns to Buffalo after playing the last three seasons with the Baltimore Ravens.
Gash, 34, spent two Pro Bowl seasons with the Bills before signing with Baltimore in 2000 and helping the Ravens win a Super Bowl title.
Gash gives the Bills one of the NFL's best blocking fullbacks. They had lacked that the last two seasons with pass-catching fullback Larry Centers, who was released last month.
Gash has been one of the league's top blocking backs for much of his career, and will compete with third-year man Phillip Crosby for the starting fullback job. Both are pure blocking backs who will try to make holes for the Bills' third-year runner, Travis Henry.
An 11-year veteran, Gash played 11 games for the Ravens last season without a carry or a reception. He has rushed 120 times for 324 yards and two touchdowns while adding 158 catches for 1,264 yards and 13 touchdowns in 93 NFL games.
The move to Buffalo reunites Gash with quarterback Drew Bledsoe, a teammate in New England from 1993-97. Gash caught Bledsoe's first career completion in a game at Buffalo in 1993.