upstream commit 0080d302566e57587c7b5bc09098a8eb657f9e03