Skip to contentSkip to conversation

cifs: ntstatus_to_dos_map[] is not terminated

PATCH Applied Tim Gardner 3 participants 3 messages Oct 13, 2013 – Oct 14, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: ntstatus_to_dos_map[] is not terminated

Functions that walk the ntstatus_to_dos_map[] array could run off the end. For example, ntstatus_to_dos() loops while ntstatus_to_dos_map[].ntstatus is not 0. Granted, this is mostly theoretical, but could be used as a DOS attack if the error code in the SMB header is bogus.

---
 fs/cifs/netmisc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/cifs/netmisc.c +3 -1
index af847e1..651a527 100644
@@ -780,7 +780,9 @@ static const struct {
 	ERRDOS, ERRnoaccess, 0xc0000290}, {
 	ERRDOS, ERRbadfunc, 0xc000029c}, {
 	ERRDOS, ERRsymlink, NT_STATUS_STOPPED_ON_SYMLINK}, {
-	ERRDOS, ERRinvlevel, 0x007c0001}, };
+	ERRDOS, ERRinvlevel, 0x007c0001}, {
+	0, 0, 0 }
+};
 
 /*****************************************************************************
  Print an error message from the status code
Signature · 1 line
1.7.9.5
Applied
#1 lore raw

Merged into cifs-2.6.git

(for-next and for-linus branches)

Thoughts about suitability for stable anyone?

Quoted 30 lines · Tim Gardner

Functions that walk the ntstatus_to_dos_map[] array could run off the end. For example, ntstatus_to_dos() loops while ntstatus_to_dos_map[].ntstatus is not 0. Granted, this is mostly theoretical, but could be used as a DOS attack if the error code in the SMB header is bogus.

---
 fs/cifs/netmisc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/cifs/netmisc.c +3 -2
index af847e1..651a527 100644
@@ -780,7 +780,9 @@ static const struct {
        ERRDOS, ERRnoaccess, 0xc0000290}, {
        ERRDOS, ERRbadfunc, 0xc000029c}, {
        ERRDOS, ERRsymlink, NT_STATUS_STOPPED_ON_SYMLINK}, {
-       ERRDOS, ERRinvlevel, 0x007c0001}, };
+       ERRDOS, ERRinvlevel, 0x007c0001}, {
+       0, 0, 0 }
+};
 
 /*****************************************************************************
  Print an error message from the status code
--

1.7.9.5

Signature · 3 lines
Thanks,

Steve
Reviewed-by on v1 1/1
#2 lore raw
In reply to Tim Gardner
Quoted 17 lines · On Sun, 13 Oct 2013 13:29:03 -0600 Tim Gardner…

Functions that walk the ntstatus_to_dos_map[] array could run off the end. For example, ntstatus_to_dos() loops while ntstatus_to_dos_map[].ntstatus is not 0. Granted, this is mostly theoretical, but could be used as a DOS attack if the error code in the SMB header is bogus.

---
 fs/cifs/netmisc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/cifs/netmisc.c +0 -0
index af847e1..651a527 100644

fs/cifs/netmisc.c static const struct { · line 788

Quoted 10 lines
fs/cifs/netmisc.c +3 -1
@@ -780,7 +780,9 @@ static const struct {
 	ERRDOS, ERRnoaccess, 0xc0000290}, {
 	ERRDOS, ERRbadfunc, 0xc000029c}, {
 	ERRDOS, ERRsymlink, NT_STATUS_STOPPED_ON_SYMLINK}, {
-	ERRDOS, ERRinvlevel, 0x007c0001}, };
+	ERRDOS, ERRinvlevel, 0x007c0001}, {
+	0, 0, 0 }
+};
 
 /*****************************************************************************
  Print an error message from the status code

Nice catch.