Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4704780imm; Mon, 11 Jun 2018 17:48:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKzoHR2mEasmz9wJT9/rW+wcREfunUKnAfbc5m4OGzcxoknpLJfzyfPuLRhWnRkaQDY9+Qt X-Received: by 2002:a63:63c4:: with SMTP id x187-v6mr1202832pgb.9.1528764536839; Mon, 11 Jun 2018 17:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528764536; cv=none; d=google.com; s=arc-20160816; b=v7BVuyR/8HMOMbGtu+QAGc6Q87QENImdUa884uU4cd4Ht1Hbu28Ho0ViJHmSxrBTTK adwYeu7O4zYwytMuoNK03fT00B7OXb+zjCGV4SIFGArxY3rMoshcdA3qaPaxrnf3OoYO OGSKhb0junvj7STZH9kSF7IECyD/7KSL/ITYJiyIEV5S2WjaV1pWX733u8+PfYNekFk8 lbvJHDUAX0/86XKsoq/n5954PRfb4YNmjCeSLZMuG96b1clNuLrrx02J2wy/S0EVvtow FFyIUcINDqQR7SCbdq5K/HjoE0U+JJnslpV5UnpvqrcUbRfhyvkh58lZUpBV35BCEsd5 ALIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature :arc-authentication-results; bh=SW/0hFasrCYKNRGHyDR1MhXB96TLPQ8coLgT8ffY3yo=; b=rvr/rqhGYnurKkuvEqEaeI6H13/m3phN3QD6CJTY49B+/4GoJfn6Hbt2e0cNfvy6RY Oym4jJNIVk9s1N6RZ2m9sSTpZ6QxLYJ0OlrIKTfJ5FDWK2RILqUzlYK6ysj4mPDW6Y9i Ns+KomsfsssCUpJ8Ov4TH1lfQf9HRWJcurL6+eP4BIeUKMpeOhFxHVqDxOcVcU1RRKRi agnIlcusdKDqfzOOXbKbJ+unqWD7FUX9g2js9IwEXP9CF0G58YmBDenRsswENAaTj+1Q GO7YlXt1n94CcGBBAfeEGng/VKWa6MpsKiVtCycC3iQ7lP4/XM/4RTbkf46jxCCuKli1 ydHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=bMIvT8wu; 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 s136-v6si17264567pgc.291.2018.06.11.17.48.41; Mon, 11 Jun 2018 17:48:56 -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; dkim=pass header.i=@sifive.com header.s=google header.b=bMIvT8wu; 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 S934840AbeFLAqb (ORCPT + 99 others); Mon, 11 Jun 2018 20:46:31 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:40678 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934446AbeFLAq3 (ORCPT ); Mon, 11 Jun 2018 20:46:29 -0400 Received: by mail-pf0-f196.google.com with SMTP id z24-v6so11135533pfe.7 for ; Mon, 11 Jun 2018 17:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=SW/0hFasrCYKNRGHyDR1MhXB96TLPQ8coLgT8ffY3yo=; b=bMIvT8wudNgwohK8PcysUqxmUDfKNpFOlSslzhzZgXsDI07MEDNr6V1On5qKJOtf4k WfJ5tDaUJoIVTFozPwpfhDWuCHbKSHtjIs9wqm0tlbVn4nTe9QNMixyhLq1IuruHw/Vy waTRmLjkdW+PQ4q1RIgcbEyEISGZqcMCrNg0LkS1pCUwBYYCf2Ce7HJ6fBX+NJiCX/xA smHFLHiIrb8FfiiX9ajhCJeg0Epl4Sj6smV1iYMGAmOCPhk4WZPQewlL8fU8mJq3HxXp s+73BFS+fd9icuV4TPpHg0W4xfkbJhZPVF9weCMEQF1fRnfXf0v+WvC1RBXOqwi0rj65 m0eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=SW/0hFasrCYKNRGHyDR1MhXB96TLPQ8coLgT8ffY3yo=; b=ZBq/dGOeferG/OjEMG2+4FWDteGZAW2/hJxXLuAEgsljPp8jXjdpuweJGO4mpu1aY3 HRPSC3gPQ1tFpYKbLOkGBIcLgtzjYIDChTarIslLs10oBcYOqe2kkH3nFe/O8JysFO98 t7/ox+4S9rtuuHmHGw+/vhJTaieq0ctTbLRsufj//prBfr1PAXhA+WxmvH4ZZDHnEtpG 4/bSetpRZmUGcTP5xSFjXlsanGpeWO6rwrJZvQrB91Qxrg7qej2PE0mFlEr+hptbGklg q3Z1SuVOI9zs0g3/Fv/tB7BznNz3T4tPysfHhfayFt5ce+TMHa51G+x2kaz/Oc8q0YwR MTFQ== X-Gm-Message-State: APt69E16YRXmkNaUQ3+u9+/0tY6N4mXXjHzaQ2YS9zEnk5ObvKrVjf7Z EaTAbooeIrDplUB8f67ECWXnOg== X-Received: by 2002:a63:9543:: with SMTP id t3-v6mr1158399pgn.77.1528764389404; Mon, 11 Jun 2018 17:46:29 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id b3-v6sm112540336pff.132.2018.06.11.17.46.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 17:46:28 -0700 (PDT) Date: Mon, 11 Jun 2018 17:46:28 -0700 (PDT) X-Google-Original-Date: Mon, 11 Jun 2018 17:38:26 PDT (-0700) Subject: Re: [PATCH] RISC-V: Fix PTRACE_SETREGSET bug. In-Reply-To: <20180611214822.8539-1-jimw@sifive.com> CC: linux-riscv@lists.infradead.org, Jim Wilson , oleg@redhat.com, albert@sifive.com, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: Jim Wilson Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Jun 2018 14:48:22 PDT (-0700), Jim Wilson wrote: > In riscv_gpr_set, pass regs instead of ®s to user_regset_copyin to fix > gdb segfault. > > Signed-off-by: Jim Wilson > --- > arch/riscv/kernel/ptrace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c > index ba3e80712797..9f82a7e34c64 100644 > --- a/arch/riscv/kernel/ptrace.c > +++ b/arch/riscv/kernel/ptrace.c > @@ -50,7 +50,7 @@ static int riscv_gpr_set(struct task_struct *target, > struct pt_regs *regs; > > regs = task_pt_regs(target); > - ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, ®s, 0, -1); > + ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs, 0, -1); > return ret; > } Whoops, that's embarassing :). I poked around and didn't see this anywhere else, so I'm not sure where we managed to obtain this particular pathology. Thanks for the patch!