From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yonghong Song Subject: Re: [PATCH bpf-next v2 3/8] bpf, iter: Fix the condition on p when calling stop. Date: Mon, 20 Jun 2022 11:48:08 -0700 Message-ID: References: <20220610194435.2268290-1-yosryahmed@google.com> <20220610194435.2268290-4-yosryahmed@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=facebook; bh=ILl9jNqradX78KiS55v+M1Sf8SHefP9G5qWvhFuuqsQ=; b=bfpDquyBDf5cVK8hc7m56me+nXfyl5D2yb0m8E+8oweQ10xuenhfSxgpFQb8ZoAelK0F 8kaqJyZqBfmmkFQemcvYwWOCosB9ZD0pO2DeuaOmaxSrSvmDaRec15zxSra4RyzRq56h 0mJtsBjr/a80EbsEUN6V/EiWApzCEykmEfU= Content-Language: en-US In-Reply-To: <20220610194435.2268290-4-yosryahmed@google.com> List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Yosry Ahmed , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , Hao Luo , Tejun Heo , Zefan Li , Johannes Weiner , Shuah Khan , Michal Hocko Cc: Roman Gushchin , David Rientjes , Stanislav Fomichev , Greg Thelen , Shakeel Butt , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, cgroups@vger.kernel.org On 6/10/22 12:44 PM, Yosry Ahmed wrote: > From: Hao Luo > > In bpf_seq_read, seq->op->next() could return an ERR and jump to > the label stop. However, the existing code in stop does not handle > the case when p (returned from next()) is an ERR. Adds the handling > of ERR of p by converting p into an error and jumping to done. > > Because all the current implementations do not have a case that > returns ERR from next(), so this patch doesn't have behavior changes > right now. > > Signed-off-by: Hao Luo > Signed-off-by: Yosry Ahmed Acked-by: Yonghong Song