From: Thorsten Blum <thorsten.blum@linux.dev>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Jens Axboe <axboe@kernel.dk>, Al Viro <viro@zeniv.linux.org.uk>,
Kees Cook <kees@kernel.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] m68k: emu: Replace unbounded sprintf in nfhd_init_one
Date: Wed, 18 Mar 2026 01:16:33 +0100 [thread overview]
Message-ID: <20260318001632.2974-3-thorsten.blum@linux.dev> (raw)
Replace unbounded sprintf() with the safer snprintf().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/m68k/emu/nfblock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c
index 93536cf2a38e..fa6256c5af22 100644
--- a/arch/m68k/emu/nfblock.c
+++ b/arch/m68k/emu/nfblock.c
@@ -132,7 +132,8 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
dev->disk->minors = 16;
dev->disk->fops = &nfhd_ops;
dev->disk->private_data = dev;
- sprintf(dev->disk->disk_name, "nfhd%u", dev_id);
+ snprintf(dev->disk->disk_name, sizeof(dev->disk->disk_name), "nfhd%u",
+ dev_id);
set_capacity(dev->disk, (sector_t)blocks * (bsize / 512));
err = add_disk(dev->disk);
if (err)
next reply other threads:[~2026-03-18 0:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 0:16 Thorsten Blum [this message]
2026-03-20 19:16 ` [PATCH RESEND] m68k: emu: Replace unbounded sprintf in nfhd_init_one Kees Cook
2026-03-30 9:46 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260318001632.2974-3-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=axboe@kernel.dk \
--cc=geert@linux-m68k.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=martin.petersen@oracle.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.