Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp543311ybl; Wed, 21 Aug 2019 01:32:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUMVv12NxE0lhOTLTH4jNRRI+pwmd8ezDBYtmb9CH4F3ppOBENdJbpckQWS7ls2gqE2eky X-Received: by 2002:a17:902:848c:: with SMTP id c12mr30524536plo.47.1566376373835; Wed, 21 Aug 2019 01:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566376373; cv=none; d=google.com; s=arc-20160816; b=FLEpyhqb9zGDRopmey/kvAN12u70gtdhrZIu7YMbkzU89VqVZ4h6DHs9xmgsN/RxDA /i+Eq8uxFvtAMQBvu+iyFQ+MeS+nhQ1X6SeJaDfYs7uUQ5k58HKPl93WJjtDGtwXyv5y QduVBCWQKxuyCqTCaDLU1p4Ulk1PHyYtySguCelGHDf8xrTwfK3eNdIwzD2k3/7BuUW9 VNmB2mOemPMCUq9mc6Qh1Pq2wcnOAvYEMm0Gdu2OHtgvImFm+1C80zxwhjCw7NPBkhE/ lE2vTQ9u0arJJwJL09LOCPKI8me02/Q9YkegQxacelmYZGsoApB5YUdbW1qM1J5bLSoU 5prQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :user-agent:mime-version:in-reply-to:references:cc:to:subject:from :date; bh=Mw7HTqUuDIYR4hE/15LZKAyCqGFHAiXQC0Y/rumlXSE=; b=rXowoK9Tu59xrudfER+h1XelxHCy2wzw5BOapEeKNYtsMgTTNv0QledCfKhb6TXuqB 4MgN/vVw+Oo7LjZqy79Zus0UcxQeL3G6nuCqVZ2D2t7IpQn+LrPB1M9uFcdSPU3a4rof ChMSsbyDT/IEkho9jp6toEjT4kUhmlfEMMlJsQ8KGzIcjMEMa+265deEIzDv41jQLyRf mr4XZ90e/n2NP9YzIjYb1BXxhaHdBrb5uD0gzSnR1Y+B8j8XXfejjz/iPPOq3aS0khhc 2ODAmGSVAKFG7J66+uKdXU8KgmjzwHUfnuCImNRKKccWEbm6qo6c1ZYgRHhMwS2FuOZP eI2g== 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 f6si13978710plt.195.2019.08.21.01.32.38; Wed, 21 Aug 2019 01:32:53 -0700 (PDT) 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 S1727724AbfHUIbI convert rfc822-to-8bit (ORCPT + 99 others); Wed, 21 Aug 2019 04:31:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:7126 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727409AbfHUIbH (ORCPT ); Wed, 21 Aug 2019 04:31:07 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7L8LPiF031639 for ; Wed, 21 Aug 2019 04:31:01 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ugymf6x5a-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 21 Aug 2019 04:31:01 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Aug 2019 09:30:51 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) 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) Wed, 21 Aug 2019 09:30:47 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7L8UkFk60620938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Aug 2019 08:30:46 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 858F1A4055; Wed, 21 Aug 2019 08:30:46 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 34F27A4053; Wed, 21 Aug 2019 08:30:46 +0000 (GMT) Received: from localhost (unknown [9.124.35.29]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 21 Aug 2019 08:30:46 +0000 (GMT) Date: Wed, 21 Aug 2019 14:00:44 +0530 From: "Naveen N. Rao" Subject: Re: [RFC PATCH] bpf: handle 32-bit zext during constant blinding To: Alexei Starovoitov , Daniel Borkmann , Jiong Wang Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Michael Ellerman , netdev@vger.kernel.org References: <20190813171018.28221-1-naveen.n.rao@linux.vnet.ibm.com> In-Reply-To: <20190813171018.28221-1-naveen.n.rao@linux.vnet.ibm.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-TM-AS-GCONF: 00 x-cbid: 19082108-0016-0000-0000-000002A108D2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19082108-0017-0000-0000-000033013B9D Message-Id: <1566376025.68ldwx3wc7.naveen@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-21_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=641 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908210089 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Naveen N. Rao wrote: > Since BPF constant blinding is performed after the verifier pass, there > are certain ALU32 instructions inserted which don't have a corresponding > zext instruction inserted after. This is causing a kernel oops on > powerpc and can be reproduced by running 'test_cgroup_storage' with > bpf_jit_harden=2. > > Fix this by emitting BPF_ZEXT during constant blinding if > prog->aux->verifier_zext is set. > > Fixes: a4b1d3c1ddf6cb ("bpf: verifier: insert zero extension according to analysis result") > Reported-by: Michael Ellerman > Signed-off-by: Naveen N. Rao > --- > This approach (the location where zext is being introduced below, in > particular) works for powerpc, but I am not entirely sure if this is > sufficient for other architectures as well. This is broken on v5.3-rc4. Alexie, Daniel, Jiong, Any feedback on this? - Naveen