All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH 0/5] Ensure the copied buf is NULL terminated
@ 2024-04-22 16:41 ` Bui Quang Minh
  0 siblings, 0 replies; 23+ messages in thread
From: Bui Quang Minh @ 2024-04-22 16:41 UTC (permalink / raw)
  To: Jesse Brandeburg, Tony Nguyen, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Paul M Stillwell Jr, Rasesh Mody,
	Sudarsana Kalluru, GR-Linux-NIC-Dev, Krishna Gudipati,
	Anil Gurumurthy, Sudarsana Kalluru, James E.J. Bottomley,
	Martin K. Petersen, Fabian Frederick, Saurav Kashyap, Javed Hasan,
	GR-QLogic-Storage-Upstream, Nilesh Javali, Arun Easi,
	Manish Rangankar, Vineeth Vijayan, Peter Oberparleiter,
	Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle
  Cc: Jens Axboe, linux-s390, linux-scsi, netdev, linux-kernel,
	intel-wired-lan, Saurav Kashyap, Bui Quang Minh

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@gmail.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

 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,
-- 
Bui Quang Minh <minhquangbui99@gmail.com>


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2024-04-24 15:19 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22 16:41 [Intel-wired-lan] [PATCH 0/5] Ensure the copied buf is NULL terminated Bui Quang Minh
2024-04-22 16:41 ` Bui Quang Minh
2024-04-22 16:41 ` [Intel-wired-lan] [PATCH 1/5] drivers/net/ethernet/intel-ice: ensure " Bui Quang Minh
2024-04-22 16:41   ` Bui Quang Minh
2024-04-23  9:20   ` [Intel-wired-lan] " Przemek Kitszel
2024-04-23  9:20     ` Przemek Kitszel
2024-04-22 16:41 ` [Intel-wired-lan] [PATCH 2/5] drivers/net/brocade-bnad: " Bui Quang Minh
2024-04-22 16:41   ` Bui Quang Minh
2024-04-22 16:41 ` [Intel-wired-lan] [PATCH 3/5] drivers/scsi/bfa/bfad: " Bui Quang Minh
2024-04-22 16:41   ` Bui Quang Minh
2024-04-22 16:41 ` [Intel-wired-lan] [PATCH 4/5] drivers/scsi/qedf: " Bui Quang Minh
2024-04-22 16:41   ` Bui Quang Minh
2024-04-22 16:41 ` [Intel-wired-lan] [PATCH 5/5] drivers/s390/cio: " Bui Quang Minh
2024-04-22 16:41   ` Bui Quang Minh
2024-04-23  6:50   ` [Intel-wired-lan] " Heiko Carstens
2024-04-23  6:50     ` Heiko Carstens
2024-04-23 14:46     ` [Intel-wired-lan] " Bui Quang Minh
2024-04-23 14:46       ` Bui Quang Minh
2024-04-24 11:55       ` [Intel-wired-lan] " Heiko Carstens
2024-04-24 11:55         ` Heiko Carstens
2024-04-23 11:10 ` [Intel-wired-lan] [PATCH 0/5] Ensure " Marcin Szycik
2024-04-23 11:25   ` Przemek Kitszel
2024-04-23 11:25     ` Przemek Kitszel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.