From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90E7610973 for ; Wed, 2 Aug 2023 21:51:50 +0000 (UTC) Received: from out-79.mta0.migadu.com (out-79.mta0.migadu.com [91.218.175.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A47173A for ; Wed, 2 Aug 2023 14:51:48 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691013106; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mGFfLF0IaEmc6OPARonSKrF8hHFm/P2KwED6bkFETHM=; b=gPvyYuDiGT14noB/bkYIq35kIoYk79kJm07rYgLVKpL1m+tatT0vIt7yv4vgEO3j/uOiEg lk/Yf4LadwE+q1rhecj1V7M45Yygq7oxFqX2NXvHScuwdVATzVVNRhpcike2kpA8gLHqBb tetJS4tiaIDqC2Tex/R065NIpkDdIiU= Date: Wed, 2 Aug 2023 14:51:41 -0700 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-To: yonghong.song@linux.dev Subject: Re: [PATCH v3 bpf-next 1/2] bpf: Fix uninitialized symbol in bpf_perf_link_fill_kprobe() Content-Language: en-US To: Yafang Shao , ast@kernel.org, daniel@iogearbox.net, john.fastabend@gmail.com, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org Cc: bpf@vger.kernel.org, Dan Carpenter References: <20230731111313.3745-1-laoar.shao@gmail.com> <20230731111313.3745-2-laoar.shao@gmail.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: <20230731111313.3745-2-laoar.shao@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On 7/31/23 4:13 AM, Yafang Shao wrote: > The patch 1b715e1b0ec5: "bpf: Support ->fill_link_info for > perf_event" from Jul 9, 2023, leads to the following Smatch static > checker warning: > > kernel/bpf/syscall.c:3416 bpf_perf_link_fill_kprobe() > error: uninitialized symbol 'type'. > > That can happens when uname is NULL. So fix it by verifying the uname > when we really need to fill it. > > Fixes: 1b715e1b0ec5 ("bpf: Support ->fill_link_info for perf_event") > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/bpf/85697a7e-f897-4f74-8b43-82721bebc462@kili.mountain/ > Signed-off-by: Yafang Shao Acked-by: Yonghong Song