Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5127590yba; Wed, 10 Apr 2019 11:58:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmmql2ZN8ho+V0L+vPq+Sx3FBWTrIIQnCONtih7E7kkRFdEZ2gsbmOq8FJenPcX19q0HU3 X-Received: by 2002:a65:5342:: with SMTP id w2mr20546777pgr.220.1554922730082; Wed, 10 Apr 2019 11:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554922730; cv=none; d=google.com; s=arc-20160816; b=Vb5LTbCQ4jTCcgLmm8xj34xi6rh0TCyw8ADT9Wrd1L7QW0SrmT8XPDE0fmuTOoK69N w7eejBiR/ceS7tDRRqILZ6ZiSvlKLqkdnUguYeaS6h85ntG0PZvpBXJrdcx2nFRAWDmf VGkLpIt+x8u2O5kz4aErP1HM3p+wM7TSrd/L5Y4tUvKnbXRfsEMXNfGruR0sfe2l9t1U mKmV7QsY4eq77jzM27EV1jTIFghN5baVBSC/BKXU1EkRaVasoQTzrpwd9zZ2ogPIDL8y IqlCUuorZzk4zLzNzV82j8sCZaN3b38hcp5Hhcu+HZuMqs/pH6xDmfYjBsJAkS8ZXQgq HN4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:subject:cc:to:from:date; bh=3dA6iBtUFRPyand655f2F1hbF7/Syg7a00+h1Tep0Ow=; b=e96mEdzt6tlVU4fwnFDyJ8Sdzvzk0fZI+8u+gerLirJFOqtdgd/6znR4x4Q3qukNwX OJkJdwh6SI6EKSYkCsR+hu4uT+qXeVxS6o7IErPWjLSAPA4PQaBVBg13nSkZ+SwHFjNN AuoRy4fsztsOIYHNZHwCSjKWrKXkgKcqf5DBn26x3nR5uqx0LIP2wIKqBspTVB3ks4EV RI4ozduMlUktVixfAbIgXeDibKACzYvTv8bODCHZCI4tLjDV1Y6VGzYhk85bpmYhuGmL JSRPPL2k1nwN0K1vOvkk4B2I57KA9lEZi3jHDMy7kDq4X//D7mp4DOlkN0n+XeSn9jzm Q3EA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si22521360pfn.171.2019.04.10.11.58.34; Wed, 10 Apr 2019 11:58:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729404AbfDJPwx (ORCPT + 99 others); Wed, 10 Apr 2019 11:52:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34544 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727340AbfDJPww (ORCPT ); Wed, 10 Apr 2019 11:52:52 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3AFowHF032713 for ; Wed, 10 Apr 2019 11:52:51 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rsjd3m1cj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Apr 2019 11:52:50 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Apr 2019 16:52:49 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 10 Apr 2019 16:52:45 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3AFqiro59572270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Apr 2019 15:52:44 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B7B574204C; Wed, 10 Apr 2019 15:52:44 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F76642042; Wed, 10 Apr 2019 15:52:44 +0000 (GMT) Received: from mschwideX1 (unknown [9.152.212.148]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 10 Apr 2019 15:52:44 +0000 (GMT) Date: Wed, 10 Apr 2019 17:52:43 +0200 From: Martin Schwidefsky To: Mathieu Desnoyers Cc: heiko carstens , gor , libc-alpha , linux-kernel , carlos Subject: Re: rseq/s390: choosing code signature In-Reply-To: <514609006.3159.1554911439933.JavaMail.zimbra@efficios.com> References: <1779981820.2626.1554838342731.JavaMail.zimbra@efficios.com> <20190410123258.37f182cf@mschwideX1> <514609006.3159.1554911439933.JavaMail.zimbra@efficios.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19041015-0008-0000-0000-000002D8649E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041015-0009-0000-0000-00002244893B Message-Id: <20190410175243.6fc3d16a@mschwideX1> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-10_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904100110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Apr 2019 11:50:39 -0400 (EDT) Mathieu Desnoyers wrote: > ----- On Apr 10, 2019, at 6:32 AM, schwidefsky schwidefsky@de.ibm.com wrote: > > > On Tue, 9 Apr 2019 15:32:22 -0400 (EDT) > > Mathieu Desnoyers wrote: > > > >> Hi, > >> > >> We are about to include the code signature required prior to restartable > >> sequences abort handlers into glibc, which will make this ABI choice final. > >> We need architecture maintainer input on that signature value. > >> > >> That code signature is placed before each abort handler, so the kernel can > >> validate that it is indeed jumping to an abort handler (and not some > >> arbitrary attacker-chosen code). The signature is never executed. > >> > >> The current discussion thread on the glibc mailing list leads us towards > >> using a trap with uncommon immediate operand, which simplifies integration > >> with disassemblers, emulators, makes it easier to debug if the control > >> flow gets redirected there by mistake, and is nicer for some architecture's > >> speculative execution. > >> > >> We can have different signatures for each sub-architecture, as long as they > >> don't have to co-exist within the same process. We can special-case with > >> #ifdef for each sub-architecture and endianness if need be. If the architecture > >> has instruction set extensions that can co-exist with the architecture > >> instruction set within the same process, we need to take into account to which > >> instruction the chosen signature value would map (and possibly decide if we > >> need to extend rseq to support many signatures). > >> > >> Here is an example of rseq signature definition template: > >> > >> /* > >> * TODO: document trap instruction objdump output on each sub-architecture > >> * instruction sets, as well as instruction set extensions. > >> */ > >> #define RSEQ_SIG 0x######## > >> > >> Ideally we'd need a patch on top of the Linux kernel > >> tools/testing/selftests/rseq/rseq-s390.h file that updates > >> the signature value, so I can then pick it up for the glibc > >> patchset. > > > > The trap4 instruction is a suitable one. The patch would look like this > > Great! I'm picking it up into my rseq tree if that's OK with you. Just added the patch to s390/linux:features for the next merge window as well. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.