From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: Re: [PATCH net] bpf: uninitialized variables in test code Date: Mon, 3 Dec 2018 13:34:06 +0300 Message-ID: <20181203103406.GF3095@unbuntlaptop> References: <20181129102703.2huzlalirskjdl4k@kili.mountain> <20181130225801.7adzjdjkn5cirq4s@ast-mbp.dhcp.thefacebook.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexei Starovoitov , Daniel Borkmann , "David S. Miller" , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, guro@fb.com To: Alexei Starovoitov , Roman Gushchin Return-path: Received: from userp2120.oracle.com ([156.151.31.85]:38982 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbeLCKdI (ORCPT ); Mon, 3 Dec 2018 05:33:08 -0500 Content-Disposition: inline In-Reply-To: <20181130225801.7adzjdjkn5cirq4s@ast-mbp.dhcp.thefacebook.com> Sender: netdev-owner@vger.kernel.org List-ID: I'm afraid Roman's patch doesn't fix the bug. On Fri, Nov 30, 2018 at 02:58:03PM -0800, Alexei Starovoitov wrote: > On Thu, Nov 29, 2018 at 01:27:03PM +0300, Dan Carpenter wrote: > > Smatch complains that if bpf_test_run() fails with -ENOMEM at the > > begining then the "duration" is uninitialized. We then copy the > > unintialized variables to the user inside the bpf_test_finish() > > function. The functions require CAP_SYS_ADMIN so it's not really an > > information leak. > > > > Fixes: 1cf1cae963c2 ("bpf: introduce BPF_PROG_TEST_RUN command") > > Signed-off-by: Dan Carpenter > > That is incorrect fixes tag. Yeah. You're right. The Fixes tag is wrong. I spent some time looking at this too, because the code is old but the warning only just appeared... :/ Thanks for fixing this, Roman. regards, dan carpenter