public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alex Sadovsky <nable.maininbox@googlemail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v7] Add support for stack-protector
Date: Thu, 14 Jan 2021 17:59:52 +0300	[thread overview]
Message-ID: <7afd867f-4f45-ec68-404e-cda72add4b56@googlemail.com> (raw)
In-Reply-To: <20210114135918.141419-1-joel.peshkin@broadcom.com>

Dear Joel,

> Add support for stack protector for UBOOT, SPL, and TPL
> as well as new pytest for stackprotector
>
> Signed-off-by: Joel Peshkin <joel.peshkin@broadcom.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
>
> Changes for v7:
>??? - Fix commit message
>??? - add __builtin_extract_return_addr() calls
> Changes for v6:
>??? - Fix commit message
> Changes for v5:
>??? - Rebase
> Changes for v4:
>??? - Exclude EFI from stackprotector
>??? - Cleanups of extra includes and declaration
> Changes for v3:
>??? - Move test command to cmd/
>??? - Update Kconfig names and depends
>??? - clean up default canary initialization
> Changes for v2:
>??? - Add test command and corresponding config
>??? - Fixed incorrect description in Kconfig
>??? - Add unit test
> ---
> ---

Patch changelog is not a part of commit message, it's placed below the '---' mark. I hope this guide will help you:
https://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

> [...]
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +unsigned long __stack_chk_guard = (long)(0xfeedf00ddeadbeef & ~0L);

'long' and 'unsigned long' are slightly different types. I suggest you the following form (please, note the UL instead of L):

unsigned long __stack_chk_guard = (unsigned long)(0xfeedf00ddeadbeef & ~0UL)

Else gcc will complain like this:

> warning: unsigned conversion from ?long int? to ?long long unsigned int? changes value from ?-1? to ?18446744073709551615? [-Wsign-conversion]
> unsigned long __stack_chk_guard = (long)(0xfeedf00ddeadbeef & ~0L);
> warning: unsigned conversion from ?long int? to ?long unsigned int? changes value from ?-559038737? to ?3735928559? [-Wsign-conversion]

I hope you'll find -Wconversion compiler flag useful, it's one of the flags that often help me to spot some corner cases with potential bugs. IMHO it should be enabled by default.

  reply	other threads:[~2021-01-14 14:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-10 15:39 [PATCH] Add support for stack-protector Joel Peshkin
2021-01-10 16:18 ` Heinrich Schuchardt
2021-01-10 19:44   ` Joel Peshkin
2021-01-10 22:20     ` Heinrich Schuchardt
2021-01-10 22:40 ` Alex Sadovsky
2021-01-11  0:23   ` Joel Peshkin
2021-01-11  3:10 ` [PATCH v2] " Joel Peshkin
2021-01-11  9:59   ` Heinrich Schuchardt
2021-01-11 16:20 ` [PATCH v3] " Joel Peshkin
2021-01-11 18:12   ` Heinrich Schuchardt
2021-01-11 22:49 ` [PATCH v4] " Joel Peshkin
2021-01-12 15:48   ` Heinrich Schuchardt
2021-01-11 23:55 ` [PATCH v5] " Joel Peshkin
2021-01-12 16:51 ` [PATCH v6] " Joel Peshkin
2021-01-12 20:01   ` Heinrich Schuchardt
2021-01-14 13:59 ` [PATCH v7] " Joel Peshkin
2021-01-14 14:59   ` Alex Sadovsky [this message]
2021-01-14 20:35 ` [PATCH v8] " Joel Peshkin
2021-01-15 18:53   ` Heinrich Schuchardt
2021-01-28  0:57   ` Tom Rini
2021-01-28  8:20     ` Heinrich Schuchardt
2021-01-28 11:00       ` Heinrich Schuchardt
2021-01-28 14:33         ` Heinrich Schuchardt
2021-02-09  3:36 ` [PATCH v9] " Joel Peshkin
     [not found]   ` <794783f5-da5c-65b4-82a4-0f62d1f6a8b0@gmx.de>
2021-02-09 20:39     ` Heinrich Schuchardt
2021-03-22 17:37   ` Heinrich Schuchardt
2021-04-09 22:27     ` Joel Peshkin
2021-04-10 10:11       ` Heinrich Schuchardt
2021-04-10 11:17         ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7afd867f-4f45-ec68-404e-cda72add4b56@googlemail.com \
    --to=nable.maininbox@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox