浏览代码

firewire: core: fix an information leak

If a device exposes a sparsely populated configuration ROM,
firewire-core's sysfs interface and character device file interface
showed random data in the gaps between config ROM blocks.  Fix this by
zero-initialization of the config ROM reader's scratch buffer.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter 15 年之前
父节点
当前提交
137d9ebfdb
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/firewire/core-device.c

+ 1 - 0
drivers/firewire/core-device.c

@@ -514,6 +514,7 @@ static int read_bus_info_block(struct fw_device *device, int generation)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	stack = &rom[READ_BIB_ROM_SIZE];
 	stack = &rom[READ_BIB_ROM_SIZE];
+	memset(rom, 0, sizeof(*rom) * READ_BIB_ROM_SIZE);
 
 
 	device->max_speed = SCODE_100;
 	device->max_speed = SCODE_100;