linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4 V2] net: atlantic: more fuzzing fixes
@ 2022-05-10  2:28 Grant Grundler
  2022-05-10  2:28 ` [PATCH 1/4] net: atlantic: fix "frag[0] not initialized" Grant Grundler
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Grant Grundler @ 2022-05-10  2:28 UTC (permalink / raw)
  To: Igor Russkikh
  Cc: Jakub Kicinski, Paolo Abeni, netdev, David S . Miller, LKML,
	Aashay Shringarpure, Yi Chou, Shervin Oloumi, Grant Grundler

The Chrome OS fuzzing team posted a "Fuzzing" report for atlantic driver
in Q4 2021 using Chrome OS v5.4 kernel and "Cable Matters
Thunderbolt 3 to 10 Gb Ethernet" (b0 version):
    https://docs.google.com/document/d/e/2PACX-1vT4oCGNhhy_AuUqpu6NGnW0N9HF_jxf2kS7raOpOlNRqJNiTHAtjiHRthXYSeXIRTgfeVvsEt0qK9qK/pub

It essentially describes four problems:
1) validate rxd_wb->next_desc_ptr before populating buff->next
2) "frag[0] not initialized" case in aq_ring_rx_clean()
3) limit iterations handling fragments in aq_ring_rx_clean()
4) validate hw_head_ in hw_atl_b0_hw_ring_tx_head_update()

(1) was fixed by Zekun Shen <bruceshenzk@gmail.com> around the same time with
"atlantic: Fix buff_ring OOB in aq_ring_rx_clean" (SHA1 5f50153288452e10).

I've added one "clean up" contribution:
    "net: atlantic: reduce scope of is_rsc_complete"

I tested the "original" patches using chromeos-v5.4 kernel branch:
    https://chromium-review.googlesource.com/q/hashtag:pcinet-atlantic-2022q1+(status:open%20OR%20status:merged)

I've forward ported those patches to 5.18-rc2 and compiled them but am
unable to test them on 5.18-rc2 kernel (logistics problems).

Credit largely goes to ChromeOS Fuzzing team members:
    Aashay Shringarpure, Yi Chou, Shervin Oloumi

V2 changes:
o drop first patch - was already fixed upstream differently
o reduce (4) "validate hw_head_" to simple bounds checking.

 drivers/net/ethernet/aquantia/atlantic/aq_ring.c        | 17 ++++++++++-------
 .../net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c   |  6 ++++++
 2 files changed, 16 insertions(+), 7 deletions(-)

cheers,
grant

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-11 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10  2:28 [PATCH 0/4 V2] net: atlantic: more fuzzing fixes Grant Grundler
2022-05-10  2:28 ` [PATCH 1/4] net: atlantic: fix "frag[0] not initialized" Grant Grundler
2022-05-10  2:28 ` [PATCH 2/4] net: atlantic: reduce scope of is_rsc_complete Grant Grundler
2022-05-10  2:28 ` [PATCH 3/4] net: atlantic: add check for MAX_SKB_FRAGS Grant Grundler
2022-05-10  2:28 ` [PATCH 4/4] net: atlantic: verify hw_head_ lies within TX buffer ring Grant Grundler
2022-05-11 11:30 ` [PATCH 0/4 V2] net: atlantic: more fuzzing fixes patchwork-bot+netdevbpf

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).