Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1947535rwl; Sun, 26 Mar 2023 12:21:50 -0700 (PDT) X-Google-Smtp-Source: AK7set/Zty0cSMOUtUEzpF1Y1M78qpZc6FCuThNTJ3ggNw9Fv9n/1rzMjI4tok0J3n4SP1GN+ZNb X-Received: by 2002:a05:6a20:7da6:b0:da:d4eb:9e07 with SMTP id v38-20020a056a207da600b000dad4eb9e07mr9728297pzj.30.1679858510002; Sun, 26 Mar 2023 12:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679858509; cv=none; d=google.com; s=arc-20160816; b=HLnhFRnYRJMNNU0GE2NExPfDbLujcnAY6JqsKqmGnIPkGcS3PKlUCKJACZMC7irXCH ymUeLt/zz18Rkgt7r337DhJ4swwwW9l4G5P+YTgRg1ZvqykR/yeIF2QwS2f1EI9VpNsU haa3oVv/sX/+xx0jGC1bUOYPcHGzyW8WcgOJdzCy9yVw/dYz/ubB0W4TtH3LkbLCTJQ9 26Iz2geGteQ6v5UR8Gnx3hfQffAGHTbeh4TEEdDKMOzgKXGmSErjs9OMv01/NVVvFUOV 2uopDPaLbvWJZm14RZrEt3/L5q5RrdfbG6ivgOflRQ4brDCpA6C+my8+PHUV0RIDMFjM /j+Q== 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:subject :references:in-reply-to:message-id:cc:to:from:dkim-signature:date; bh=IPj/8OLqvqRQ+lEtwXmv1w2gCjxoYulj0dH4FXY72C0=; b=eBp/IvAtGwI5sFDjWM6CWIxZ/xcoUf3FMhJoKd/FdXAQDxWZcEh6zWooVcj/7xmkFZ DOo/1bv0ko7FPLTgQA1CWZ6W42M2L1bWLJM75+5rrYPgn0EwYH7QKj4Q9Mj5GCzS/fAk xeh34unBGpprLIhttqH0Jbrj7Hv2rHeSrn7WDAfIcfqJyEoIWRC4V6iSnw5QmOlWePEx 8Zq5s9kfhLIIryLZ8/XXBEVkLyqQRF4/Or8ErEN+/afhouISUPJV0pF8ShY7XN72R55J XF6Ac8v3EDUWEYImQvEBQWm2I7W6Af5RUeU4G1dSKtNnJ8aEqFCQwV6xJj4Bu76Tdaan k7ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=nCXrPh3c; 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 g4-20020a636b04000000b00513456968edsi2816336pgc.850.2023.03.26.12.21.38; Sun, 26 Mar 2023 12:21:49 -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=@t-8ch.de header.s=mail header.b=nCXrPh3c; 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 S231425AbjCZSnN (ORCPT + 99 others); Sun, 26 Mar 2023 14:43:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjCZSnM (ORCPT ); Sun, 26 Mar 2023 14:43:12 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E12296A42 for ; Sun, 26 Mar 2023 11:42:53 -0700 (PDT) Date: Sun, 26 Mar 2023 13:42:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1679856171; bh=IPj/8OLqvqRQ+lEtwXmv1w2gCjxoYulj0dH4FXY72C0=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=nCXrPh3csxykwCAPxhzyCeeSU2sHquZJzj+dL1PSmFpJmRRPYvOVWvHksk97CayOt iUdUDdcbqzQ/caCrKIhkXnEayC3mlKYke9sUQidxEwkXwKiZRFK1tgYeb0IN0qkyiD 9zNSIdELThEQdnm/J3z8PLu+7XXzAk+/ZITsTkYk= From: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh_?= To: Alexey Dobriyan Cc: Willy Tarreau , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , "Paul E. McKenney" , linux-kernel@vger.kernel.org Message-ID: <8e156377-e7d9-48ec-a7ee-292aba002201@t-8ch.de> In-Reply-To: <89a960c7-0c9b-43ab-9fc8-a68405f7ed6a@p183> References: <89a960c7-0c9b-43ab-9fc8-a68405f7ed6a@p183> Subject: Re: [PATCH 6/8] tools/nolibc: tests: add test for -fstack-protector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <8e156377-e7d9-48ec-a7ee-292aba002201@t-8ch.de> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Mar 26, 2023 13:30:21 Alexey Dobriyan : > Willy Tarreau wrote: >> #if defined(__clang__) >> __attribute__((optnone)) >> #elif defined(__GNUC__) >> __attribute__((optimize("O0"))) >> #endif >> static int smash_stack(void) >> { >> =C2=A0=C2=A0=C2=A0 char buf[100]; >> >> =C2=A0=C2=A0=C2=A0 for (size_t i =3D 0; i < 200; i++) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 buf[i] =3D 'P'; >> >> =C2=A0=C2=A0=C2=A0 return 1; >> } > > If you want to corrupt the stack, corrupt the stack! I do! > asm( > ".globl f\n" > "f:\n" > "movq $0, (%rsp)\n" > "ret\n" > ".type f,@function\n" > ".size f,.-f" > ); > > No problems with optimisation levels. Wouldn't this be architecture-specific?