Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
32901365
Commit
32901365
authored
May 01, 2004
by
Steve French
Committed by
Steve French
May 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce excessive stack space usage in smb password hashing
parent
ff50da43
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
15 deletions
+46
-15
fs/cifs/CHANGES
fs/cifs/CHANGES
+2
-1
fs/cifs/smbdes.c
fs/cifs/smbdes.c
+44
-14
No files found.
fs/cifs/CHANGES
View file @
32901365
...
...
@@ -2,7 +2,8 @@ Version 1.13
------------
Fix open of files in which O_CREATE can cause the mode to change in
some cases. Fix case in which retry of write overlaps file close.
Fix PPC64 build error.
Fix PPC64 build error. Reduce excessive stack usage in smb password
hashing.
Version 1.12
------------
...
...
fs/cifs/smbdes.c
View file @
32901365
...
...
@@ -6,7 +6,7 @@
SMB authentication protocol
Copyright (C) Andrew Tridgell 1998
Modified by Steve French (sfrench@us.ibm.com) 2002,200
3
Modified by Steve French (sfrench@us.ibm.com) 2002,200
4
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -44,7 +44,7 @@
should confirm it for yourself (and maybe let me know if you come
up with a different answer to the one above)
*/
#include <linux/slab.h>
#define uchar unsigned char
static
uchar
perm1
[
56
]
=
{
57
,
49
,
41
,
33
,
25
,
17
,
9
,
...
...
@@ -191,14 +191,23 @@ static void
dohash
(
char
*
out
,
char
*
in
,
char
*
key
,
int
forw
)
{
int
i
,
j
,
k
;
char
pk1
[
56
]
;
char
*
pk1
;
char
c
[
28
];
char
d
[
28
];
char
cd
[
56
]
;
char
*
cd
;
char
ki
[
16
][
48
];
char
pd1
[
64
]
;
char
*
pd1
;
char
l
[
32
],
r
[
32
];
char
rl
[
64
];
char
*
rl
;
/* Have to reduce stack usage */
pk1
=
kmalloc
(
56
+
56
+
64
+
64
,
GFP_KERNEL
);
if
(
pk1
==
NULL
)
return
;
cd
=
pk1
+
56
;
pd1
=
cd
+
56
;
rl
=
pd1
+
64
;
permute
(
pk1
,
key
,
perm1
,
56
);
...
...
@@ -223,12 +232,22 @@ dohash(char *out, char *in, char *key, int forw)
}
for
(
i
=
0
;
i
<
16
;
i
++
)
{
char
er
[
48
];
char
erk
[
48
];
char
*
er
;
/* er[48] */
char
*
erk
;
/* erk[48] */
char
b
[
8
][
6
];
char
cb
[
32
];
char
pcb
[
32
];
char
r2
[
32
];
char
*
cb
;
/* cb[32] */
char
*
pcb
;
/* pcb[32] */
char
*
r2
;
/* r2[32] */
er
=
kmalloc
(
48
+
48
+
32
+
32
+
32
,
GFP_KERNEL
);
if
(
er
==
NULL
)
{
kfree
(
pk1
);
return
;
}
erk
=
er
+
48
;
cb
=
erk
+
48
;
pcb
=
cb
+
32
;
r2
=
pcb
+
32
;
permute
(
er
,
r
,
perm4
,
48
);
...
...
@@ -262,11 +281,14 @@ dohash(char *out, char *in, char *key, int forw)
for
(
j
=
0
;
j
<
32
;
j
++
)
r
[
j
]
=
r2
[
j
];
kfree
(
er
);
}
concat
(
rl
,
r
,
l
,
32
,
32
);
permute
(
out
,
rl
,
perm6
,
64
);
kfree
(
pk1
);
}
static
void
...
...
@@ -291,11 +313,18 @@ static void
smbhash
(
unsigned
char
*
out
,
unsigned
char
*
in
,
unsigned
char
*
key
,
int
forw
)
{
int
i
;
char
outb
[
64
];
char
inb
[
64
];
char
keyb
[
64
];
char
*
outb
;
/* outb[64] */
char
*
inb
;
/* inb[64] */
char
*
keyb
;
/* keyb[64] */
unsigned
char
key2
[
8
];
outb
=
kmalloc
(
64
*
3
,
GFP_KERNEL
);
if
(
outb
==
NULL
)
return
;
inb
=
outb
+
64
;
keyb
=
inb
+
64
;
str_to_key
(
key
,
key2
);
for
(
i
=
0
;
i
<
64
;
i
++
)
{
...
...
@@ -314,6 +343,7 @@ smbhash(unsigned char *out, unsigned char *in, unsigned char *key, int forw)
if
(
outb
[
i
])
out
[
i
/
8
]
|=
(
1
<<
(
7
-
(
i
%
8
)));
}
kfree
(
outb
);
}
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment