upstream commit 5f1b9100dd340125ebc8a96a8781d4497ea006f6