From: Jakub Kicinski <kuba@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Eric Dumazet <edumazet@google.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
Paolo Abeni <pabeni@redhat.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [Intel-wired-lan] [PATCH net] ice: Fix freeing uninitialized pointers
Date: Tue, 19 Mar 2024 12:43:17 -0700 [thread overview]
Message-ID: <20240319124317.3c3f16cd@kernel.org> (raw)
In-Reply-To: <77145930-e3df-4e77-a22d-04851cf3a426@moroto.mountain>
On Sat, 16 Mar 2024 12:44:40 +0300 Dan Carpenter wrote:
> - struct ice_aqc_get_phy_caps_data *pcaps __free(kfree);
> - void *mac_buf __free(kfree);
> + struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL;
> + void *mac_buf __free(kfree) = NULL;
This is just trading one kind of bug for another, and the __free()
magic is at a cost of readability.
I think we should ban the use of __free() in all of networking,
until / unless it cleanly handles the NULL init case.
WARNING: multiple messages have this Message-ID (diff)
From: Jakub Kicinski <kuba@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH net] ice: Fix freeing uninitialized pointers
Date: Tue, 19 Mar 2024 12:43:17 -0700 [thread overview]
Message-ID: <20240319124317.3c3f16cd@kernel.org> (raw)
In-Reply-To: <77145930-e3df-4e77-a22d-04851cf3a426@moroto.mountain>
On Sat, 16 Mar 2024 12:44:40 +0300 Dan Carpenter wrote:
> - struct ice_aqc_get_phy_caps_data *pcaps __free(kfree);
> - void *mac_buf __free(kfree);
> + struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL;
> + void *mac_buf __free(kfree) = NULL;
This is just trading one kind of bug for another, and the __free()
magic is at a cost of readability.
I think we should ban the use of __free() in all of networking,
until / unless it cleanly handles the NULL init case.
next prev parent reply other threads:[~2024-03-19 19:43 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-16 9:44 [Intel-wired-lan] [PATCH net] ice: Fix freeing uninitialized pointers Dan Carpenter
2024-03-16 9:44 ` Dan Carpenter
2024-03-18 7:58 ` [Intel-wired-lan] " Jiri Pirko
2024-03-18 7:58 ` Jiri Pirko
2024-03-18 8:10 ` [Intel-wired-lan] " Dan Carpenter
2024-03-18 8:10 ` Dan Carpenter
2024-03-19 19:43 ` Jakub Kicinski [this message]
2024-03-19 19:43 ` Jakub Kicinski
2024-03-20 5:01 ` [Intel-wired-lan] " Dan Carpenter
2024-03-20 5:01 ` Dan Carpenter
2024-03-20 7:32 ` [Intel-wired-lan] " Julia Lawall
2024-03-20 7:32 ` Julia Lawall
2024-03-20 16:33 ` [Intel-wired-lan] " Jonathan Cameron
2024-03-20 16:33 ` Jonathan Cameron
2024-03-21 3:29 ` [Intel-wired-lan] " Jakub Kicinski
2024-03-21 3:29 ` Jakub Kicinski
2024-03-21 9:59 ` [Intel-wired-lan] " Przemek Kitszel
2024-03-21 9:59 ` Przemek Kitszel
2024-03-21 10:34 ` [Intel-wired-lan] " Dan Carpenter
2024-03-21 10:34 ` Dan Carpenter
2024-03-20 12:18 ` [Intel-wired-lan] " Markus Elfring
2024-03-20 12:18 ` Markus Elfring
2024-03-21 17:59 ` [Intel-wired-lan] " Markus Elfring
2024-03-21 17:59 ` Markus Elfring
2024-03-21 18:03 ` [Intel-wired-lan] " Andy Shevchenko
2024-03-21 18:03 ` Andy Shevchenko
2024-03-21 18:14 ` [Intel-wired-lan] " Markus Elfring
2024-03-21 18:14 ` Markus Elfring
2024-03-21 20:20 ` [Intel-wired-lan] " Julia Lawall
2024-03-21 20:20 ` Julia Lawall
2024-03-21 22:27 ` [Intel-wired-lan] " Jesse Brandeburg
2024-03-21 22:27 ` Jesse Brandeburg
2024-03-22 1:48 ` [Intel-wired-lan] " Jakub Kicinski
2024-03-22 1:48 ` Jakub Kicinski
2024-03-22 1:56 ` [Intel-wired-lan] " Jakub Kicinski
2024-03-22 1:56 ` Jakub Kicinski
2024-03-22 7:24 ` [Intel-wired-lan] " Julia Lawall
2024-03-22 7:24 ` Julia Lawall
2024-03-22 15:03 ` [Intel-wired-lan] " Jakub Kicinski
2024-03-22 15:03 ` Jakub Kicinski
2024-03-22 5:30 ` [Intel-wired-lan] " Dan Carpenter
2024-03-22 5:30 ` Dan Carpenter
2024-03-22 8:48 ` [Intel-wired-lan] " Markus Elfring
2024-03-22 8:48 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240319124317.3c3f16cd@kernel.org \
--to=kuba@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.