PCI: Add Edimax Vendor ID to pci_ids.h
Subsystems (5)
Sasha Levin
maintainerPATCH 1/4 PCI: Add Edimax Vendor ID to pci_ids.h
From: FUJITA Tomonori <[email protected]>
[ Upstream commit eee5528890d54b22b46f833002355a5ee94c3bb4 ]
Add the Edimax Vendor ID (0x1432) for an ethernet driver for Tehuti Networks TN40xx chips. This ID can be used for Realtek 8180 and Ralink rt28xx wireless drivers.
--- include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/pci_ids.h +2 -0
@@ -2136,6 +2136,8 @@#define PCI_VENDOR_ID_CHELSIO 0x1425 +#define PCI_VENDOR_ID_EDIMAX 0x1432 +#define PCI_VENDOR_ID_ADLINK 0x144a#define PCI_VENDOR_ID_SAMSUNG 0x144d
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/4 udf: prevent integer overflow in udf_bitmap_free_blocks()
From: Roman Smirnov <[email protected]>
[ Upstream commit 56e69e59751d20993f243fb7dd6991c4e522424c ]
An overflow may occur if the function is called with the last block and an offset greater than zero. It is necessary to add a check to avoid this.
Found by Linux Verification Center (linuxtesting.org) with Svace.
[JK: Make test cover also unalloc table freeing]
--- fs/udf/balloc.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-)
fs/udf/balloc.c +13 -23
@@ -22,6 +22,7 @@#include "udfdecl.h" #include <linux/bitops.h> +#include <linux/overflow.h> #include "udf_i.h" #include "udf_sb.h"
@@ -133,7 +134,6 @@ static void udf_bitmap_free_blocks(struct super_block *sb, {struct udf_sb_info *sbi =UDF_SB (sb);struct buffer_head *bh =NULL ; -struct udf_part_map *partmap;unsigned long block;unsigned long block_group;unsigned long bit;
@@ -142,19 +142,9 @@ static void udf_bitmap_free_blocks(struct super_block *sb,unsigned long overflow;mutex_lock (&sbi->s_alloc_mutex); - partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; -if (bloc->logicalBlockNum + count < count || - (bloc->logicalBlockNum + count) > partmap->s_partition_len) { -udf_debug ("%u < %d || %u + %u > %u\n" , - bloc->logicalBlockNum,0 , - bloc->logicalBlockNum, count, - partmap->s_partition_len); - goto error_return; - } - +/* We make sure this cannot overflow when mounting the filesystem */ block = bloc->logicalBlockNum + offset + (sizeof (struct spaceBitmapDesc ) <<3 ); - do { overflow = 0; block_group = block >> (sb->s_blocksize_bits + 3);
@@ -375,7 +365,6 @@ static void udf_table_free_blocks(struct super_block *sb, uint32_t count) {struct udf_sb_info *sbi =UDF_SB (sb); -struct udf_part_map *partmap;uint32_t start, end;uint32_t elen;struct kernel_lb_addr eloc;
@@ -384,16 +373,6 @@ static void udf_table_free_blocks(struct super_block *sb,struct udf_inode_info *iinfo;mutex_lock (&sbi->s_alloc_mutex); - partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; -if (bloc->logicalBlockNum + count < count || - (bloc->logicalBlockNum + count) > partmap->s_partition_len) { -udf_debug ("%u < %d || %u + %u > %u\n" , - bloc->logicalBlockNum,0 , - bloc->logicalBlockNum, count, - partmap->s_partition_len); - goto error_return; - } - iinfo =UDF_I (table);udf_add_free_space (sb, sbi->s_partition, count);
@@ -668,6 +647,17 @@ void udf_free_blocks(struct super_block *sb, struct inode *inode, {uint16_t partition = bloc->partitionReferenceNum;struct udf_part_map *map = &UDF_SB (sb)->s_partmaps[partition]; +uint32_t blk; + +if (check_add_overflow (bloc->logicalBlockNum, offset, &blk) || +check_add_overflow (blk, count, &blk) || + bloc->logicalBlockNum + count > map->s_partition_len) { +udf_debug ("Invalid request to free blocks: (%d, %u), off %u, " +"len %u, partition len %u\n" , + partition, bloc->logicalBlockNum, offset, count, + map->s_partition_len); +return ; + }if (map->s_partition_flags &UDF_PART_FLAG_UNALLOC_BITMAP ) { udf_bitmap_free_blocks(sb, map->s_uspace.s_bitmap,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 3/4 wifi: nl80211: don't give key data to userspace
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit a7e5793035792cc46a1a4b0a783655ffa897dfe9 ]
When a key is requested by userspace, there's really no need to include the key data, the sequence counter is really what userspace needs in this case. The fact that it's included is just a historic quirk.
Remove the key data.
--- net/wireless/nl80211.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
net/wireless/nl80211.c +2 -8
@@ -3383,10 +3383,7 @@ static void get_key_callback(void *c, struct key_params *params)struct nlattr *key;struct get_key_cookie *cookie = c; - if ((params->key && - nla_put(cookie->msg, NL80211_ATTR_KEY_DATA, - params->key_len, params->key)) || - (params->seq && + if ((params->seq && nla_put(cookie->msg, NL80211_ATTR_KEY_SEQ, params->seq_len, params->seq)) || (params->cipher &&
@@ -3398,10 +3395,7 @@ static void get_key_callback(void *c, struct key_params *params)if (!key) goto nla_put_failure; - if ((params->key && - nla_put(cookie->msg, NL80211_KEY_DATA, - params->key_len, params->key)) || - (params->seq && + if ((params->seq && nla_put(cookie->msg, NL80211_KEY_SEQ, params->seq_len, params->seq)) || (params->cipher &&
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/4 btrfs: fix bitmap leak when loading free space cache on duplicate entry
In reply to Sasha LevinFrom: Filipe Manana <[email protected]>
[ Upstream commit 320d8dc612660da84c3b70a28658bb38069e5a9a ]
If we failed to link a free space entry because there's already a conflicting entry for the same offset, we free the free space entry but we don't free the associated bitmap that we had just allocated before. Fix that by freeing the bitmap before freeing the entry.
--- fs/btrfs/free-space-cache.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/free-space-cache.c +1 -0
@@ -787,6 +787,7 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,spin_unlock (&ctl->tree_lock);btrfs_err (fs_info,"Duplicate entries in free space cache, dumping" ); +kmem_cache_free (btrfs_free_space_bitmap_cachep, e->bitmap);kmem_cache_free (btrfs_free_space_cachep, e); goto free_cache; }
Signature · 1 line
2.43.0