stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Di Zhu <zhudi2@huawei.com>, Rui Zhang <zhangrui182@huawei.com>,
	Gurucharan G <gurucharanx.g@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>
Subject: Re: [PATCH 4.19 06/21] i40e: fix use-after-free in i40e_sync_filters_subtask()
Date: Mon, 10 Jan 2022 11:10:01 +0100	[thread overview]
Message-ID: <20220110101001.GB5588@duo.ucw.cz> (raw)
In-Reply-To: <20220110071814.172190135@linuxfoundation.org>

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

Hi!

> commit 3116f59c12bd24c513194cd3acb3ec1f7d468954 upstream.
> 
> Using ifconfig command to delete the ipv6 address will cause
> the i40e network card driver to delete its internal mac_filter and
> i40e_service_task kernel thread will concurrently access the mac_filter.
> These two processes are not protected by lock
> so causing the following use-after-free problems.

Ok, but...

> +static void netdev_hw_addr_refcnt(struct i40e_mac_filter *f,
> +				  struct net_device *netdev, int delta)
> +{
> +	struct netdev_hw_addr *ha;
> +
> +	if (!f || !netdev)
> +		return;
> +
> +	netdev_for_each_mc_addr(ha, netdev) {
> +		if (ether_addr_equal(ha->addr, f->macaddr)) {
> +			ha->refcount += delta;
> +			if (ha->refcount <= 0)
> +				ha->refcount = 1;
> +			break;
> +		}
> +	}
> +}

What is going on here? Is refcount expected to underflow under normal
operation? Should we at least have WARN_ON there?

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2022-01-10 10:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10  7:23 [PATCH 4.19 00/21] 4.19.225-rc1 review Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 01/21] tracing: Fix check for trace_percpu_buffer validity in get_trace_buf() Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 02/21] tracing: Tag trace_percpu_buffer as a percpu pointer Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 03/21] ieee802154: atusb: fix uninit value in atusb_set_extended_addr Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 04/21] RDMA/core: Dont infoleak GRH fields Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 05/21] mac80211: initialize variable have_higher_than_11mbit Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 06/21] i40e: fix use-after-free in i40e_sync_filters_subtask() Greg Kroah-Hartman
2022-01-10 10:10   ` Pavel Machek [this message]
2022-01-10  7:23 ` [PATCH 4.19 07/21] i40e: Fix incorrect netdevs real number of RX/TX queues Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 08/21] ipv6: Check attribute length for RTA_GATEWAY in multipath route Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 09/21] ipv6: Check attribute length for RTA_GATEWAY when deleting " Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 10/21] sch_qfq: prevent shift-out-of-bounds in qfq_init_qdisc Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 11/21] xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 12/21] power: reset: ltc2952: Fix use of floating point literals Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 13/21] rndis_host: support Hytera digital radios Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 14/21] phonet: refcount leak in pep_sock_accep Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 15/21] ipv6: Continue processing multipath route even if gateway attribute is invalid Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 16/21] ipv6: Do cleanup if attribute validation fails in multipath route Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 17/21] usb: mtu3: fix interval value for intr and isoc Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 18/21] scsi: libiscsi: Fix UAF in iscsi_conn_get_param()/iscsi_conn_teardown() Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 19/21] ip6_vti: initialize __ip6_tnl_parm struct in vti6_siocdevprivate Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 20/21] net: udp: fix alignment problem in udp4_seq_show() Greg Kroah-Hartman
2022-01-10  7:23 ` [PATCH 4.19 21/21] mISDN: change function names to avoid conflicts Greg Kroah-Hartman
2022-01-10 11:49 ` [PATCH 4.19 00/21] 4.19.225-rc1 review Jon Hunter
2022-01-10 22:59 ` Shuah Khan
2022-01-10 23:49 ` Guenter Roeck
2022-01-11  0:49 ` Samuel Zou
2022-01-11  5:53 ` Naresh Kamboju
2022-01-11 11:35 ` Pavel Machek
2022-01-11 12:35 ` Sudip Mukherjee

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=20220110101001.GB5588@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=anthony.l.nguyen@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gurucharanx.g@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=zhangrui182@huawei.com \
    --cc=zhudi2@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).