Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4701551ybl; Mon, 26 Aug 2019 14:37:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBP5RasE+BURJcQ28ady8IHDwQAFX8/X+9v8OdEDYbJ5u4LHJTAvT8x3CgcouPrh9DS/Cx X-Received: by 2002:a17:90a:c086:: with SMTP id o6mr6034351pjs.2.1566855447967; Mon, 26 Aug 2019 14:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566855447; cv=none; d=google.com; s=arc-20160816; b=Rl7s6LQtLZ0caayrCLTpWHP8IHP7mu4ydLtw0J3+UL72A7STgLJ5jBT1CvD11u3uKP FnUc/j+Ye+GTBPmvE21XfdW73MU9uT6UGLMuuRcH8wBOtTE7n3UinDrO4bSbL0mZGFAM jZyi4lWX6LehsQW915XQpfMy3roDu3JSKo20f8nm9fMKRaIefNsZiwL1NHdFCJlQLkp3 zkJG9x11Nf9eS5jMoj/P2c3enP84BzsCuhsg0RzXEqGk6ZgMyS+9jwEv5c7pVpWChW+i F2jdrifzESTVQV8uQjP05nGK3DQsPmhZM8C96S3AWRFOutVOOAT5X5X858Ufa+P8x8ta c0YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YNrRoB0M5FdCnxiXy7U5VyxF44V6AQGlW8VU4y43rcg=; b=wtTiRH2xh6BapoOeS8rn0LETDlfEoQzytVDxID5JLU+E5BfZLMjzYzzj5vTOjysvGm lsN9CcP2L3VMEvc1f4tOteQwyoDVHQ79QPsUtMTUB+ocsg582MadtJ4shxC/kcUJx7fe iLI7xLS+wCOcMW6vbqEGg47OupJU7I0cjX5z/xGzwCqG+pLQMFzf7mInYZt/WrRdlcFA eovPTESwZW3gflZuTQB5Bq550UC4Y9P0bHaFZpYOCprVUkQJv7Lc4+RTjL1ToHoQmViY dKHwiDoAyMj2GFx51axh98BCU4Lm5R10yeT4xc2J0VVrqXl91FdEQlSRGAQ4UZtnO/FO EgMg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bo6si1098979pjb.1.2019.08.26.14.37.10; Mon, 26 Aug 2019 14:37:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729335AbfHZVeX (ORCPT + 99 others); Mon, 26 Aug 2019 17:34:23 -0400 Received: from www62.your-server.de ([213.133.104.62]:48210 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729296AbfHZVeU (ORCPT ); Mon, 26 Aug 2019 17:34:20 -0400 Received: from sslproxy05.your-server.de ([78.46.172.2]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1i2Mcw-0003JB-Am; Mon, 26 Aug 2019 23:34:14 +0200 Received: from [178.197.249.36] (helo=pc-63.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1i2Mcw-000BMQ-3A; Mon, 26 Aug 2019 23:34:14 +0200 Subject: Re: [PATCH] bpf: handle 32-bit zext during constant blinding To: "Naveen N. Rao" , Alexei Starovoitov , Jiong Wang Cc: Michael Ellerman , bpf@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190821192358.31922-1-naveen.n.rao@linux.vnet.ibm.com> From: Daniel Borkmann Message-ID: <776c3058-ebd4-f30d-7392-03a4a94c2483@iogearbox.net> Date: Mon, 26 Aug 2019 23:34:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190821192358.31922-1-naveen.n.rao@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.3/25553/Mon Aug 26 10:32:22 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/21/19 9:23 PM, Naveen N. Rao wrote: > Since BPF constant blinding is performed after the verifier pass, the > ALU32 instructions inserted for doubleword immediate loads don't have a > corresponding zext instruction. 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 LGTM, applied to bpf, thanks!