From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752809AbdJPNo5 (ORCPT ); Mon, 16 Oct 2017 09:44:57 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:52655 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752196AbdJPNoz (ORCPT ); Mon, 16 Oct 2017 09:44:55 -0400 X-Google-Smtp-Source: ABhQp+Ss0WjZwE6YHZniYwfYEJpWdLOmWMkbqgJmDA7YosP6Rww1O17doPLe03soP6Cd2uMmJWi2xA== From: Michal Hocko To: LKML Cc: Linus Torvalds , Kees Cook , Jiri Kosina , Al Viro , Oleg Nesterov , Ingo Molnar , Baoquan He Subject: [PATCH 0/2] fs, elf: get rid of MAP_FIXED from the loader Date: Mon, 16 Oct 2017 15:44:44 +0200 Message-Id: <20171016134446.19910-1-mhocko@kernel.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171004075059.bbx7madwgwflb7ky@dhcp22.suse.cz> References: <20171004075059.bbx7madwgwflb7ky@dhcp22.suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, the previous discussion didn't really show any hard requirement for MAP_FIXED usage for the elf segments mapping. I have spent some more time studying the code (thanks to Qualys for their insight) and concluded that the current MAP_FIXED usage is rather fragile and not really needed. The first patch replaces it by a hint mmaping and failing rather than silently corrupt an existing memory and the second patch removes MAP_FIXED for the initial segment mapping because this shouldn't be really needed either, I would even call it wrong. Anyway, more details are in the changelog of patches. I will really appreciate any feedback. This has passed some testing with PIE/PIC binaries running in the loop without any negative side effects detected.