Patch "netlink: add nla be16/32 types to minlen array" 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

    netlink: add nla be16/32 types to minlen array

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:
     netlink-add-nla-be16-32-types-to-minlen-array.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 63fa5b541f6e8c649fc50949d81f4f6729e2f120
Author: Florian Westphal <fw@xxxxxxxxx>
Date:   Wed Feb 21 18:27:33 2024 +0100

    netlink: add nla be16/32 types to minlen array
    
    [ Upstream commit 9a0d18853c280f6a0ee99f91619f2442a17a323a ]
    
    BUG: KMSAN: uninit-value in nla_validate_range_unsigned lib/nlattr.c:222 [inline]
    BUG: KMSAN: uninit-value in nla_validate_int_range lib/nlattr.c:336 [inline]
    BUG: KMSAN: uninit-value in validate_nla lib/nlattr.c:575 [inline]
    BUG: KMSAN: uninit-value in __nla_validate_parse+0x2e20/0x45c0 lib/nlattr.c:631
     nla_validate_range_unsigned lib/nlattr.c:222 [inline]
     nla_validate_int_range lib/nlattr.c:336 [inline]
     validate_nla lib/nlattr.c:575 [inline]
    ...
    
    The message in question matches this policy:
    
     [NFTA_TARGET_REV]       = NLA_POLICY_MAX(NLA_BE32, 255),
    
    but because NLA_BE32 size in minlen array is 0, the validation
    code will read past the malformed (too small) attribute.
    
    Note: Other attributes, e.g. BITFIELD32, SINT, UINT.. are also missing:
    those likely should be added too.
    
    Reported-by: syzbot+3f497b07aa3baf2fb4d0@xxxxxxxxxxxxxxxxxxxxxxxxx
    Reported-by: xingwei lee <xrivendell7@xxxxxxxxx>
    Closes: https://lore.kernel.org/all/CABOYnLzFYHSnvTyS6zGa-udNX55+izqkOt2sB9WDqUcEGW6n8w@xxxxxxxxxxxxxx/raw
    Fixes: ecaf75ffd5f5 ("netlink: introduce bigendian integer types")
    Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20240221172740.5092-1-fw@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/lib/nlattr.c b/lib/nlattr.c
index 7a2b6c38fd597..ba698a097fc81 100644
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -30,6 +30,8 @@ static const u8 nla_attr_len[NLA_TYPE_MAX+1] = {
 	[NLA_S16]	= sizeof(s16),
 	[NLA_S32]	= sizeof(s32),
 	[NLA_S64]	= sizeof(s64),
+	[NLA_BE16]	= sizeof(__be16),
+	[NLA_BE32]	= sizeof(__be32),
 };
 
 static const u8 nla_attr_minlen[NLA_TYPE_MAX+1] = {
@@ -43,6 +45,8 @@ static const u8 nla_attr_minlen[NLA_TYPE_MAX+1] = {
 	[NLA_S16]	= sizeof(s16),
 	[NLA_S32]	= sizeof(s32),
 	[NLA_S64]	= sizeof(s64),
+	[NLA_BE16]	= sizeof(__be16),
+	[NLA_BE32]	= sizeof(__be32),
 };
 
 /*




[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