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  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:   Tue, 5 Oct 2021 23:09:08 +0200 (CEST)
From:   Jan Engelhardt <>
To:     Steven Rostedt <>
cc:     Mathieu Desnoyers <>,
        Rasmus Villemoes <>,
        linux-kernel <>,
        Linus Torvalds <>,
        Paul <>,
        Josh Triplett <>,
        Lai Jiangshan <>,
        "Joel Fernandes, Google" <>,
        Pablo Neira Ayuso <>,
        Jozsef Kadlecsik <>,
        Florian Westphal <>,
        "David S. Miller" <>,
        Hideaki YOSHIFUJI <>,
        David Ahern <>,
        Jakub Kicinski <>, rcu <>,
        netfilter-devel <>,
        coreteam <>,
        netdev <>
Subject: Re: [RFC][PATCH] rcu: Use typeof(p) instead of typeof(*p) *

On Tuesday 2021-10-05 22:37, Steven Rostedt wrote:
>Really, thinking about abstraction, I don't believe there's anything wrong
>with returning a pointer of one type, and then typecasting it to a pointer
>of another type. Is there? As long as whoever uses the returned type does
>nothing with it.

subsection "Pointer conversion"
"No other guarantees are offered"

>struct trace_pid_list *trace_pid_list_alloc(void)
>	struct pid_list *pid_list;
>	pid_list = kmalloc(sizeof(*pid_list), GFP_KERNEL);
>	[..]
>	return (struct trace_pid_list *)pid_list;

struct trace_pid_list { void *pid_list; };
struct trace_pid_list trace_pid_list_alloc(void)
	struct trace_pid_list t;
	t.pid_list = kmalloc(sizeof(t.orig), GFP_KERNEL);
	return t;
void freethat(struct strace_pid_list x)

Might run afoul of -Waggregate-return in C.

Powered by blists - more mailing lists