libhsakmt: Sanity check node_id for NUMA binding
Ignore requests to bind to invalid NUMA nodes. This affects only legacy applications (such as KFDTest) that allocate system memory as paged memory with a GPU node ID. Change-Id: I81e514af6d0c1ab2ed5229adeeca1fa0ab2a0685 Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Este commit está contenido en:
1 padre
20cd954fe8
commit
4d7b0990e4
1 file changed
+6
@@ -1469,6 +1469,12 @@ static int bind_mem_to_numa(uint32_t node_id, void *mem,
|
||||
|
||||
num_node = numa_num_task_nodes();
|
||||
|
||||
/* Ignore binding requests to invalid nodes IDs */
|
||||
if (node_id >= (unsigned)num_node) {
|
||||
pr_warn("node_id %d >= num_node %d\n", node_id, num_node);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (num_node > 1) {
|
||||
node_mask = numa_bitmask_alloc(num_node);
|
||||
if (!node_mask)
|
||||
|
||||
Reference in new issue
Block a user