Patch "parisc: Fix csum_ipv6_magic on 32-bit systems" has been added to the 6.6-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

    parisc: Fix csum_ipv6_magic on 32-bit systems

to the 6.6-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:
     parisc-fix-csum_ipv6_magic-on-32-bit-systems.patch
and it can be found in the queue-6.6 subdirectory.

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



commit c9dd78a6bb90b5206fe88d551ffcdf6339ea380d
Author: Guenter Roeck <linux@xxxxxxxxxxxx>
Date:   Sat Feb 10 11:15:56 2024 -0800

    parisc: Fix csum_ipv6_magic on 32-bit systems
    
    [ Upstream commit 4408ba75e4ba80c91fde7e10bccccf388f5c09be ]
    
    Calculating the IPv6 checksum on 32-bit systems missed overflows when
    adding the proto+len fields into the checksum. This results in the
    following unit test failure.
    
        # test_csum_ipv6_magic: ASSERTION FAILED at lib/checksum_kunit.c:506
        Expected ( u64)csum_result == ( u64)expected, but
            ( u64)csum_result == 46722 (0xb682)
            ( u64)expected == 46721 (0xb681)
        not ok 5 test_csum_ipv6_magic
    
    This is probably rarely seen in the real world because proto+len are
    usually small values which will rarely result in overflows when calculating
    the checksum. However, the unit test code uses large values for the length
    field, causing the test to fail.
    
    Fix the problem by adding the missing carry into the final checksum.
    
    Cc: Palmer Dabbelt <palmer@xxxxxxxxxxxx>
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Tested-by: Charlie Jenkins <charlie@xxxxxxxxxxxx>
    Reviewed-by: Charlie Jenkins <charlie@xxxxxxxxxxxx>
    Signed-off-by: Helge Deller <deller@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/parisc/include/asm/checksum.h b/arch/parisc/include/asm/checksum.h
index f705e5dd10742..e619e67440db9 100644
--- a/arch/parisc/include/asm/checksum.h
+++ b/arch/parisc/include/asm/checksum.h
@@ -163,7 +163,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
 "	ldw,ma		4(%2), %7\n"	/* 4th daddr */
 "	addc		%6, %0, %0\n"
 "	addc		%7, %0, %0\n"
-"	addc		%3, %0, %0\n"	/* fold in proto+len, catch carry */
+"	addc		%3, %0, %0\n"	/* fold in proto+len */
+"	addc		0, %0, %0\n"	/* add carry */
 
 #endif
 	: "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len),




[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