upstream commit 79acaf6152ef384f05fe2ec90134a6b02348e41d