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=-16.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham 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 52BD0C433DF for ; Sat, 23 May 2020 09:12:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 10674207F9 for ; Sat, 23 May 2020 09:12:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rZRgirog" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10674207F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8649280008; Sat, 23 May 2020 05:12:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8140F80007; Sat, 23 May 2020 05:12:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 750CB80008; Sat, 23 May 2020 05:12:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 5A4D580007 for ; Sat, 23 May 2020 05:12:24 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 128272494 for ; Sat, 23 May 2020 09:12:24 +0000 (UTC) X-FDA: 76847417808.14.sheet20_14ea94a818c2a X-HE-Tag: sheet20_14ea94a818c2a X-Filterd-Recvd-Size: 4244 Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Sat, 23 May 2020 09:12:23 +0000 (UTC) Received: by mail-ot1-f66.google.com with SMTP id o13so10140631otl.5 for ; Sat, 23 May 2020 02:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BPw5LvQcTEsfBp2CGXcAmOXUYeI1dGSO14K+bI7ak8k=; b=rZRgirogsNM6nMDwMP/7OayllV+zJ98jynoE2/DjqysbNwfpa+z5jnCVPBRMKqDiu5 wK52NFsgx4nXLH+wIMlOFWdW+FetHnVbmLJRNVwoZ9LY1JC6sjWeAvHZvgAtMgvkIly3 70EXxxOfTT5ZLuFbviDWxbBsxinydqlIh6RiermYe+haGyTJB3CK+0FOzDJJj/KJWCkp IvDb6g0wChehZgfXCUiY1gKLemcsvJN2c1d04wBRgPvGcyw8UKcis6xEV91jCqESqZ5R VNyvU3e1NwClat8UrchcFYLmgFhkNIS2q5dZb6vn33w/8MNVLk+91mLnL6AEfP3K2IAF Kusg== 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=BPw5LvQcTEsfBp2CGXcAmOXUYeI1dGSO14K+bI7ak8k=; b=q7YM2cKiqPZCbMzYI8ybcoWM/BzivR2pzRXNdZLuly3zRnAggKuQHzCqADL+L/FMos /xM9f+aVo7pOYmzfvnJr1EhEzJWQtszr635xPldI40CEzFMI6cjVP5+SbqgtNVe0hcVH b+pQDwaKWlwa84BudCEbwAeDnHUfw9U6ICVX+CG+KkWp40ncL0BgdJ18vk+fAlL9M2YF h5k0cV0pfE8mm3P1z+5QSfaITy2NQ+Ee+7gRcTJX197EpmLnKmD9wyY+WQTvlAyoNwO5 Do14fDyKCjqN664kldoyci7jkqO/7731ZrxxTDFZgyg2lnKTQaKLgQWJOUYLzBAUeFlc cN9g== X-Gm-Message-State: AOAM532ors6tApXT1JaTfEl6gvLAc0jO2uvaDz7ybDDYwSI9QEbGY5C4 4LXxWmy5c3mvRcJoFdyLRNlgY9BmZ6zeZtK7AsBv1A== X-Google-Smtp-Source: ABdhPJxuByUH5C2Kz4iEiY8KgHki0c1PoQxwS7DwYqIeLQgYdrlAyVT8VA4YGKX1WHIfKjXem0nsktX3AnOMWBqFrVo= X-Received: by 2002:a9d:518a:: with SMTP id y10mr14870284otg.17.1590225142785; Sat, 23 May 2020 02:12:22 -0700 (PDT) MIME-Version: 1.0 References: <20200522075207.157349-1-elver@google.com> <20200522164247.4a88aed496f0feb458d8bca0@linux-foundation.org> In-Reply-To: <20200522164247.4a88aed496f0feb458d8bca0@linux-foundation.org> From: Marco Elver Date: Sat, 23 May 2020 11:12:09 +0200 Message-ID: Subject: Re: [PATCH v2] kasan: Disable branch tracing for core runtime To: Andrew Morton Cc: Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov , LKML , kasan-dev , Andrey Ryabinin , Linux Memory Management List , Qian Cai , kernel test robot Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, 23 May 2020 at 01:42, Andrew Morton wrote: > > On Fri, 22 May 2020 09:52:07 +0200 Marco Elver wrote: > > > During early boot, while KASAN is not yet initialized, it is possible to > > enter reporting code-path and end up in kasan_report(). While > > uninitialized, the branch there prevents generating any reports, > > however, under certain circumstances when branches are being traced > > (TRACE_BRANCH_PROFILING), we may recurse deep enough to cause kernel > > reboots without warning. > > > > To prevent similar issues in future, we should disable branch tracing > > for the core runtime. > > > > Link: https://lore.kernel.org/lkml/20200517011732.GE24705@shao2-debian/ > > Reported-by: kernel test robot > > Signed-off-by: Marco Elver > > I assume this affects 5.6 and perhaps earlier kernels? > > I also assume that a cc:stable is appropriate for this fix? Yes, it does. On the other hand, the workaround is simple enough (disable any kind of branch profiling). Note, the patch won't cleanly apply to 5.6 and early without this: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a16c09edc58982d56c49ab577fdcdf830fbc3a5 Thanks, -- Marco