On Sat, Feb 27, 2021 at 06:17:26AM +0100, Ilya Leoshkevich wrote: > test_snprintf_btf fails on s390, because NULL points to a readable > struct lowcore there. Fix by using the last page instead. > > Error message example: > > printing fffffffffffff000 should generate error, got (361) > > Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx> > --- > > > v1: https://lore.kernel.org/bpf/20210226135923.114211-1-iii@xxxxxxxxxxxxx/ > v1 -> v2: Yonghong suggested to add the pointer value to the error > message. > I've noticed that I've been passing BADPTR as flags, therefore > the fix worked only by accident. Put it into p.ptr where it > belongs. > > v2: https://lore.kernel.org/bpf/20210226182014.115347-1-iii@xxxxxxxxxxxxx/ > v2 -> v3: Heiko mentioned that using _REGION1_SIZE is not future-proof. > We had a private discussion and came to the conclusion that > the the last page is good enough. > > v3: https://lore.kernel.org/bpf/20210226190908.115706-1-iii@xxxxxxxxxxxxx/ > v3 -> v4: Yonghong suggested to print the non-hashed pointer value. > > .../testing/selftests/bpf/progs/netif_receive_skb.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) Just in case, also for v4: Acked-by: Heiko Carstens <hca@xxxxxxxxxxxxx>