Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1087332ybb; Fri, 20 Mar 2020 13:08:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsTnK1VUi/zdR6jPv8XFQfGLnR9tJK3NaDxeQhFauOdf17eXyZ1yi/hDb/gRaX4GYP105Hr X-Received: by 2002:a05:6830:231d:: with SMTP id u29mr7868514ote.1.1584734890800; Fri, 20 Mar 2020 13:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584734890; cv=none; d=google.com; s=arc-20160816; b=djX94HjM27XCt3/9O0BxSAxP+BSJdE2a88gXzsEJdY4P+cJMvyNpMTAMPJXdAkeGDk uoHMlrqOBwJSyPYYype0wz2BSMyly1W8Z6sBQBY7CV5jdwqdB0QkCU0ya/4yqHF95Sna EWy6M6KBMWuF0aPGyyNaOl1m3QYM5onjVwYdyDl5PxAI17hWc7smO/5eByXFF4relfa8 nKjoPWEmBlIpbSqigWEJRkHgtvMzbgsZzWvfKqmsGQwpggWw8iF6PzvX9Kqs6aT1TRVu iLyNzwmlV5Y6VFU8Em/UhTSvs+qEXWZRDzvn0g0by9U2csqdTNoN4DF/1vXgfk3sFJfo NIgA== 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=pyLOWnD9szFdHYCe4E0+Qt1r3p2/3rXQICW5nQw5jI4=; b=IFwbP7DSzqaw3uDrIlGOOXKikHUhkikDodWA/0J/1mTz/RZHVPEqBrwfPAMtBMzqM3 GVyv6KvmaIKqSs1seiNKYWP2L/4flzC2CKamLiKD0h1K/g6E/bjqf4dl9n61ur5UANA7 QUt75caWy6sGrEag/F+RM78m8VLWizKOf106k9rLxifPaYThwnexaSR27b+pY/zJJfEy EaQR3VGlNKLZOn3pzFC8bAKEKLnfnm2DxqCvwrhRdVKOAEiSsrtvjmhZhD3A9mLZ3rhL IrIoL6MUDQe0tmvErsup0KgVUtEwjwSeVt0k44iu27CwamHoLE2u5RMzwVKWnpoHAaUN o8JQ== 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 y16si3106755oie.225.2020.03.20.13.07.49; Fri, 20 Mar 2020 13:08:10 -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 S1726970AbgCTUHb (ORCPT + 99 others); Fri, 20 Mar 2020 16:07:31 -0400 Received: from www62.your-server.de ([213.133.104.62]:39318 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbgCTUHa (ORCPT ); Fri, 20 Mar 2020 16:07:30 -0400 Received: from sslproxy02.your-server.de ([78.47.166.47]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1jFNvR-0006Vm-I2; Fri, 20 Mar 2020 21:07:25 +0100 Received: from [85.7.42.192] (helo=pc-9.home) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jFNvR-0009xC-4J; Fri, 20 Mar 2020 21:07:25 +0100 Subject: Re: [PATCH] bpf: explicitly memset the bpf_attr structure To: Greg Kroah-Hartman , Alexei Starovoitov Cc: Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Maciej_=c5=bbenczykowski?= , John Stultz , Alexander Potapenko , Alistair Delva References: <20200320094813.GA421650@kroah.com> From: Daniel Borkmann Message-ID: Date: Fri, 20 Mar 2020 21:07:24 +0100 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: <20200320094813.GA421650@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.2/25757/Fri Mar 20 14:13:59 2020) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/20/20 10:48 AM, Greg Kroah-Hartman wrote: > For the bpf syscall, we are relying on the compiler to properly zero out > the bpf_attr union that we copy userspace data into. Unfortunately that > doesn't always work properly, padding and other oddities might not be > correctly zeroed, and in some tests odd things have been found when the > stack is pre-initialized to other values. > > Fix this by explicitly memsetting the structure to 0 before using it. > > Reported-by: Maciej Żenczykowski > Reported-by: John Stultz > Reported-by: Alexander Potapenko > Reported-by: Alistair Delva > Cc: stable > Link: https://android-review.googlesource.com/c/kernel/common/+/1235490 > Signed-off-by: Greg Kroah-Hartman Applied, thanks!