Patch "net: mvvp2: fix short frame size on s390" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: mvvp2: fix short frame size on s390

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-mvvp2-fix-short-frame-size-on-s390.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6981715e1000453455de45d50805978d06cdc8f2
Author: John Hubbard <jhubbard@xxxxxxxxxx>
Date:   Thu Aug 5 23:53:30 2021 -0700

    net: mvvp2: fix short frame size on s390
    
    [ Upstream commit 704e624f7b3e8a4fc1ce43fb564746d1d07b20c0 ]
    
    On s390, the following build warning occurs:
    
    drivers/net/ethernet/marvell/mvpp2/mvpp2.h:844:2: warning: overflow in
    conversion from 'long unsigned int' to 'int' changes value from
    '18446744073709551584' to '-32' [-Woverflow]
    844 |  ((total_size) - MVPP2_SKB_HEADROOM - MVPP2_SKB_SHINFO_SIZE)
    
    This happens because MVPP2_SKB_SHINFO_SIZE, which is 320 bytes (which is
    already 64-byte aligned) on some architectures, actually gets ALIGN'd up
    to 512 bytes in the s390 case.
    
    So then, when this is invoked:
    
        MVPP2_RX_MAX_PKT_SIZE(MVPP2_BM_SHORT_FRAME_SIZE)
    
    ...that turns into:
    
         704 - 224 - 512 == -32
    
    ...which is not a good frame size to end up with! The warning above is a
    bit lucky: it notices a signed/unsigned bad behavior here, which leads
    to the real problem of a frame that is too short for its contents.
    
    Increase MVPP2_BM_SHORT_FRAME_SIZE by 32 (from 704 to 736), which is
    just exactly big enough. (The other values can't readily be changed
    without causing a lot of other problems.)
    
    Fixes: 07dd0a7aae7f ("mvpp2: add basic XDP support")
    Cc: Sven Auhagen <sven.auhagen@xxxxxxxxxxxx>
    Cc: Matteo Croce <mcroce@xxxxxxxxxxxxx>
    Cc: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
index 4a61c90003b5..722209a14f53 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
@@ -938,7 +938,7 @@ enum mvpp22_ptp_packet_format {
 #define MVPP2_BM_COOKIE_POOL_OFFS	8
 #define MVPP2_BM_COOKIE_CPU_OFFS	24
 
-#define MVPP2_BM_SHORT_FRAME_SIZE	704	/* frame size 128 */
+#define MVPP2_BM_SHORT_FRAME_SIZE	736	/* frame size 128 */
 #define MVPP2_BM_LONG_FRAME_SIZE	2240	/* frame size 1664 */
 #define MVPP2_BM_JUMBO_FRAME_SIZE	10432	/* frame size 9856 */
 /* BM short pool packet size



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux