upstream commit f37d96e4ac87143e5d6355fad23636153b8cb2e7