mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
This shall help avoid copying uninitialized memory to the userspace when calling ioctl(fd, SG_IO) with an empty command. Reported-by: [email protected] Cc: [email protected] Signed-off-by: Alexander Potapenko <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
1 parent
a406b0a069
commit
a45b599ad8
1 file changed
+1
-1
+1
-1
@@ -1894,7 +1894,7 @@ retry:
|
||||
num = (rem_sz > scatter_elem_sz_prev) ?
|
||||
scatter_elem_sz_prev : rem_sz;
|
||||
|
||||
schp->pages[k] = alloc_pages(gfp_mask, order);
|
||||
schp->pages[k] = alloc_pages(gfp_mask | __GFP_ZERO, order);
|
||||
if (!schp->pages[k])
|
||||
goto out;
|
||||
|
||||
|
||||
Reference in new issue
Block a user