Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1475509pxu; Fri, 16 Oct 2020 12:59:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjL1Fi+LtzkLkZPkkGS+Wkcz6FbahPp58qTS1qlmHr3JJdqrwYlsVb/i6hQP9NFXBf8Wtk X-Received: by 2002:a05:6402:13da:: with SMTP id a26mr5698471edx.291.1602878396100; Fri, 16 Oct 2020 12:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602878396; cv=none; d=google.com; s=arc-20160816; b=XOSecnKuust6Nd8v2PuA8sI+A79dhO+DzE2OxgZnl2J4kKlhmOL07utVnxUh6iqjp3 Ebcla3HmZ9RwpADdQPmtfxWAbjZQPYYPyhaYizVVDFjyNE3JHYeWChmCNS0Xz1Oj292s bqJ7OYjK8RpSvcvZh+AOr29QKt7sD1NUq84qjebulKR27jMFPC/NeLP/tp6jMu7D0Ng2 9uh+8mqSW/oN3xvyXcrrkVd6hHuukI17OTmCAWtxItKbiZqmVSdRRzOsEQPxng+jPzVp 9YyVOB8d2kwtBzxdva/+tZESgnVHBlXovOdFy2VBfZ8fJI/HVByWD/ajULBjSvuk1poC Xplw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=D5NngvCZlpVByT++f7qE91SLdHEnOV1NRAu0YOMS/Lo=; b=i/DNUbRv4jv8fKW540w5tGJMaSyE/cFki0LTgNuXNUTO5bd1AvY6Z25eZ+59CCyDly w1/36yKSjDxsj/37xyj2axsgPfwCMHicCdJ+cb9PxdQXLbFx+XBsCXTHd51I4mBrledQ 9NH8Rirgz7L6xiiMV9HQtD2am/CiXlbFFVzmfFI99OmUuEVMLBkFkQPcO6B4Zphv30ly UercbvIc2uz+jSG1YvMlBWSE0SEo6kPdTTomodkWGMCDWgMExLevyAJw5Iid2VlKU36F U7Op1ZBMcK6I6wvyacwwC4Hpo8NgZlP5qoj0NnIkxiQHDlxQkwVqYuQ5qsKoL2j2T9sA bENQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=tfke49wM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si2875426ejj.512.2020.10.16.12.59.33; Fri, 16 Oct 2020 12:59:56 -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=@atishpatra.org header.s=google header.b=tfke49wM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391634AbgJPSY2 (ORCPT + 99 others); Fri, 16 Oct 2020 14:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391390AbgJPSY2 (ORCPT ); Fri, 16 Oct 2020 14:24:28 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B805C061755 for ; Fri, 16 Oct 2020 11:24:28 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id q9so5038593iow.6 for ; Fri, 16 Oct 2020 11:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D5NngvCZlpVByT++f7qE91SLdHEnOV1NRAu0YOMS/Lo=; b=tfke49wMmVeEHZ47+rOE8ezeTppkX/1ALYR5HM/MCTLUJU9PtwVpKQm+5LKx1H5t/A Z1S0sAV3EEiyUj8D4lhzFhbkIdluNTU3MSW1j3yUhcXDhmGfD6Pt8yGXs5WX5/rFoeRL LPyZYHdK4082r/fSC2bXOL/TjzC+EK8fnWigQ= 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=D5NngvCZlpVByT++f7qE91SLdHEnOV1NRAu0YOMS/Lo=; b=Jh9a9zXkQKyn97mJdKwmD/OzYjGF62ocuI7BRTEo4ivzijFaAu4ReLkSPGcTVMNAa2 +smOSY71kBtf5svg/qcwgQbVSsIxs5/aqKLL08FUGeu3A9Lr/qhBvhrYb1sCXc30KzAW PWWbNWYiymuIP/mW0IC/Aix6Zv2WmOdoi14zxO2TvFjrp848pEXBhDVBpCsxpztLDQJn pRNMluZGqGo9XqNwTv97PmBJHVL82wToXrS/3ZlXXoUqykrzfrF96/1VNWn4FOojvlpv CUbHplP9gkPrv+TVucXd2rBGTbj2QmKeQTCqVUHH3Fx7Ouwzxtnz5lxzUawY5JmS+GW8 VQVA== X-Gm-Message-State: AOAM530Zdht7TWzldKN7JnBs9hk8+IX8QbwpeyC/7nfX61b/ZHPbds92 aGJxFflRLZ8RFipLm18sbjtuFyov9CXXJD+jeUNf X-Received: by 2002:a02:6952:: with SMTP id e79mr3738592jac.24.1602872667636; Fri, 16 Oct 2020 11:24:27 -0700 (PDT) MIME-Version: 1.0 References: <20201009211344.2358688-1-atish.patra@wdc.com> <20201009211344.2358688-5-atish.patra@wdc.com> In-Reply-To: From: Atish Patra Date: Fri, 16 Oct 2020 11:24:16 -0700 Message-ID: Subject: Re: [PATCH 4/5] RISC-V: Protect .init.text & .init.data To: Jim Wilson Cc: Greentime Hu , Kito Cheng , Palmer Dabbelt , Atish Patra , Albert Ou , Kees Cook , Anup Patel , Linux Kernel Mailing List , linux-riscv , Guo Ren , Zong Li , Paul Walmsley , Andrew Morton , Borislav Petkov , Michel Lespinasse , Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 13, 2020 at 10:24 PM Atish Patra wrote: > > On Tue, Oct 13, 2020 at 6:21 PM Jim Wilson wrote: > > > > On Tue, Oct 13, 2020 at 3:25 PM Atish Patra wrote: > > > This happens only when copy_from_user is called from function that is > > > annotated with __init. > > > Adding Kito & Jim for their input > > > > > > @kito, @Jim: Please let me know if I should create a issue in > > > riscv-gnu-toolchain repo or somewhere else. > > > > I can't do anything useful without a testcase that I can use to > > reproduce the problem. The interactions here are complex, so pointing > > at lines of code or kernel config options doesn't give me any useful > > info. > > > > Relaxation can convert calls to a jal. I don't know of any open bugs > > in this area that can generate relocation errors. if it is a > > relaxation error then turning off relaxation should work around the > > problem as you suggested. > > > > A kernel build problem is serious. I think this is worth a bug > > report. FSF binutils or riscv-gnu-toolchain is fine. > > > > I have created an issue with detailed descriptions and reproduction steps. > Please let me know if you need anything else. > It may be a toolchain issue. Here is the ongoing discussion in case anybody else is interested. https://github.com/riscv/riscv-gnu-toolchain/issues/738 > > Jim > > > > -- > Regards, > Atish -- Regards, Atish