Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp391752ybm; Thu, 28 May 2020 05:39:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJDPTpCRpj1gs4dIgZukEtd0FVkCypgSLkcnIXBZE8aV7WGGeESUaRALSVR9+meWKE5Gev X-Received: by 2002:aa7:d706:: with SMTP id t6mr3057895edq.210.1590669573613; Thu, 28 May 2020 05:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590669573; cv=none; d=google.com; s=arc-20160816; b=YP6mLwDVBX7xOxhnKhPkI/EnhRdFyi7JEJp7MyYoX2HIHUJhxthgkkdTfEJnI6+F3F ExxO1ZTS3bZu39X6w65F0E5eI2AkGObaYA0Jz+vEwJGqykDI/W0YMXLDL1pQvou01nNo iHWoNSScInESBDjpJ6XdT1ZIGJp2OuJc9IqE7Gsb8MT2wIgg9G2a9ebRQYHeKqq7M7xo B5cmEq1tFloTZV1gu33aa3ZQlBNDusuzT4IKGkcW4YvCy4wPrk4MIN26dD5CQIZleDhl IfXhZv6jLVuxYrPDNK+/XWvroDYZIr1o77ph9TJ0Eg24Mk7yKr51jbs3e0N+rMoe/wj7 iPLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GRwkxAXKadNb8L6vblVDH1YHL3lLq/VSX5Jl4TgNeUQ=; b=GaG0xS8rR8Tjv/xno//dAmyGBE5MqAH//T0sq1HTrUeeIQip5GJsV2yDArtWR6lMHe WjQh2gLty98RnV1zGD6jLmbCO/mKk7ql5CSNo8A+HKg/T/nJZTyPv1NTDAjCOg64O9Rb EDQX61zjyoVwmkqDI8GUEjQkKwHBICn5Efqc2f4vqFmRgVLMCLDhKkOEi2BLmxdwgT1w eguTAs2fQwkQrD185td9Xy6WaP965epevaekmIFczKAIq3ujC49A6L8SYQguNBzd1HOd 6zNoqJ6XwH0FnK2tUxSOo5RkDiIZXx0ylzk+dgeOMNez4MUpgJLUAWTaNRhkAVXZM5/7 y6ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aisp8qRE; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si3716421ejb.268.2020.05.28.05.39.10; Thu, 28 May 2020 05:39:33 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=aisp8qRE; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389811AbgE1Mgw (ORCPT + 99 others); Thu, 28 May 2020 08:36:52 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43488 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389734AbgE1Mgu (ORCPT ); Thu, 28 May 2020 08:36:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669408; 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=GRwkxAXKadNb8L6vblVDH1YHL3lLq/VSX5Jl4TgNeUQ=; b=aisp8qREGtJsTbhPQlr2s8xSZwp7hGPo1T28LgtDPb5QIxQIwcQYEhGT491TzHBOzU8x35 7GyoCgLjPa/s4OYmJIr9YVFm/gGS092UoYxLMP9CMMbp4VusWw3PvfHZqFpzVKkPtFunbI YQ5kzlTrzrE0soVaAApCl+ZX5hO0hKI= 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-485-EyyxwPu9Nla98fHg1KPQ8w-1; Thu, 28 May 2020 08:36:45 -0400 X-MC-Unique: EyyxwPu9Nla98fHg1KPQ8w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81F52108597B; Thu, 28 May 2020 12:36:43 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.7]) by smtp.corp.redhat.com (Postfix) with SMTP id A969F1001268; Thu, 28 May 2020 12:36:41 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 28 May 2020 14:36:43 +0200 (CEST) Date: Thu, 28 May 2020 14:36:40 +0200 From: Oleg Nesterov To: Greentime Hu Cc: guoren@linux.alibaba.com, vincent.chen@sifive.com, paul.walmsley@sifive.com, palmerdabbelt@google.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v5 01/13] ptrace: Use regset_size() for dynamic regset Message-ID: <20200528123639.GA19813@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/28, Greentime Hu wrote: > > --- a/kernel/ptrace.c > +++ b/kernel/ptrace.c > @@ -888,7 +888,7 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type, > > regset_no = regset - view->regsets; > kiov->iov_len = min(kiov->iov_len, > - (__kernel_size_t) (regset->n * regset->size)); > + (__kernel_size_t) regset_size(task, regset)); Acked-by: Oleg Nesterov