lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <0aa915ca7e7c79daa0b323c3903aff2ba2cc25b3.camel@microchip.com> Date: Fri, 26 Aug 2022 11:27:49 +0200 From: Steen Hegelund <steen.hegelund@...rochip.com> To: Casper Andersson <casper.casan@...il.com>, "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com> CC: Lars Povlsen <lars.povlsen@...rochip.com>, <UNGLinuxDriver@...rochip.com>, Bjarni Jonasson <bjarni.jonasson@...rochip.com>, <netdev@...r.kernel.org> Subject: Re: [PATCH net] net: sparx5: fix handling uneven length packets in manual extraction Hi Casper, Good Catch. On Thu, 2022-08-25 at 10:49 +0200, Casper Andersson wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > Packets that are not of length divisible by 4 (e.g. 77, 78, 79) would > have the checksum included up to next multiple of 4 (a 77 bytes packet > would have 3 bytes of ethernet checksum included). The check for the > value expects it in host (Little) endian. > > Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support") > Signed-off-by: Casper Andersson <casper.casan@...il.com> > --- > drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c > b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c > index 304f84aadc36..21844beba72d 100644 > --- a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c > @@ -113,6 +113,8 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap) > /* This assumes STATUS_WORD_POS == 1, Status > * just after last data > */ > + if (!byte_swap) > + val = ntohl((__force __be32)val); > byte_cnt -= (4 - XTR_VALID_BYTES(val)); > eof_flag = true; > break; > -- > 2.34.1 > Reviewed-by: Steen Hegelund <Steen.Hegelund@...rochip.com> -- Best Regards Steen -=-=-=-=-=-=-=-=-=-=-=-=-=-= steen.hegelund@...rochip.com
Powered by blists - more mailing lists