upstream commit 1db68b5da75330e4d21fa10b8271c0f463d605d2