Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp701276pxb; Tue, 5 Apr 2022 19:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUP8KowNp9/tQ8rE4m37nwwHiBWH9BcJseArXIOa1GyYhp2mqwvB5UIZUcZPL5QTqHi6Vn X-Received: by 2002:a17:906:7314:b0:6df:839f:af7 with SMTP id di20-20020a170906731400b006df839f0af7mr6221979ejc.65.1649211825254; Tue, 05 Apr 2022 19:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649211825; cv=none; d=google.com; s=arc-20160816; b=TZxLv9weYqM1mUlGTt7vMlnSa5cdu3AowNQC0nWC7lJMtH6zZCnGVt8pH6OJDzGrWa Yeku/ajmvHqlUIQ6/O3BMxmTJT9W6w/ZPZRHliru+vLs0BtiYvn+NZp3EoyGcsqcZECH MczdnF4D0oXf3cDQzxdWchprERzXEL0Ri9aYCh2uTytmvIijO4iUfHG3vjwsaEiDcrgv NmDPSuLMWH2bZKhSannmy4bcazRH2CbheUU8wI0BVfvTtidrmX0V9KoTwOdiWIBXAV0d /JcnIkf+gvM2t8ctBA/IMMJ894GPYt/3Ghfbl1PFrrpMRZIhyU3APNT1vuR+vd4godNF pU2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XTkkhWIriI+nObvDv47sG+GzuRxehSm21BXzN2I5o1Q=; b=LvSjg7BqB5yh+ENJkJ/E7nMnl56pDUtmrktSTPw6BJ1IYImZE+AS+wT+bIpYuO06r5 Am9hKklaKhAcMCMyNirOzXX0PrJoAqHHKfJkwwk2Lb06GRYyjpH5VFHvqvrnEu4Y7SuD vZWBG0R1lZY/QdIvzbxA9u+iUw8+zea9+uwevsnPhCZljpLGrZ1V77H7sk8nmjBAIO+X 4km+8/ouUCEPN4rShymaHdv2JXkw7ruMODOOsAEZj+GYETksTUgToep61myltsOjNUmx CMEl61o879jWvzjmuZ0PvfcTHbGKz2QEWLWc/Kf8LMvcX69jt7sFRyJkjFA+0ZkmBtvc bKFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Iis+WPex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w21-20020a056402269500b004190310aa85si10961397edd.131.2022.04.05.19.23.17; Tue, 05 Apr 2022 19:23:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Iis+WPex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352198AbiDELF7 (ORCPT + 99 others); Tue, 5 Apr 2022 07:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237572AbiDEImt (ORCPT ); Tue, 5 Apr 2022 04:42:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EC3816589; Tue, 5 Apr 2022 01:35:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B0592614E4; Tue, 5 Apr 2022 08:35:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C29BBC385A2; Tue, 5 Apr 2022 08:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147727; bh=U6NPccItde/lV+Aupb+80yWZKd2ruP1llhPD9xnH5U8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iis+WPexVF9uHGrR2yP/D5lzDJiyy6i8UogRFSqF6nAMqyElmknzQY7/SHoKMHFE3 QjzGcttQiveCoYaOPe4qZe0Ek+Bfp/y9uZqA1GF4eVgYH9NmNxFim9pERX0Cq2IGy7 TATV6H14Fjm2k6Vj8uPRmMOduB7ErFnaGyaZ0HJ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Vyukov , syzbot+0600986d88e2d4d7ebb8@syzkaller.appspotmail.com, Palmer Dabbelt Subject: [PATCH 5.16 0099/1017] riscv: Increase stack size under KASAN Date: Tue, 5 Apr 2022 09:16:52 +0200 Message-Id: <20220405070357.135672401@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Vyukov commit b81d591386c3a50b96dddcf663628ea0df0bf2b3 upstream. KASAN requires more stack space because of compiler instrumentation. Increase stack size as other arches do. Signed-off-by: Dmitry Vyukov Reported-by: syzbot+0600986d88e2d4d7ebb8@syzkaller.appspotmail.com Fixes: 8ad8b72721d0 ("riscv: Add KASAN support") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt Signed-off-by: Greg Kroah-Hartman --- arch/riscv/include/asm/thread_info.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/arch/riscv/include/asm/thread_info.h +++ b/arch/riscv/include/asm/thread_info.h @@ -11,11 +11,17 @@ #include #include +#ifdef CONFIG_KASAN +#define KASAN_STACK_ORDER 1 +#else +#define KASAN_STACK_ORDER 0 +#endif + /* thread information allocation */ #ifdef CONFIG_64BIT -#define THREAD_SIZE_ORDER (2) +#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER) #else -#define THREAD_SIZE_ORDER (1) +#define THREAD_SIZE_ORDER (1 + KASAN_STACK_ORDER) #endif #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)