Re: [BUG] powerpc: test_progs -t for_each faults kernel

2022-01-03 Thread Jiri Olsa
On Mon, Jan 03, 2022 at 11:07:02AM +0530, Naveen N. Rao wrote:
> Hi Jiri,
> 
> Jiri Olsa wrote:
> > hi,
> > when running 'test_progs -t for_each' on powerpc we are getting
> > the fault below
> 
> This looks to be the same issue reported by Yauheni:
> http://lkml.kernel.org/r/xunylf0o872l@redhat.com
> 
> Can you please check if the patch I posted there fixes it for you?

great, yes, that fixes it for me

thanks,
jirka



Re: [BUG] powerpc: test_progs -t for_each faults kernel

2022-01-02 Thread Naveen N. Rao

Hi Jiri,

Jiri Olsa wrote:

hi,
when running 'test_progs -t for_each' on powerpc we are getting
the fault below


This looks to be the same issue reported by Yauheni:
http://lkml.kernel.org/r/xunylf0o872l@redhat.com

Can you please check if the patch I posted there fixes it for you?


Thanks,
Naveen


[BUG] powerpc: test_progs -t for_each faults kernel

2022-01-02 Thread Jiri Olsa
hi,
when running 'test_progs -t for_each' on powerpc we are getting
the fault below

it seems that for some reason the function callback address passed
to bpf_for_each_array_elem is wrong.. I wonder it's the powerpc
function pointers magic ;-)

it's the latest bpf-next/master, I can send .config if needed

thanks,
jirka


---
[  114.362271] kernel tried to execute user page (1) - exploit attempt? 
(uid: 0)
[  114.362284] BUG: Unable to handle kernel instruction fetch
[  114.362288] Faulting instruction address: 0x1
[  114.362294] Oops: Kernel access of bad area, sig: 11 [#1]
[  114.362299] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
[  114.362309] Modules linked in: bpf_testmod(OE) bonding tls rfkill 
pseries_rng ibmveth crct10dif_vpmsum drm fuse i2c_core 
drm_panel_orientation_quirks zram ip_tables ibmvscsi scsi_transport_srp 
vmx_crypto crc32c_vpmsum
[  114.362339] CPU: 5 PID: 935 Comm: test_progs Tainted: G   OE 
5.16.0-rc7+ #3
[  114.362345] NIP:  0001 LR: c0378a24 CTR: 00010001
[  114.362350] REGS: c00015ef36e0 TRAP: 0400   Tainted: G   OE  
(5.16.0-rc7+)
[  114.362355] MSR:  80004280b033   CR: 
88008248  XER: 2004
[  114.362371] CFAR: c0378a20 IRQMASK: 0 
   GPR00: c03789bc c00015ef3980 c2890900 
ccbb0200 
   GPR04: c00015ef39ec ccbb0310 c00015ef3a48 
 
   GPR08: 0001fd9a 0003  
2000 
   GPR12: 00010001 c0001ecab080  
 
   GPR16:    
c00017a48400 
   GPR20: 0001  c00015ef3ac0 
c00015ef3b7c 
   GPR24: c00015ef3b78 c00802e4 c00802e40048 
c00015ef3a48 
   GPR28: ccbb0310 00010001 ccbb0200 
0001 
[  114.362431] NIP [0001] 0x1
[  114.362436] LR [c0378a24] bpf_for_each_array_elem+0xc4/0x1c0
[  114.362443] Call Trace:
[  114.362445] [c00015ef3980] [c03789bc] 
bpf_for_each_array_elem+0x5c/0x1c0 (unreliable)
[  114.362454] [c00015ef3a20] [c008032267dc] 
bpf_prog_21bfb2cd0ec79d94_F+0xac/0x98d0
[  114.362461] [c00015ef3a90] [c0f54308] bpf_test_run+0x208/0x420
[  114.362469] [c00015ef3b50] [c0f551b8] 
bpf_prog_test_run_skb+0x368/0x7a0
[  114.362478] [c00015ef3bf0] [c034bf40] __sys_bpf+0xc20/0x2e20
[  114.362486] [c00015ef3d90] [c034e1dc] sys_bpf+0x2c/0x40
[  114.362495] [c00015ef3db0] [c002d478] 
system_call_exception+0x188/0x360
[  114.362505] [c00015ef3e10] [c000bfe8] 
system_call_vectored_common+0xe8/0x278
[  114.362514] --- interrupt: 3000 at 0x7fff813dc9fc
[  114.362520] NIP:  7fff813dc9fc LR:  CTR: 
[  114.362526] REGS: c00015ef3e80 TRAP: 3000   Tainted: G   OE  
(5.16.0-rc7+)
[  114.362532] MSR:  8280f033   CR: 
48002848  XER: 
[  114.362552] IRQMASK: 0 
   GPR00: 0169 7fffe3429c10 7fff814e6f00 
000a 
   GPR04: 7fffe3429cb8 0090  
0008 
   GPR08: 000a   
 
   GPR12:  7fff8164b7d0  
 
   GPR16:    
 
   GPR20:    
 
   GPR24: 101baa4c 7fffe342a520 1056f5d8 
7fff8163eb68 
   GPR28: 7fffe342a6a8 7fffe342a4f8 0004 
7fffe3429c10 
[  114.362626] NIP [7fff813dc9fc] 0x7fff813dc9fc
[  114.362631] LR [] 0x0
[  114.362636] --- interrupt: 3000
[  114.362640] Instruction dump:
[  114.362646]        
 
[  114.362661]        
 
[  114.362675] ---[ end trace c044e1b381f36402 ]---