mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] staging: gpib: fix unset padding field copy back to userspace
@ 2025-06-23 22:09 Colin Ian King
  2025-06-23 22:25 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Colin Ian King @ 2025-06-23 22:09 UTC (permalink / raw)
  To: Dave Penkler, Greg Kroah-Hartman, Michael Rubin, linux-staging
  Cc: kernel-janitors, linux-kernel

The introduction of a padding field in the gpib_board_info_ioctl is
showing up as initialized data on the stack frame being copyied back
to userspace in function board_info_ioctl. The simplest fix is to
initialize the entire struct to zero to ensure all unassigned padding
fields are zero'd before being copied back to userspace.

Fixes: b8394732ff0c ("staging: gpib: Add bit and byte padding to ioctl structs")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/staging/gpib/common/gpib_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index a193d64db033..93ef5f6ce249 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -1774,7 +1774,7 @@ static int query_board_rsv_ioctl(struct gpib_board *board, unsigned long arg)
 
 static int board_info_ioctl(const struct gpib_board *board, unsigned long arg)
 {
-	struct gpib_board_info_ioctl info;
+	struct gpib_board_info_ioctl info = { };
 	int retval;
 
 	info.pad = board->pad;
-- 
2.50.0


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

end of thread, other threads:[~2025-06-23 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-23 22:09 [PATCH][next] staging: gpib: fix unset padding field copy back to userspace Colin Ian King
2025-06-23 22:25 ` Dan Carpenter
2025-06-23 22:55   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®