lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 10 Oct 2022 09:38:11 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Kees Cook <keescook@...omium.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Valentin Schneider <vschneid@...hat.com>,
        "Gustavo A . R . Silva" <gustavoars@...nel.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Tom Rix <trix@...hat.com>, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] sched: Introduce struct balance_callback to avoid CFI
 mismatches

On Fri, Oct 07, 2022 at 05:07:58PM -0700, Kees Cook wrote:
> Introduce distinct struct balance_callback instead of performing function
> pointer casting which will trip CFI. Avoids warnings as found by Clang's
> future -Wcast-function-type-strict option:
> 
> In file included from kernel/sched/core.c:84:
> kernel/sched/sched.h:1755:15: warning: cast from 'void (*)(struct rq *)' to 'void (*)(struct callback_head *)' converts to incompatible function type [-Wcast-function-type-strict]
>         head->func = (void (*)(struct callback_head *))func;
>                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> No binary differences result from this change.
> 
> This patch is a cleanup based on Brad Spengler/PaX Team's modifications
> to sched code in their last public patch of grsecurity/PaX based on my
> understanding of the code. Changes or omissions from the original code
> are mine and don't reflect the original grsecurity/PaX code.
> 
> Reported-by: Sami Tolvanen <samitolvanen@...gle.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1724
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Juri Lelli <juri.lelli@...hat.com>
> Cc: Vincent Guittot <vincent.guittot@...aro.org>
> Cc: Dietmar Eggemann <dietmar.eggemann@....com>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Ben Segall <bsegall@...gle.com>
> Cc: Mel Gorman <mgorman@...e.de>
> Cc: Daniel Bristot de Oliveira <bristot@...hat.com>
> Cc: Valentin Schneider <vschneid@...hat.com>
> Cc: Gustavo A. R. Silva <gustavoars@...nel.org>
> Signed-off-by: Kees Cook <keescook@...omium.org>
> ---
>  kernel/sched/core.c     | 24 ++++++++++++------------
>  kernel/sched/deadline.c |  4 ++--
>  kernel/sched/rt.c       |  4 ++--
>  kernel/sched/sched.h    | 14 ++++++++++----
>  4 files changed, 26 insertions(+), 20 deletions(-)

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ