Brought forward to commit c79762488bb97ec8cb786ecff81560e3409762f0 upstream