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 25FF7C4363A for ; Mon, 26 Oct 2020 16:47:21 +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 C6C32221FC for ; Mon, 26 Oct 2020 16:47:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Tqk5V3e9"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y8KcVDVH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6C32221FC 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=duWyerUu7IuqEKhMJijEjsoh7WBYgvqD5D71JJNqiIw=; b=Tqk5V3e9gdaE6h/K+p2GsvUUL epIUsrjaCkJV72nReSSP2H1+PZPef+CfmgPKu6OEuwuX9MXb/Fqu/SCqj8+kUaFVSlC+fZ8YvwvAe 42S5e6ZUy0n3Ql4QGu+kviz/RYcymxIM1Q8xajjplkyHhnEMVf6kp4u+wuOJS7JoW4RmGMrUAOVjD wGNcns0+ujPnnrQeMaord6fLDhDJl3xw4RBrRC6TCe7v2bihY/Mdk7Y6pbTZQ5ez0ETCsLQPKDrg3 CzjUJfJ3MH4KnkqC2TkcQuRG/owcLiyn5Hjnxm/XpCuxA1rgbG/3zI4f0dO2jfM+0OuJO+r9GWCGh O9F26lnQg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX5d7-00034Z-Uq; Mon, 26 Oct 2020 16:45:57 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX5d4-000341-SP for linux-arm-kernel@lists.infradead.org; Mon, 26 Oct 2020 16:45:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603730752; 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=EtQ7ATZf42jwj5zA9pcp/oVxiJsLAJssQKkbBhG+zyg=; b=Y8KcVDVHdPjNphloSdyxC/KHYw/a+S15t1XCiMCYqu3hi/TS6qOiQKncnUiIzDVs/8V+2p yPba/2eMoDv2fzGkjBPmaxWhjdixV6PnNpqe01fzxGDxc3QgutZ/GX3CEO9psDSqEoFsun KJLwK8ySke2Jt8bDPV+OjlHShL2k4GI= 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-437-N3pw_MRnMBKF2Of_PM6O7A-1; Mon, 26 Oct 2020 12:45:49 -0400 X-MC-Unique: N3pw_MRnMBKF2Of_PM6O7A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC861879526; Mon, 26 Oct 2020 16:45:46 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-114-87.ams2.redhat.com [10.36.114.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 495D65C1BB; Mon, 26 Oct 2020 16:45:44 +0000 (UTC) From: Florian Weimer To: Dave Martin via Libc-alpha Subject: Re: BTI interaction between seccomp filters in systemd and glibc mprotect calls, causing service failures References: <8584c14f-5c28-9d70-c054-7c78127d84ea@arm.com> <20201026162410.GB27285@arm.com> Date: Mon, 26 Oct 2020 17:45:42 +0100 In-Reply-To: <20201026162410.GB27285@arm.com> (Dave Martin via Libc-alpha's message of "Mon, 26 Oct 2020 16:24:11 +0000") Message-ID: <87r1pl9brd.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.16 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201026_124554_957017_BA0606B2 X-CRM114-Status: GOOD ( 13.69 ) 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 , systemd-devel@lists.freedesktop.org, Kees Cook , Catalin Marinas , Will Deacon , "linux-kernel@vger.kernel.org" , Jeremy Linton , Mark Brown , toiwoton@gmail.com, Dave Martin , "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 * Dave Martin via Libc-alpha: > Would it now help to add something like: > > int mchangeprot(void *addr, size_t len, int old_flags, int new_flags) > { > int ret = -EINVAL; > mmap_write_lock(current->mm); > if (all vmas in [addr .. addr + len) have > their mprotect flags set to old_flags) { > > ret = mprotect(addr, len, new_flags); > } > > mmap_write_unlock(current->mm); > return ret; > } I suggested something similar as well. Ideally, the interface would subsume pkey_mprotect, though, and have a separate flags argument from the protection flags. But then we run into argument list length limits. 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