upstream commit c48462f6bb99bff75f04db65c276ab87827b295e