From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D640BC388F9 for ; Wed, 4 Nov 2020 14:46:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77C182074B for ; Wed, 4 Nov 2020 14:45:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FuehmNZc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730261AbgKDOp6 (ORCPT ); Wed, 4 Nov 2020 09:45:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39219 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730243AbgKDOp5 (ORCPT ); Wed, 4 Nov 2020 09:45:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604501156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2/qDMVtos7dYdtcZu5rNmBGlotvjjozf9G0PRDDGQXs=; b=FuehmNZcdrcy7rGZnQ6XxJIDWzKhga0wN8DWf9q9lAn5+h7YMqS/iRfTkVcDYtLce2bqEv rpV8BHUYd8xNdGdP48JbZTM5DM6puvHJbrMDqYBiiEC5BY4k19KWWdwDQlVcWqmpb8BpPz Cs/+yMIC2jWRjTSFP4fauRvai2JRQJE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-202-jgwp6zJgNeGan1kW1fiemg-1; Wed, 04 Nov 2020 09:45:52 -0500 X-MC-Unique: jgwp6zJgNeGan1kW1fiemg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D1931084C80; Wed, 4 Nov 2020 14:45:50 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-113-12.ams2.redhat.com [10.36.113.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3E125B4D8; Wed, 4 Nov 2020 14:45:45 +0000 (UTC) From: Florian Weimer To: Catalin Marinas Cc: Szabolcs Nagy , Jeremy Linton , Mark Brown , libc-alpha@sourceware.org, Mark Rutland , Will Deacon , Kees Cook , Salvatore Mesoraca , Lennart Poettering , Topi Miettinen , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com, linux-hardening@vger.kernel.org Subject: Re: [PATCH 0/4] aarch64: avoid mprotect(PROT_BTI|PROT_EXEC) [BZ #26831] References: <20201103173438.GD5545@sirena.org.uk> <8c99cc8e-41af-d066-b786-53ac13c2af8a@arm.com> <20201104085704.GB24704@arm.com> <20201104144120.GD28902@gaia> Date: Wed, 04 Nov 2020 15:45:44 +0100 In-Reply-To: <20201104144120.GD28902@gaia> (Catalin Marinas's message of "Wed, 4 Nov 2020 14:41:21 +0000") Message-ID: <87ft5p2naf.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Catalin Marinas: > Can the dynamic loader mmap() the main exe again while munmap'ing the > original one? (sorry if it was already discussed) No, we don't have a descriptor for that. /proc may not be mounted, and using the path stored there has a race condition anyway. Thanks, Florian -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16040C2D0A3 for ; Wed, 4 Nov 2020 14:47:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D06A20704 for ; Wed, 4 Nov 2020 14:47:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Zv2jAicR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FuehmNZc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D06A20704 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0AbABVoe08MRlin/OmnuYu7w1tAXxnEFRJ46lkyfKhg=; b=Zv2jAicRdEAD//vOGwSJwQUYw zVjFIqz2dAtC8Ka56FoQy2EfiBkpkqhZNOsUQp/M1EoZhElpk9aWSvoQNukWoOkGhh2YiHcFSVAFk BQHOZG34g5lZcMLMZoBHXoSUd5vj/iIlq1HzUwPmSxcQOa1TFUoPOL9K/Iu2Z9xeVjVcItk5N79IQ HmfhPLXpEHI/9aekrjZ6hsMFCYhxtVJI1Wc74eM+A7CfUdPubGgdJCPHH7Y8fjwFNa8l5usaUrsgb FMQJk+Al204aeWs6sEKsbAZFk55f21YCDMpekC3cpLzGitIRlWGjgriofV5h5visvoOFaC4jJlJe/ K+ufWEe9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaK2z-0005sN-F2; Wed, 04 Nov 2020 14:46:01 +0000 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaK2v-0005rF-Ju for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 14:45:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604501156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2/qDMVtos7dYdtcZu5rNmBGlotvjjozf9G0PRDDGQXs=; b=FuehmNZcdrcy7rGZnQ6XxJIDWzKhga0wN8DWf9q9lAn5+h7YMqS/iRfTkVcDYtLce2bqEv rpV8BHUYd8xNdGdP48JbZTM5DM6puvHJbrMDqYBiiEC5BY4k19KWWdwDQlVcWqmpb8BpPz Cs/+yMIC2jWRjTSFP4fauRvai2JRQJE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-202-jgwp6zJgNeGan1kW1fiemg-1; Wed, 04 Nov 2020 09:45:52 -0500 X-MC-Unique: jgwp6zJgNeGan1kW1fiemg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D1931084C80; Wed, 4 Nov 2020 14:45:50 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-113-12.ams2.redhat.com [10.36.113.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3E125B4D8; Wed, 4 Nov 2020 14:45:45 +0000 (UTC) From: Florian Weimer To: Catalin Marinas Subject: Re: [PATCH 0/4] aarch64: avoid mprotect(PROT_BTI|PROT_EXEC) [BZ #26831] References: <20201103173438.GD5545@sirena.org.uk> <8c99cc8e-41af-d066-b786-53ac13c2af8a@arm.com> <20201104085704.GB24704@arm.com> <20201104144120.GD28902@gaia> Date: Wed, 04 Nov 2020 15:45:44 +0100 In-Reply-To: <20201104144120.GD28902@gaia> (Catalin Marinas's message of "Wed, 4 Nov 2020 14:41:21 +0000") Message-ID: <87ft5p2naf.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_094557_756475_D1318E23 X-CRM114-Status: GOOD ( 11.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Salvatore Mesoraca , libc-alpha@sourceware.org, Kees Cook , kernel-hardening@lists.openwall.com, Szabolcs Nagy , linux-kernel@vger.kernel.org, Jeremy Linton , Mark Brown , Lennart Poettering , linux-hardening@vger.kernel.org, Topi Miettinen , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org * Catalin Marinas: > Can the dynamic loader mmap() the main exe again while munmap'ing the > original one? (sorry if it was already discussed) No, we don't have a descriptor for that. /proc may not be mounted, and using the path stored there has a race condition anyway. Thanks, Florian -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27B12C4741F for ; Wed, 4 Nov 2020 14:46:17 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id E49792074B for ; Wed, 4 Nov 2020 14:46:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FuehmNZc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E49792074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-20357-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 3460 invoked by uid 550); 4 Nov 2020 14:46:08 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 3436 invoked from network); 4 Nov 2020 14:46:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604501156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2/qDMVtos7dYdtcZu5rNmBGlotvjjozf9G0PRDDGQXs=; b=FuehmNZcdrcy7rGZnQ6XxJIDWzKhga0wN8DWf9q9lAn5+h7YMqS/iRfTkVcDYtLce2bqEv rpV8BHUYd8xNdGdP48JbZTM5DM6puvHJbrMDqYBiiEC5BY4k19KWWdwDQlVcWqmpb8BpPz Cs/+yMIC2jWRjTSFP4fauRvai2JRQJE= X-MC-Unique: jgwp6zJgNeGan1kW1fiemg-1 From: Florian Weimer To: Catalin Marinas Cc: Szabolcs Nagy , Jeremy Linton , Mark Brown , libc-alpha@sourceware.org, Mark Rutland , Will Deacon , Kees Cook , Salvatore Mesoraca , Lennart Poettering , Topi Miettinen , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com, linux-hardening@vger.kernel.org Subject: Re: [PATCH 0/4] aarch64: avoid mprotect(PROT_BTI|PROT_EXEC) [BZ #26831] References: <20201103173438.GD5545@sirena.org.uk> <8c99cc8e-41af-d066-b786-53ac13c2af8a@arm.com> <20201104085704.GB24704@arm.com> <20201104144120.GD28902@gaia> Date: Wed, 04 Nov 2020 15:45:44 +0100 In-Reply-To: <20201104144120.GD28902@gaia> (Catalin Marinas's message of "Wed, 4 Nov 2020 14:41:21 +0000") Message-ID: <87ft5p2naf.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 * Catalin Marinas: > Can the dynamic loader mmap() the main exe again while munmap'ing the > original one? (sorry if it was already discussed) No, we don't have a descriptor for that. /proc may not be mounted, and using the path stored there has a race condition anyway. Thanks, Florian -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill