From owner-dev-commits-src-main@freebsd.org Thu Jul 8 08:52:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93223665FDA; Thu, 8 Jul 2021 08:52:42 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GL96L3dyBz3t5d; Thu, 8 Jul 2021 08:52:42 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf1-x12c.google.com with SMTP id 8so1377855lfp.9; Thu, 08 Jul 2021 01:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZMMkSs+LTZpOXb7MNz8IqQ4LwDXrEyIKVgdsAGGhehM=; b=ocYonRddLnclkx1BstViADtdlTFPtf3QQyDUL3lGwh9r4KnInIHdth/peiqW2s+HrI O/lgeQtM2MF/ypCVSeC3MAufADifWvglA3j7hj6RJMiiVu2mw/clGTQ1nmsdvr9f1Mqo 0hXiiAGazTIv5aN/a6QRiU273WXjPnLqIn18U2myykA7KQTFtthbT0Utx57XMazLzi1Q B03XAG1j3hw1MBgG/aSFDs70qCp94//ncZsCvEaEoGehnE/N3Y3VZyBdo3MznQ7p5a1Q GhN1zGqCkrLvPe8x9t0YGE1HhG9awgAYxfbGF/P5FFPnDaIdn06PyG7/8XVLZ/TbuoGm NFOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ZMMkSs+LTZpOXb7MNz8IqQ4LwDXrEyIKVgdsAGGhehM=; b=HTsszJhAtPgURxLKSRlFmuO1bh1bIgIBkTKvrNJnptwgzOXEIOq9xfLZX1x7+c3rL4 9dfn4PZl7eOUm1NOAu6tzo5qEj/zI4lUns9Xt0Y+UTdWtUSz+gjLHdSHXs1gvU5nuB2I M7lS0y69UqX1Esa0+9YAMB4mSsQSHv0arnDeVIL8MhwD2jVdYey4UZihFDzMZjOJQekn DdST96t03RE335EhtzUxthUuapXKVTSxdTAaht6uOEKrfuc/2K/IVd45hTxya4PaTplw v+Jl0ptw8jAsuk3i63KVA7mnNyrjh6yfB7sj+v8WwOO7cKXQryrToBDTEs9vGBnnT4M6 lRDA== X-Gm-Message-State: AOAM530f5Dnta9boBBiQbedAToFJzcfRHuEQsZbt+uISAErvIeI9Jka3 t34Tax9ceyuvfkAeyuORfboCkQLwju4WX/rDFBSXNsB6 X-Google-Smtp-Source: ABdhPJzln77xq17BcJSsDumyaKg/9guhAfHtMqlTyeJmVkaX3IZZeTGlyLLaSue1jL+Ps/wzCwDxwua5bTCQ23RSuhw= X-Received: by 2002:a05:651c:54f:: with SMTP id q15mr23765844ljp.347.1625734358550; Thu, 08 Jul 2021 01:52:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:9c8b:0:0:0:0:0 with HTTP; Thu, 8 Jul 2021 01:52:37 -0700 (PDT) In-Reply-To: <202107080848.1688m2Ff062455@gitrepo.freebsd.org> References: <202107080848.1688m2Ff062455@gitrepo.freebsd.org> From: Mateusz Guzik Date: Thu, 8 Jul 2021 10:52:37 +0200 Message-ID: Subject: Re: git: fa96701c8abb - main - pf: Handle errors returned by pf_killstates() To: Kristof Provost Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GL96L3dyBz3t5d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2021 08:52:42 -0000 if it never fails it should return void On 7/8/21, Kristof Provost wrote: > The branch main has been updated by kp: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=fa96701c8abbc29aad7f8f8d6b823bd7f89c6c15 > > commit fa96701c8abbc29aad7f8f8d6b823bd7f89c6c15 > Author: Kristof Provost > AuthorDate: 2021-07-05 12:21:03 +0000 > Commit: Kristof Provost > CommitDate: 2021-07-08 08:32:42 +0000 > > pf: Handle errors returned by pf_killstates() > > Happily this wasn't a real bug, because pf_killstates() never fails, > but > we should check the return value anyway, in case it does ever start > returning errors. > > Reported by: clang --analyze > MFC after: 1 week > Sponsored by: Rubicon Communications, LLC ("Netgate") > --- > sys/netpfil/pf/pf_ioctl.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c > index 19b92e932052..fece41e917e5 100644 > --- a/sys/netpfil/pf/pf_ioctl.c > +++ b/sys/netpfil/pf/pf_ioctl.c > @@ -4887,6 +4887,8 @@ pf_killstates_nv(struct pfioc_nv *nv) > ERROUT(error); > > error = pf_killstates(&kill, &killed); > + if (error) > + ERROUT(error); > > free(nvlpacked, M_NVLIST); > nvlpacked = NULL; > -- Mateusz Guzik