]> git.baikalelectronics.ru Git - kernel.git/commit
firewire: fix potential uaf in outbound_phy_packet_callback()
authorChengfeng Ye <cyeaa@connect.ust.hk>
Sat, 9 Apr 2022 04:12:41 +0000 (13:12 +0900)
committerTakashi Iwai <tiwai@suse.de>
Mon, 25 Apr 2022 06:01:07 +0000 (08:01 +0200)
commit3499b0b50cf1b6dbbd8ca6d0c1576391d8a42d71
tree346cbab9901472a9df4a811d7a55bbd221dd3d3f
parent6d94017b7b59bab528be97be158d0d602982e3a6
firewire: fix potential uaf in outbound_phy_packet_callback()

&e->event and e point to the same address, and &e->event could
be freed in queue_event. So there is a potential uaf issue if
we dereference e after calling queue_event(). Fix this by adding
a temporary variable to maintain e->client in advance, this can
avoid the potential uaf issue.

Cc: <stable@vger.kernel.org>
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20220409041243.603210-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
drivers/firewire/core-cdev.c