mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leo Stone <leocstone@gmail.com>
To: syzbot+7741f872f3c53385a2e2@syzkaller.appspotmail.com
Cc: dhowells@redhat.com, linux-afs@lists.infradead.org,
	linux-kernel@vger.kernel.org, marc.dionne@auristor.com,
	syzkaller-bugs@googlegroups.com, Leo Stone <leocstone@gmail.com>
Subject: [PATCH] afs: check for NULL terminator
Date: Tue, 17 Dec 2024 11:10:52 -0800	[thread overview]
Message-ID: <20241217191051.77935-2-leocstone@gmail.com> (raw)
In-Reply-To: <6761b929.050a0220.29fcd0.006f.GAE@google.com>

Add a missing check for reaching the end of the string while attempting
to split a command.

Reported-by: syzbot+7741f872f3c53385a2e2@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7741f872f3c53385a2e2
Signed-off-by: Leo Stone <leocstone@gmail.com>
---
 fs/afs/addr_prefs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/afs/addr_prefs.c b/fs/afs/addr_prefs.c
index a189ff8a5034..4f8553aa5931 100644
--- a/fs/afs/addr_prefs.c
+++ b/fs/afs/addr_prefs.c
@@ -48,7 +48,7 @@ static int afs_split_string(char **pbuf, char *strv[], unsigned int maxstrv)
 		strv[count++] = p;
 
 		/* Skip over word */
-		while (!isspace(*p))
+		while (!isspace(*p) && *p)
 			p++;
 		if (!*p)
 			break;
-- 
2.43.0


  reply	other threads:[~2024-12-17 19:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17 17:47 [syzbot] [afs?] KASAN: slab-out-of-bounds Read in afs_proc_addr_prefs_write syzbot
2024-12-17 19:10 ` Leo Stone [this message]
2024-12-18 10:58 ` [PATCH] afs: check for NULL terminator David Howells

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=20241217191051.77935-2-leocstone@gmail.com \
    --to=leocstone@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=syzbot+7741f872f3c53385a2e2@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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 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®