From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90EE5C433DB for ; Sat, 27 Mar 2021 00:39:37 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 37DEB61A10 for ; Sat, 27 Mar 2021 00:39:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37DEB61A10 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=k1ZO3d83VXMQx2g4BeJLsBrIiC9qZT5BDEnI9dV9Qkg=; b=G6QvlmLtlJ4o/+FP4ZgUMJt2F /Vg7cJXNPH50GT8aZDdhinhUw01pYnd4IaeSFw10+Fr0wqe2Hn+HqJUvSp9TVbhmDzxkZWN54k3PA xv/1FPBq6h7kJbb7yl4WM7oabyQrEpqo8EKGNmopAfQWYJ2ZSDj6rspx0ORcEegVlBmQmTRdj2kGn cbAmyzor1XtSINr52Gy0bL3d0Xf3HqS5FlRzaBQS4bwHtQD4svf1yPvQXHBGObYIoXeg+iMyHF/gY AR0tbXtOC8514hQTKvywlE2y0NpeH9KRhPkGPFv+yFroKbEc4ju7KOrO8HsDgtN43SAdvm2W/U9Ra EVMdiS9wg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPwxf-004Zaj-In; Sat, 27 Mar 2021 00:37:55 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPwxb-004Za7-Cw for linux-arm-kernel@lists.infradead.org; Sat, 27 Mar 2021 00:37:53 +0000 Received: by mail-ot1-x333.google.com with SMTP id g8-20020a9d6c480000b02901b65ca2432cso6874968otq.3 for ; Fri, 26 Mar 2021 17:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BI+iabPhrvYtDPz3qHAsKBtGQ2YVcLK/4lCP31o5TUE=; b=Fow2FqH+CBY1R2373Haa2XixmsXYU30WR4Xkavgn5oA+01i5YYiMB0K5FcaP/x01CX W1gzSNdvRJQtrcUY1/g0+AxVFzPSS+fw7yhe7i/MQpnJVSdh8Q9krd9w/YwlWQFmyl+m 88mNxE4MjkqkhdtziGSJ29G3sWjPPy5ra5Mpn5FcSJYmsWTdC6nM2VcO/OZWc57Ks4lI FLibRiOGKARmyFNpKNbrKr/SkjxmOzGEKhamJSqQQtFDqN5ws7frrLJ2jYDZ1m+8Sb2v lfFC8HOdC9tAIR5Xs356hbjXFO40w2AnrLxPQQS57AUCI90AKfKWXxmwY9SRRAaN/KAT nbog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BI+iabPhrvYtDPz3qHAsKBtGQ2YVcLK/4lCP31o5TUE=; b=L7jo6skw/dbv7fG26gcgJP1jeYcbliLSXx5BV1G7rz/+gonj82s2zxlXOpysYyebSP OjWniicDwC7R6ERiMDOJindFa+i0iXXc3AApt/scS4GP1jiouh74vPIjhiM8J6FJoVYF jnFAZ8JGOtzzoMy4Zvhhh7LFYgwxPhmiU/uS0S+AN0aWuFL0cTAL7WvP//KTV8PTpd/p ds3SjOjZ2PvweIM5nYu0sb6YOpDq5wjXbpf652xEUxs7m2qBFp+fKeNEikPhNj8wHqv5 ckhc3652xr6mB22f6fc9mDVbQwyQh53IP93fyg/c0OH9U2U5vKipbaDgTXbl+EVDab0P NUwQ== X-Gm-Message-State: AOAM530RAWMO5E/M/aobFCtPCpcPJ4X+DCoJS+OtO/TgJvt3q2QgNWYJ Ep+5uWY3lteaJR6yf28QfSGBJqjEv+J+VJ/OM90= X-Google-Smtp-Source: ABdhPJycnq4cn23xX+kgLjQoby8h0XdATQJ85Z39SlztjCXr+bui55nWR1KSF860JDUv9vE391Ix3Bw4ofDbVcV240g= X-Received: by 2002:a05:6830:1542:: with SMTP id l2mr12808241otp.95.1616805468507; Fri, 26 Mar 2021 17:37:48 -0700 (PDT) MIME-Version: 1.0 References: <20210322225053.428615-1-avagin@gmail.com> <20210322225053.428615-2-avagin@gmail.com> <20210326182839.GE5126@arm.com> In-Reply-To: <20210326182839.GE5126@arm.com> From: Andrei Vagin Date: Fri, 26 Mar 2021 17:35:19 -0700 Message-ID: Subject: Re: [PATCH 1/4] arm64: expose orig_x0 in the user_pt_regs structure To: Catalin Marinas Cc: Will Deacon , Oleg Nesterov , linux-arm-kernel@lists.infradead.org, LKML , Dave Martin , Keno Fischer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210327_003751_607270_C99B9B46 X-CRM114-Status: GOOD ( 13.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 26, 2021 at 11:28 AM Catalin Marinas wrote: > > On Mon, Mar 22, 2021 at 03:50:50PM -0700, Andrei Vagin wrote: > > diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h > > index 758ae984ff97..3c118c5b0893 100644 > > --- a/arch/arm64/include/uapi/asm/ptrace.h > > +++ b/arch/arm64/include/uapi/asm/ptrace.h > > @@ -90,6 +90,7 @@ struct user_pt_regs { > > __u64 sp; > > __u64 pc; > > __u64 pstate; > > + __u64 orig_x0; > > }; > > That's a UAPI change, likely to go wrong. For example, a > ptrace(PTRACE_GETREGSET, pid, REGSET_GPR, data) would write past the end > of an old struct user_pt_regs in the debugger. ptrace(PTRACE_GETREGSET, ...) receives iovec: ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &iov) iov contains a pointer to a buffer and its size and the kernel fills only the part that fits the buffer. I think this interface was invented to allow extending structures without breaking backward compatibility. > > -- > Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel