Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp595256imu; Fri, 4 Jan 2019 03:41:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN42tXHV9zCjIix8/cTI6msQIkuAH/oYE4ifj2A+mqtK0xdCm66qW5QzdJdMtboujtcTNHTU X-Received: by 2002:a17:902:f64:: with SMTP id 91mr50358094ply.132.1546602117631; Fri, 04 Jan 2019 03:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546602117; cv=none; d=google.com; s=arc-20160816; b=OfbXol/orgHC1SFxLo4sb4vbkjtfGSg8+Zq+bNcpKZRsv2Fnld7u4vyYLkTOrnVIwe 8czmxWegrri80juOiPlHzspvpBEq7U88GrCNSaXsbbR/g7jhrTaXPvIpdmD6SkCf7WQC N7fJC2TTkT62zmPU+3Wih0RRHQ8FHOC6bx87N3T8o6ftE0giw/bRPZe5IaYuqzxBw+iL DcqMvP6G8CYMThSr/nZ7Kikf5kId4KEwSJlVJC1LyC4j4Nw/D0UIUFPUSCBGTdxSYoIH +I9dZTvYMSFeli0NdN+SsCPHSz8tz0xkv3ClIWRfm3ntqYSDqr33LjmECtTFfeLZK6md iLOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:message-id:in-reply-to:mime-version :references:subject:cc:to:from:date; bh=Xvtq0xo2etztuMh1efpfZIF5+122X0hE6EFMdhEeCOA=; b=e933gFO90nkv+wzXCj/Xpl4cbmXLZE+DQ+2/O1Twi0JdP1MMf89/wCS8rhda1KIfSU tHIOSqtWfuesEsChx8H/55Y/0nCVKs3PQ8cO/3P0ByhOaTQNUI7Qgzdx9Oxd4D3/wWdb BhXr/eRXZC+RQj96RZ+htsGIad4MpgoA6Y+eAVN1rxTIHkKDjPx6ei1g5jAqcn7if74q +FpvMvZWz+pgbSXCL4duU4WnrrUAjOl/ImvPEpW4I3addMeN84XW4X3GKDGC5BCM7fq1 uHOmmaATCqXGObD3UVxCoYzdaupdTJy9UIr/cuApoqziJeW98xEl6gUuvGXiDVvprpA+ +OzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f189si56008550pfg.123.2019.01.04.03.41.42; Fri, 04 Jan 2019 03:41:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726796AbfADJ0Y (ORCPT + 99 others); Fri, 4 Jan 2019 04:26:24 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35292 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726488AbfADJ0X (ORCPT ); Fri, 4 Jan 2019 04:26:23 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x049QEFJ033617 for ; Fri, 4 Jan 2019 04:26:22 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2pt3ygamqj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 04 Jan 2019 04:26:17 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 Jan 2019 09:25:31 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 4 Jan 2019 09:25:27 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x049PQ9D63504452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 4 Jan 2019 09:25:26 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4CD5EAE051; Fri, 4 Jan 2019 09:25:26 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11CD9AE055; Fri, 4 Jan 2019 09:25:26 +0000 (GMT) Received: from osiris (unknown [9.152.212.95]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 4 Jan 2019 09:25:26 +0000 (GMT) Date: Fri, 4 Jan 2019 10:25:24 +0100 From: Heiko Carstens To: Martin Lau Cc: Eugene Syromyatnikov , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , Yonghong Song , Alexei Starovoitov , "Dmitry V. Levin" Subject: Re: "bpf: Improve the info.func_info and info.func_info_rec_size behavior" breaks strace self tests References: <20190103114613.GB3957@osiris> <20190103191158.yu4cjkb3wd3zvpqk@kafai-mbp> <20190103224118.GA4491@osiris> <20190103235248.kxvhhwq4brcdxzps@kafai-mbp> MIME-Version: 1.0 In-Reply-To: <20190103235248.kxvhhwq4brcdxzps@kafai-mbp> X-TM-AS-GCONF: 00 x-cbid: 19010409-0016-0000-0000-0000023FCBC3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19010409-0017-0000-0000-00003299CFB1 Message-Id: <20190104092524.GC4396@osiris> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-04_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901040084 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 03, 2019 at 11:52:51PM +0000, Martin Lau wrote: > On Thu, Jan 03, 2019 at 11:41:18PM +0100, Heiko Carstens wrote: > > On Thu, Jan 03, 2019 at 07:12:05PM +0000, Martin Lau wrote: > > > On Thu, Jan 03, 2019 at 12:46:13PM +0100, Heiko Carstens wrote: > > > > Hello, > > > > > > > > the kernel commit 7337224fc150 ("bpf: Improve the info.func_info and > > > > info.func_info_rec_size behavior") breaks one of strace's self tests: > > > > > > > > FAIL: bpf-obj_get_info_by_fd-prog-v.gen ... > I am running against linux-next. I don't see how root and non-root affect > thing here. I guess the test has been running without jit so far? Yes, it was disabled. Enabling jit and adding your memset fix leads to what you report with 2) below. > 1) root or not, if jit is enabled, > without the memset() fix in the bpf-obj_get_info_by_fd.c in my last email, > they all failed: > [root@arch-fb-vm1 tests]# ./bpf-obj_get_info_by_fd-prog-v.gen.test > BPF_OBJ_GET_INFO_BY_FD prog 2 failed: Bad address > bpf-obj_get_info_by_fd-prog-v.gen.test: skipped test: ../bpf-obj_get_info_by_fd-prog-v exited with code 77 > > Please fix this first. > > 2) After having the memset fix: > Root or not, for jited program, if I run > ./bpf-obj_get_info_by_fd-prog-v.gen.test, they failed. If I read the > init.sh correclty, it fails because there is a diff between the > ./bpf-obj_get_info_by_fd-prog-v stdout and the "strace -o log". I think > "strace -o log" only has the /* bytes 104..151 */ part if some bytes > are non-zero? > > Regardless, the test program "bpf-obj_get_info_by_fd.c" is telling > the kernel that the userspace "info" is in size 168 bytes. > The kernel then tells as much details as possible about > a bpf prog in "info". I don't see a ABI breakage here. > > I believe the test just happens to work so far because it has been running > without jit? > > If I run it with jit enabled: > -bpf(BPF_OBJ_GET_INFO_BY_FD, {info={bpf_fd=4, info_len=168, info={type=BPF_PROG_TYPE_SOCKET_FILTER, id=35, tag="\xda\xbf\x02\x07\xd1\x99\x24\x86", jited_prog_len=0 => 110, jited_prog_insns=NULL, xlated_prog_len=0 => 120, xlated_prog_insns=[], load_time=2476906063975, created_by_uid=0, nr_map_ids=0 => 1, map_ids=[], name="test_prog", ifindex=0, netns_dev=makedev(0, 0), netns_ino=0}}}, 16) = 0 > -bpf(BPF_OBJ_GET_INFO_BY_FD, {info={bpf_fd=4, info_len=168, info={type=BPF_PROG_TYPE_SOCKET_FILTER, id=35, tag="\xda\xbf\x02\x07\xd1\x99\x24\x86", jited_prog_len=0 => 110, jited_prog_insns=NULL, xlated_prog_len=0 => 120, xlated_prog_insns=[], load_time=2476906063975, created_by_uid=0, nr_map_ids=2 => 1, map_ids=[36], name="test_prog", ifindex=0, netns_dev=makedev(0, 0), netns_ino=0}}}, 16) = 0 > +bpf(BPF_OBJ_GET_INFO_BY_FD, {info={bpf_fd=4, info_len=168, info={type=BPF_PROG_TYPE_SOCKET_FILTER, id=35, tag="\xda\xbf\x02\x07\xd1\x99\x24\x86", jited_prog_len=0 => 110, jited_prog_insns=NULL, xlated_prog_len=0 => 120, xlated_prog_insns=[], load_time=2476906063975, created_by_uid=0, nr_map_ids=0 => 1, map_ids=[], name="test_prog", ifindex=0, netns_dev=makedev(0, 0), netns_ino=0, /* bytes 104..167 */ "\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}}}, 16) = 0 > +bpf(BPF_OBJ_GET_INFO_BY_FD, {info={bpf_fd=4, info_len=168, info={type=BPF_PROG_TYPE_SOCKET_FILTER, id=35, tag="\xda\xbf\x02\x07\xd1\x99\x24\x86", jited_prog_len=0 => 110, jited_prog_insns=NULL, xlated_prog_len=0 => 120, xlated_prog_insns=[], load_time=2476906063975, created_by_uid=0, nr_map_ids=2 => 1, map_ids=[36], name="test_prog", ifindex=0, netns_dev=makedev(0, 0), netns_ino=0, /* bytes 104..167 */ "\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}}}, 16) = 0 > > The diff comes in as early as byte 104-th which is the nr_jited_ksyms == 1. > > Please fix the test program. A protential fix is in bpf-obj_get_info_by_fd.c > to printf the non-zero "/* bytes 104..1xx */..." the same way as the > "strace -o log" does. Thanks a lot for looking into this! Eugene, Dmitry will you take care of fixing this?