Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1165945pxb; Fri, 21 Jan 2022 11:15:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTW8pcBnfjuXSag0KQQj2BDri3V/gfmdNy3BlyqdTmviJbbenPitYU1BEKh4l2sQCoxnNm X-Received: by 2002:a05:6a00:1512:b0:4c0:efb0:1152 with SMTP id q18-20020a056a00151200b004c0efb01152mr5147670pfu.47.1642792508519; Fri, 21 Jan 2022 11:15:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642792508; cv=none; d=google.com; s=arc-20160816; b=ZrP4jMRmBkz1Uuk+WDG1QsSwZAzTyY7BhJRrNb5e9FyM6KDdfWZP2n2w7PIaNVuPyS rPr+bgL+ckg38lzU85PVW3gRSpZYWOQC+A7hFinSCezfjpPdkeLpvHJ+NDvd8dRf/iMW fjdG/Pw07Rq4dKcCRzEnEGg6WhCyYqigUh7trWcDHw8Xykc5iRBobnlHQ0/T7VtNLi/F EdTcxVIiUqNbXgQ8vRLuwXzNRD/2a1Bi4MMoDaHfGk69WXXM+QVav/r3CPFpqVZw+cWL XYrQ/hXnclcuBiMS+v6nYGCCNecQ07n7T4nkWzrYmcly3JMW94MXTMn4Y46dN9PbsmdF Q2vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xdixTif3MT1ekKmqX1EMbwwvOCdQ8mq9DE0bMZxOR84=; b=ZoPemtRguXPUVrNcquY4jTa+yhHT0/hDTfrPlet52amIbeWgWmXQ8ULAHEKquMj1R1 WQhMab8+C0P5i3A9o6sQ+mSP3dvWa1WoE3q3CxLGC8GeQ+tIA6cRiawfCPr+SEClQx9/ kbv4CvlkZQD/Kk06wXKOf0P80dD6PTov54zsPVGqVugJvKcP1EMOtLK+2qHKysKHC6d+ MUyyTpzTH2asoDWYod2pPuR4i+qtkhaBlAT28uT+HDujuaL6PZKWfDtAWagvRA6dheVk TvvHtrtJnpSngol/QKaZDjqpgweYz9DqpbIRneoIEAgmgwwoVINhzKCHV4bDS5IiHa9F kkPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="D/ViA2p2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si7878529plg.225.2022.01.21.11.14.56; Fri, 21 Jan 2022 11:15:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="D/ViA2p2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350702AbiASNUT (ORCPT + 99 others); Wed, 19 Jan 2022 08:20:19 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51928 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237573AbiASNUR (ORCPT ); Wed, 19 Jan 2022 08:20:17 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20JConFE022601; Wed, 19 Jan 2022 13:20:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=xdixTif3MT1ekKmqX1EMbwwvOCdQ8mq9DE0bMZxOR84=; b=D/ViA2p2hsaJT5k9VqbY+OzWe0ct1e5blKlCyGDHt/g55YOY1A3JyE2yVERb7nosnOQd 9pigkom5J9w8BbE+h32yHFfot3hSiXkB0FP5Um82t2tZzC64LxjepN35k/cYmFyqGLwr ia2BdaieyLDJLJpRknju8KthnGVPVIgPWbW3+SgAoLqHC0ChUjGMAh/sv2wQ4EoHcThQ ykQBa6WYwxRpDQ059ot/EtcsDwdS9gJF+3nvmtHWoM8KuaBKWB/cYnXWi1VJE/knJUXS owAw4ThEsR38Fw8/0aeINd9yehLJemylxnHx5aF9MT/UUsYmow6QTbNmfLXq4Q8OnjYO vg== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dpgfm42bk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jan 2022 13:20:17 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20JDHkAI006367; Wed, 19 Jan 2022 13:20:14 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 3dknhjp1gx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jan 2022 13:20:14 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20JDKB9937683570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Jan 2022 13:20:11 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41E00A4054; Wed, 19 Jan 2022 13:20:11 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5084A4068; Wed, 19 Jan 2022 13:20:10 +0000 (GMT) Received: from osiris (unknown [9.145.70.139]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 19 Jan 2022 13:20:10 +0000 (GMT) Date: Wed, 19 Jan 2022 14:20:09 +0100 From: Heiko Carstens To: Janis Schoetterl-Glausch Cc: Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Nico Boehr , Alexander Gordeev , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v1 01/10] s390/uaccess: Add storage key checked access to user memory Message-ID: References: <20220118095210.1651483-1-scgl@linux.ibm.com> <20220118095210.1651483-2-scgl@linux.ibm.com> <422595a5-b24b-8760-ff0e-112322142de7@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <422595a5-b24b-8760-ff0e-112322142de7@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -pzLhij0uyAo65HlgYuiB8NEGEO6kTm- X-Proofpoint-GUID: -pzLhij0uyAo65HlgYuiB8NEGEO6kTm- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-19_07,2022-01-19_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 impostorscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 mlxlogscore=336 spamscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201190075 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 12:02:34PM +0100, Janis Schoetterl-Glausch wrote: > > That's a lot of code churn... I would have expected that the existing > > functions will be renamed, get an additional key parameter, and the > > current API is implemented by defines which map copy_to_user() & > > friends to the new functions, and add a zero key. > > I don't think I understand you. I can implement raw_copy_from/to_user > in terms of raw_copy_from/to_user_with_key, which does save a few lines, > but that's it, isn't it? Right you are. I only looked at your patch, and forgot about that all the wrapping is nowadays done in common code. So what I really don't like about this approach is that we get an arch specific copy_to_user() implementation back. This means that all those extra calls like might_fault(), instrument_copy_to_user(), and friends now have to be kept in sync by us again, if new instrumentation or security options are added to common code. Given that this is manual work / monitoring I'm sure this will not work in the mid or long term, like it has been proven several times in the past for other features. We need something better, which works out-of-the-box wrt common code changes / enhancements.