Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6847642rwr; Tue, 25 Apr 2023 04:55:16 -0700 (PDT) X-Google-Smtp-Source: AKy350YZ2uIhP1qjj+Bkuuts8far8sSw+ZrRIg3TW/+5oVReUJgk9b5cX/2lC8Cb/wmKWrPJTOwS X-Received: by 2002:a05:6a00:230b:b0:63b:8778:99e4 with SMTP id h11-20020a056a00230b00b0063b877899e4mr24900582pfh.2.1682423716172; Tue, 25 Apr 2023 04:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682423716; cv=none; d=google.com; s=arc-20160816; b=PDDqYoDPz4S1gQtbRzfODVdDcozQ6wXMYs9WZB+U/30ix2LZehFkZQjz9zRErnXUsf 0F52fK4G6YlUBoBkwmQuHUtrF8O2eJpmdKczLKbGeTJCw2APDzdGM8JKEbrfgye3zN5t Q883YV0pGn8wZoc8kMpERci8j5IQ7JfkQECpZQTDMIFkNfTsuoaK0n2cQ+OiPpZFQ8AA Kw+JpJM8K9R4YjbGh18J1uclEUNowMCH3I9fUGUnAiItW66/G/qOXlJUN06aPslvcoaa liOIBci1/t/sRhqWTFPP2c+a8JW9SFlnHU4CIOH7m2DhF+hGTLWMUNI6jXzP9JYyAPOn ykyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RuyX3d7D1azwsn4TOGYEeBa8zDHbPol4DtyJcZjYy1w=; b=jG1MydVz977LmrKwpG3B78E+9X6+MVEMnC/JvzPkMfn8J6z0nFvshIGSmOU++w0AGA EgTmKaWtkjnQ1QoplVV6/W0V78cspwXONU1XH4d5DwAeOSex5U1HveXBR55N3O0FoNVd 5HRxaz59TfVhi9hcxvxDOgUfFpFc5Z1JILcNoypNOE1A7tUkXGraYc3csXa7p4/dsEMA XYum5v9bxntUc6G0f3+AiyDZbsaxzxqril+t1+XG4n869sthSRnW/ZypSieIb9imrOKs ZVyzaUpnRONeHF/6gM/5tJnFnBYZfdPkMT9lNi+icqChna2p346NkdZnbRB4hr+rKNsX +LQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YLzLX23g; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a6566c5000000b0051b4140f6cbsi13432959pgw.149.2023.04.25.04.55.02; Tue, 25 Apr 2023 04:55:16 -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=@infradead.org header.s=casper.20170209 header.b=YLzLX23g; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233857AbjDYLxy (ORCPT + 99 others); Tue, 25 Apr 2023 07:53:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233685AbjDYLxw (ORCPT ); Tue, 25 Apr 2023 07:53:52 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B742D13F8D; Tue, 25 Apr 2023 04:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RuyX3d7D1azwsn4TOGYEeBa8zDHbPol4DtyJcZjYy1w=; b=YLzLX23gAqE/afcAhQhX/CCgMI c94ZoDFe8oTJK2JSS/FuFGg8KUS5MYESVL9zKBUuFX7pze6a+rQ5PaTvvIeSr87dHaWiZmxJTRf4k ZnYkaXPe9I8mpJ6ZFo6m4WPVvHZUc9bpUolM4kAQW5pfuUzoAT4BSZcvoCfBYgEp055GC/jb8VTv8 yBrlzwI/q0hZhcGAjBwsIg3GQ6498b4k6et/MqH9pyecJ+1MLldg1AIA1Viioh+zJ+jpg94WqSC4Y zTgteBn+91FFU6o2Y2N8N4q4l0FvCaHhNqzrDnQH+jP5wtpEGUOET5GiAols0niV9kFXp6T89bCa6 n7YxfyQQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1prHER-001PFv-P0; Tue, 25 Apr 2023 11:53:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 968D5300380; Tue, 25 Apr 2023 13:53:13 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7990C241943F2; Tue, 25 Apr 2023 13:53:13 +0200 (CEST) Date: Tue, 25 Apr 2023 13:53:13 +0200 From: Peter Zijlstra To: Joel Fernandes Cc: Boqun Feng , Segher Boessenkool , Michael Ellerman , Zhouyi Zhou , linuxppc-dev , rcu , linux-kernel , lance@osuosl.org, "Paul E. McKenney" Subject: Re: BUG : PowerPC RCU: torture test failed with __stack_chk_fail Message-ID: <20230425115313.GD1335080@hirez.programming.kicks-ass.net> References: <87fs8pzalj.fsf@mail.concordia> <20230424151351.GP19790@gate.crashing.org> <20230425101324.GD1331236@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Tue, Apr 25, 2023 at 06:59:29AM -0400, Joel Fernandes wrote: > > I'm a little confused; the way I understand the whole stack protector > > thing to work is that we push a canary on the stack at call and on > > return check it is still valid. Since in general tasks randomly migrate, > > the per-cpu validation canary should be the same on all CPUs. > AFAICS, the canary is randomly chosen both in the kernel [1]. This Yes, at boot, once. But thereafter it should be the same for all CPUs. > also appears to be the case in glibc. That makes sense because you > don't want the canary to be something that the attacker can easily > predict and store on the stack to bypass buffer overflow attacks: > > [1] kernel : > /* > * Initialize the stackprotector canary value. > * > * NOTE: this must only be called from functions that never return, > * and it must always be inlined. > */ > static __always_inline void boot_init_stack_canary(void) > { > unsigned long canary = get_random_canary(); > > current->stack_canary = canary; > #ifdef CONFIG_PPC64 > get_paca()->canary = canary; > #endif > } > > thanks, > > - Joel