[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eb54c7bb-db63-4361-b42f-dc02e2c37fbf@linux.intel.com>
Date: Tue, 23 Apr 2024 13:10:16 +0200
From: Marcin Szycik <marcin.szycik@...ux.intel.com>
To: Bui Quang Minh <minhquangbui99@...il.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Paul M Stillwell Jr <paul.m.stillwell.jr@...el.com>,
Rasesh Mody <rmody@...vell.com>, Sudarsana Kalluru <skalluru@...vell.com>,
GR-Linux-NIC-Dev@...vell.com, Krishna Gudipati <kgudipat@...cade.com>,
Anil Gurumurthy <anil.gurumurthy@...gic.com>,
Sudarsana Kalluru <sudarsana.kalluru@...gic.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Fabian Frederick <fabf@...net.be>, Saurav Kashyap <skashyap@...vell.com>,
Javed Hasan <jhasan@...vell.com>, GR-QLogic-Storage-Upstream@...vell.com,
Nilesh Javali <nilesh.javali@...ium.com>, Arun Easi <arun.easi@...ium.com>,
Manish Rangankar <manish.rangankar@...ium.com>,
Vineeth Vijayan <vneethv@...ux.ibm.com>,
Peter Oberparleiter <oberpar@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>
Cc: Jens Axboe <axboe@...nel.dk>, linux-s390@...r.kernel.org,
linux-scsi@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, intel-wired-lan@...ts.osuosl.org,
Saurav Kashyap <saurav.kashyap@...ium.com>
Subject: Re: [Intel-wired-lan] [PATCH 0/5] Ensure the copied buf is NULL
terminated
On 22.04.2024 18:41, Bui Quang Minh wrote:
> Hi everyone,
>
> I found that some drivers contains an out-of-bound read pattern like this
>
> kern_buf = memdup_user(user_buf, count);
> ...
> sscanf(kern_buf, ...);
>
> The sscanf can be replaced by some other string-related functions. This
> pattern can lead to out-of-bound read of kern_buf in string-related
> functions.
>
> This series fix the above issue by replacing memdup_user with
> memdup_user_nul or allocating count + 1 buffer then writing the NULL
> terminator to end of buffer after userspace copying.
>
> Thanks,
> Quang Minh.
>
> Signed-off-by: Bui Quang Minh <minhquangbui99@...il.com>
> ---
> Bui Quang Minh (5):
> drivers/net/ethernet/intel-ice: ensure the copied buf is NULL terminated
> drivers/net/brocade-bnad: ensure the copied buf is NULL terminated
> drivers/scsi/bfa/bfad: ensure the copied buf is NULL terminated
> drivers/scsi/qedf: ensure the copied buf is NULL terminated
> drivers/s390/cio: ensure the copied buf is NULL terminated
Typically you don't include path to module in title, instead:
ice: ensure the copied buf is NULL terminated
bna: ensure the copied buf is NULL terminated
etc.
>
> drivers/net/ethernet/brocade/bna/bnad_debugfs.c | 4 ++--
> drivers/net/ethernet/intel/ice/ice_debugfs.c | 8 ++++----
> drivers/s390/cio/cio_inject.c | 3 ++-
> drivers/scsi/bfa/bfad_debugfs.c | 4 ++--
> drivers/scsi/qedf/qedf_debugfs.c | 2 +-
> 5 files changed, 11 insertions(+), 10 deletions(-)
> ---
> base-commit: ed30a4a51bb196781c8058073ea720133a65596f
> change-id: 20240422-fix-oob-read-19ae7f8f3711
>
> Best regards,
Thanks,
Marcin
Powered by blists - more mailing lists