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]
Message-ID: <20190313210840.GB4786@kernel.org>
Date:   Wed, 13 Mar 2019 18:08:40 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Song Liu <songliubraving@...com>
Cc:     bpf@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
        kernel-team@...com, peterz@...radead.org, acme@...hat.com,
        jolsa@...nel.org, namhyung@...nel.org, sdf@...ichev.me
Subject: Re: [PATCH v9 perf,bpf 04/15] perf, bpf: synthesize bpf events with
 bpf_program__get_prog_info_linear()

Em Wed, Mar 13, 2019 at 06:00:30PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Mar 11, 2019 at 10:30:40PM -0700, Song Liu escreveu:
> > -
> >  	/* Synthesize PERF_RECORD_KSYMBOL */
> >  	for (i = 0; i < sub_prog_cnt; i++) {
> > +		u8 (*prog_tags)[BPF_TAG_SIZE] = (void *)(info->prog_tags);
> 
> Need this:
> 
> -               u8 (*prog_tags)[BPF_TAG_SIZE] = (void *)(info->prog_tags);
> +               u8 (*prog_tags)[BPF_TAG_SIZE] = (u8 *)(info->prog_tags);
> 
> 
> To overcome this on debian:experimental-x-mips, i.e. Debian Experimental
> cross building to MIPS 32-bit:
> 
> util/bpf-event.c: In function 'perf_event__synthesize_one_bpf_prog':
> util/bpf-event.c:143:35: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>    u8 (*prog_tags)[BPF_TAG_SIZE] = (void *)(info->prog_tags);
>                                    ^
> util/bpf-event.c:144:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>    __u32 *prog_lens = (__u32 *)(info->jited_func_lens);
>                       ^
> util/bpf-event.c:145:23: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>    __u64 *prog_addrs = (__u64 *)(info->jited_ksyms);
>                        ^
> util/bpf-event.c:146:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>    void *func_infos = (void *)(info->func_info);
>                       ^
>   CC       /tmp/build/perf/util/pmu.o
>   CC       /tmp/build/perf/util/pmu-flex.o
> cc1: all warnings being treated as errors

Argh, hit the send button too fast, that is not the only case and then
my change just changed the error:

util/bpf-event.c: In function 'perf_event__synthesize_one_bpf_prog':
util/bpf-event.c:143:35: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   u8 (*prog_tags)[BPF_TAG_SIZE] = (u8 *)(info->prog_tags);
                                   ^
util/bpf-event.c:143:35: error: initialization of 'u8 (*)[8]' {aka 'unsigned char (*)[8]'} from incompatible pointer type 'u8 *' {aka 'unsigned char *'} [-Werror=incompatible-pointer-types]
util/bpf-event.c:144:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   __u32 *prog_lens = (__u32 *)(info->jited_func_lens);
                      ^
util/bpf-event.c:145:23: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   __u64 *prog_addrs = (__u64 *)(info->jited_ksyms);
                       ^
util/bpf-event.c:146:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   void *func_infos = (void *)(info->func_info);
                      ^
  CC       /tmp/build/perf/util/pmu.o
  CC       /tmp/build/perf/util/pmu-flex.o
cc1: all warnings being treated as errors
mv: cannot stat '/tmp/build/perf/util/.bpf-event.o.tmp': No such file or directory

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ