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
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00f5e816-49b1-d642-39e4-1e394ae0ce0f@gmail.com>
Date:   Sat, 13 Feb 2021 17:19:58 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Vladimir Oltean <olteanv@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Cc:     Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Richard Cochran <richardcochran@...il.com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Vladimir Oltean <vladimir.oltean@....com>,
        Maxim Kochetkov <fido_max@...ox.ru>,
        UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v2 net-next 02/12] net: mscc: ocelot: only drain
 extraction queue on error



On 2/13/2021 14:37, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@....com>
> 
> It appears that the intention of this snippet of code is to not exit
> ocelot_xtr_irq_handler() while in the middle of extracting a frame.
> The problem in extracting it word by word is that future extraction
> attempts are really easy to get desynchronized, since the IRQ handler
> assumes that the first 16 bytes are the IFH, which give further
> information about the frame, such as frame length.
> 
> But during normal operation, "err" will not be 0, but 4, set from here:
> 
> 		for (i = 0; i < OCELOT_TAG_LEN / 4; i++) {
> 			err = ocelot_rx_frame_word(ocelot, grp, true, &ifh[i]);
> 			if (err != 4)
> 				break;
> 		}
> 
> 		if (err != 4)
> 			break;
> 
> In that case, draining the extraction queue is a no-op. So explicitly
> make this code execute only on negative err.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>

Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ