summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2022-04-11 20:47:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-27 15:38:58 +0300
commit914473a0708874c69895f5f809b686f1797169a9 (patch)
treed473225464a40eee13a2c5608ba688ebcaec6dee /kernel
parentf0cfae3e0d3a95118b883d4ff577043d211f4f47 (diff)
downloadlinux-914473a0708874c69895f5f809b686f1797169a9.tar.xz
scsi: sr: Do not leak information in ioctl
[ Upstream commit faad6cebded8e0fd902b672f220449b93db479eb ] sr_ioctl.c uses this pattern: result = sr_do_ioctl(cd, &cgc); to-user = buffer[]; kfree(buffer); return result; Use of a buffer without checking leaks information. Check result and jump over the use of buffer if there is an error. result = sr_do_ioctl(cd, &cgc); if (result) goto err; to-user = buffer[]; err: kfree(buffer); return result; Additionally, initialize the buffer to zero. This problem can be seen in the 2.4.0 kernel. Link: https://lore.kernel.org/r/20220411174756.2418435-1-trix@redhat.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions