Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1165198imm; Thu, 4 Oct 2018 09:08:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV63UHWMKFILhkCyHPkpwcNMi7X6PHGRcF1D4L7VZy+cme8P0RSkHGDOPVNA2W/cVlEjG08NR X-Received: by 2002:a63:8a41:: with SMTP id y62-v6mr6265580pgd.420.1538669314808; Thu, 04 Oct 2018 09:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538669314; cv=none; d=google.com; s=arc-20160816; b=Jqzxq1oT0p+UeaJiMkYtW1Mg3LZCBBeJMQRNnsdTICZVgB8q0v8dj2iWK2lZgIE2qP gid/8K5exe3Q9vDGhvtd4HCj9jSGVO3oR9uisB5MaqqvChc6e0JJKjunooRWR4gLqB9G i3tVgipzbfk2hLyHEdVAmhC+IVE1gBMSe61/FYQUkJRZoUSvWv+OjxEEfPvrJFzcZd7Q lJecY0SIsbQoBk/QicXsIR/YLBA6ekXqnl0VYfWPa6UpJadfbTasSzHS1zGuNNrL1FW9 JSJ7yAgcMqFY9swgebF/kZO6fSnU0fHazIb/8N4B56RAJpXv82uy2KUUkrS6KHmnAsQM ZgNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to:date :references:subject:cc:to:from; bh=YDOu8KG5VpMlwrmlh832XmAmkRT/IkeelyKd1HbP770=; b=tZp7frM51xOI1H4reLYaC5N5OsoHmOf54FvVaXzmXNAF0Iw8naNkA6IZ2tP4zi3KuD zMSsf8xyBOhL5gK4LwOgHW81UV2liHtaWs/Q4KrIIfS98nNgnKp2Im9d8cGCasNJl+Qq DbUk4wqMFvnqRgtqrYVrEKFnUEFEhQtafI95ZCb1uD9gIOKvrSdk0E4IZcrTSs6Tt0u3 +z+xrSqjNqXomkH1MvQlTi8Do1XPliUs0T90solut5XDa1YABGjSnfqll/mEOjd1DkA+ ZfbFS2Pg6+yyxX0cE5zovK+CDb6qnjtuhHE1uQkZLzKN0z/xZndb0Knuhn1QLK/SWE8S HlSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z29-v6si4991647pfl.209.2018.10.04.09.08.18; Thu, 04 Oct 2018 09:08:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727629AbeJDXCC (ORCPT + 99 others); Thu, 4 Oct 2018 19:02:02 -0400 Received: from albireo.enyo.de ([5.158.152.32]:36710 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727407AbeJDXCC (ORCPT ); Thu, 4 Oct 2018 19:02:02 -0400 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1g86AF-0000Oz-7r; Thu, 04 Oct 2018 16:07:47 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.89) (envelope-from ) id 1g86AF-0004ms-0u; Thu, 04 Oct 2018 18:07:47 +0200 From: Florian Weimer To: Yu-cheng Yu Cc: Eugene Syromiatnikov , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , libc-alpha@sourceware.org, carlos@redhat.com Subject: Re: [RFC PATCH v4 6/9] x86/cet/ibt: Add arch_prctl functions for IBT References: <20180921150553.21016-1-yu-cheng.yu@intel.com> <20180921150553.21016-7-yu-cheng.yu@intel.com> <20181004132811.GJ32759@asgard.redhat.com> <3350f7b42b32f3f7a1963a9c9c526210c24f7b05.camel@intel.com> Date: Thu, 04 Oct 2018 18:07:47 +0200 In-Reply-To: <3350f7b42b32f3f7a1963a9c9c526210c24f7b05.camel@intel.com> (Yu-cheng Yu's message of "Thu, 04 Oct 2018 08:37:16 -0700") Message-ID: <87murtn19o.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Yu-cheng Yu: > On Thu, 2018-10-04 at 15:28 +0200, Eugene Syromiatnikov wrote: >> On Fri, Sep 21, 2018 at 08:05:50AM -0700, Yu-cheng Yu wrote: >> > Update ARCH_CET_STATUS and ARCH_CET_DISABLE to include Indirect >> > Branch Tracking features. >> > >> > Introduce: >> > >> > arch_prctl(ARCH_CET_LEGACY_BITMAP, unsigned long *addr) >> > Enable the Indirect Branch Tracking legacy code bitmap. >> > >> > The parameter 'addr' is a pointer to a user buffer. >> > On returning to the caller, the kernel fills the following: >> > >> > *addr = IBT bitmap base address >> > *(addr + 1) = IBT bitmap size >> >> Again, some structure with a size field would be better from >> UAPI/extensibility standpoint. >> >> One additional point: "size" in the structure from kernel should have >> structure size expected by kernel, and at least providing there "0" from >> user space shouldn't lead to failure (in fact, it is possible to provide >> structure size back to userspace even if buffer is too small, along >> with error). > > This has been in GLIBC v2.28. We cannot change it anymore. In theory, you could, if you change the ARCH_CET_LEGACY_BITMAP constant, so that glibc will not use the different arch_prctl operation. We could backport the change into the glibc 2.28 dynamic linker, so that existing binaries will start using CET again. Then only statically linked binaries will be impacted. It's definitely not ideal, but it's doable if the interface is terminally broken or otherwise unacceptable. But to me it looks like this threshold isn't reached here.