+ lib-globc-added-null-check-for-character-class.patch added to mm-nonmm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib: glob.c: added null check for character class
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     lib-globc-added-null-check-for-character-class.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/lib-globc-added-null-check-for-character-class.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Alok Swaminathan <swaminathanalok@xxxxxxxxx>
Subject: lib: glob.c: added null check for character class
Date: Mon, 26 Aug 2024 11:57:09 -0400

Add null check for character class.  Previously, an inverted character
class could result in a nul byte being matched and lead to the function
reading past the end of the inputted string.

Link: https://lkml.kernel.org/r/20240826155709.12383-1-swaminathanalok@xxxxxxxxx
Signed-off-by: Alok Swaminathan <swaminathanalok@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/glob.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/lib/glob.c~lib-globc-added-null-check-for-character-class
+++ a/lib/glob.c
@@ -68,6 +68,8 @@ bool __pure glob_match(char const *pat,
 			back_str = --str;	/* Allow zero-length match */
 			break;
 		case '[': {	/* Character class */
+			if (c == '\0')	/* No possible match */
+				return false;
 			bool match = false, inverted = (*pat == '!');
 			char const *class = pat + inverted;
 			unsigned char a = *class++;
_

Patches currently in -mm which might be from swaminathanalok@xxxxxxxxx are

lib-globc-added-null-check-for-character-class.patch





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux