Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp328368pxu; Wed, 14 Oct 2020 02:22:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY7ru5qQR0HHi9fExebuGVgejS6gTPlb0Jhmt5w08lEgQXmPbz08NazUQsbCfReG9jfGe3 X-Received: by 2002:a17:907:435e:: with SMTP id oc22mr4479307ejb.485.1602667376972; Wed, 14 Oct 2020 02:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602667376; cv=none; d=google.com; s=arc-20160816; b=aEa7Bg1LaIGPyPk5SAAlJtmKjhQRewpv6tGLD52hfSp51xw0R9dZgltiTtA7T82XMe 0/f8sXpJUzsjZiJIkdQEO8Zv2bD/VKtvj7u0yl3rZ4YeFpTMqfV51ouWQf2Cs4kY+AUM +catELT8yo680SV0gPl8l2M/xy8MHiiECFstcC7YMZWAb6eHU5rCZxUSCO9bp7H/kCQp v4ZDPXDzWe6DQP0RgFuxmy9COgsTtB62o691x/EJg+SmSQHTBstd2xQI4lk4Ht0AuqY3 uwJZfLvr/HJil5Eg/eDwN91bHfs48uGIbXy7pV/bHUk71AFFYKtmZo3k5q4vukxEp1AY p10A== 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=HalJUEgFIroij+eVjjsAaxpPGCzHis17qTK2euMmLBY=; b=kr2uIY+128dxBphvoC4Q71DCNahcbs2Gq/IwOec80cCWSYba8yhc67mwphFCbBDazz xrGp6BEWDF8Q+ru5ytHE3IirEvNt3Vwcz7O/7/wB4dEcToTq2AiBHtelF+QQjZIo039r HyT9hcdGzO+aWNunFKathiWCqWNq9D/Ezcrqbx6NAZaYMJISd3MpiI5Aq2glp2rz1KVW JCwJw0Q48Afj97loWtgueSqBLOVrGMmwY1UAdfMK1IoicXqpzCTrGY222i9vbdvoPlGD aiT7L9qNcGU3rArC+15P4msIs3PN9CuDP7HriHefviW0sVkfqhdaDzaAtiEKZr63qzIu inBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=Yf93tejX; 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 q19si1884333ejj.410.2020.10.14.02.22.34; Wed, 14 Oct 2020 02:22: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=Yf93tejX; 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 S1728098AbgJNJEg (ORCPT + 99 others); Wed, 14 Oct 2020 05:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgJNJEg (ORCPT ); Wed, 14 Oct 2020 05:04:36 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E610BC045859 for ; Tue, 13 Oct 2020 22:25:01 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id l16so3697977ilt.13 for ; Tue, 13 Oct 2020 22:25:01 -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=HalJUEgFIroij+eVjjsAaxpPGCzHis17qTK2euMmLBY=; b=Yf93tejX2acPPVAbX3fnj9NQ+N4grno48CwAjUD2YEfuAK8dXqW7uVhkBgvOXsaRng 2oWEHB+FYe0fJogNf8rlXPfWs4AjufA9G4rrbELfmtk0hPm0XX7c3DWLOXiNiBZYLlpT lv4ka4i0CCQSHRxSKjbcQeKWaxNbAdvUceJBE= 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=HalJUEgFIroij+eVjjsAaxpPGCzHis17qTK2euMmLBY=; b=VGdDSVggqD0L3TcNUuE4BMOlTolpebVbJTdDZIe+glRb6rc5Jzajpsh4OGpX5GTAga lmI7eq8BBLcvusXAavhRuEFPDUw1xBrrh8Oz3kADdsXZIVWOoHHZRrKxqsuccYJemgz9 mbGn7qmPRxocNRcUN5vAszmnqmFUCldTMsAAy+K9RYN3lp/fV7+T9t5tPKpNpZIx6clL 5Z890QpUw+uYyOePYnRw6Ws9fNPw92wuEOtV1DtnUcPzkY9hBcNnKcMtNC3EneWUViJT VgYyOMKj5e0GioYrWbCMWs+zm5CiYnl34CIaNrbfRgnOCNM/k2/RQnS2KZwUeo0Lav8m fgtw== X-Gm-Message-State: AOAM531PHkhaw9V/QNChLnxCgF/Xg49WeNTerKRRxzqY6AxviMyp3AF4 boDn+WY020MWK8d1UWo+PBvHvv5IIRfIJG9jia2x X-Received: by 2002:a92:91db:: with SMTP id e88mr2506931ill.126.1602653100856; Tue, 13 Oct 2020 22:25:00 -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: Tue, 13 Oct 2020 22:24:49 -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 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. > Jim -- Regards, Atish