upstream commit 1682505419cd419f4d593dd8be92ffe4fef40aa9