Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144729
b: refs/heads/master
c: b900870
h: refs/heads/master
i:
  144727: a3d8828
v: v3
  • Loading branch information
Luca Tettamanti authored and Jean Delvare committed May 8, 2009
1 parent 4e6f8b3 commit 0454aa1
Show file tree
Hide file tree
Showing 27 changed files with 1,657 additions and 836 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b20a4e9483df7469359f0c7f3f70bd2f5b78677f
refs/heads/master: b9008708f24de8fb9bdbfb5d3b27e36d5a357eda
4 changes: 2 additions & 2 deletions trunk/arch/microblaze/kernel/cpu/cpuinfo-static.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <asm/cpuinfo.h>
#include <asm/pvr.h>

static const char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
const static char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
const static char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;

#define err_printk(x) \
early_printk("ERROR: Microblaze " x "- different for kernel and DTS\n");
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/microblaze/kernel/sys_microblaze.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
ret = sys_shmctl(first, second, (struct shmid_ds *) ptr);
break;
}
return ret;
return -EINVAL;
}

asmlinkage int sys_vfork(struct pt_regs *regs)
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/hwmon/asus_atk0110.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ static int validate_hwmon_pack(struct atk_data *data, union acpi_object *obj)
return 0;
}

#ifdef DEBUG
static char const *atk_sensor_type(union acpi_object *flags)
{
u64 type = flags->integer.value & ATK_TYPE_MASK;
Expand All @@ -370,6 +371,7 @@ static char const *atk_sensor_type(union acpi_object *flags)

return what;
}
#endif

static void atk_print_sensor(struct atk_data *data, union acpi_object *obj)
{
Expand Down
13 changes: 0 additions & 13 deletions trunk/fs/cifs/CHANGES
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
Version 1.58
------------
Guard against buffer overruns in various UCS-2 to UTF-8 string conversions
when the UTF-8 string is composed of unusually long (more than 4 byte) converted
characters. Add support for mounting root of a share which redirects immediately
to DFS target. Convert string conversion functions from Unicode to more
accurately mark string length before allocating memory (which may help the
rare cases where a UTF-8 string is much larger than the UCS2 string that
we converted from). Fix endianness of the vcnum field used during
session setup to distinguish multiple mounts to same server from different
userids. Raw NTLMSSP fixed (it requires /proc/fs/cifs/experimental
flag to be set to 2, and mount must enable krb5 to turn on extended security).

Version 1.57
------------
Improve support for multiple security contexts to the same server. We
Expand Down
10 changes: 1 addition & 9 deletions trunk/fs/cifs/README
Original file line number Diff line number Diff line change
Expand Up @@ -651,15 +651,7 @@ Experimental When set to 1 used to enable certain experimental
signing turned on in case buffer was modified
just before it was sent, also this flag will
be used to use the new experimental directory change
notification code). When set to 2 enables
an additional experimental feature, "raw ntlmssp"
session establishment support (which allows
specifying "sec=ntlmssp" on mount). The Linux cifs
module will use ntlmv2 authentication encapsulated
in "raw ntlmssp" (not using SPNEGO) when
"sec=ntlmssp" is specified on mount.
This support also requires building cifs with
the CONFIG_CIFS_EXPERIMENTAL configuration flag.
notification code).

These experimental features and tracing can be enabled by changing flags in
/proc/fs/cifs (after the cifs module has been installed or built into the
Expand Down
32 changes: 18 additions & 14 deletions trunk/fs/cifs/cifs_dfs_ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,24 +340,28 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);

for (i = 0; i < num_referrals; i++) {
int len;
dump_referral(referrals+i);
/* connect to a node */
len = strlen(referrals[i].node_name);
if (len < 2) {
cERROR(1, ("%s: Net Address path too short: %s",
/* connect to a storage node */
if (referrals[i].flags & DFSREF_STORAGE_SERVER) {
int len;
len = strlen(referrals[i].node_name);
if (len < 2) {
cERROR(1, ("%s: Net Address path too short: %s",
__func__, referrals[i].node_name));
rc = -EINVAL;
goto out_err;
}
mnt = cifs_dfs_do_refmount(nd->path.mnt,
nd->path.dentry, referrals + i);
cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__,
rc = -EINVAL;
goto out_err;
}
mnt = cifs_dfs_do_refmount(nd->path.mnt,
nd->path.dentry,
referrals + i);
cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p",
__func__,
referrals[i].node_name, mnt));

/* complete mount procedure if we accured submount */
if (!IS_ERR(mnt))
break;
/* complete mount procedure if we accured submount */
if (!IS_ERR(mnt))
break;
}
}

/* we need it cause for() above could exit without valid submount */
Expand Down
198 changes: 17 additions & 181 deletions trunk/fs/cifs/cifs_unicode.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* fs/cifs/cifs_unicode.c
*
* Copyright (c) International Business Machines Corp., 2000,2009
* Copyright (c) International Business Machines Corp., 2000,2005
* Modified by Steve French (sfrench@us.ibm.com)
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -26,157 +26,31 @@
#include "cifs_debug.h"

/*
* cifs_ucs2_bytes - how long will a string be after conversion?
* @ucs - pointer to input string
* @maxbytes - don't go past this many bytes of input string
* @codepage - destination codepage
* NAME: cifs_strfromUCS()
*
* Walk a ucs2le string and return the number of bytes that the string will
* be after being converted to the given charset, not including any null
* termination required. Don't walk past maxbytes in the source buffer.
*/
int
cifs_ucs2_bytes(const __le16 *from, int maxbytes,
const struct nls_table *codepage)
{
int i;
int charlen, outlen = 0;
int maxwords = maxbytes / 2;
char tmp[NLS_MAX_CHARSET_SIZE];

for (i = 0; from[i] && i < maxwords; i++) {
charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp,
NLS_MAX_CHARSET_SIZE);
if (charlen > 0)
outlen += charlen;
else
outlen++;
}

return outlen;
}

/*
* cifs_mapchar - convert a little-endian char to proper char in codepage
* @target - where converted character should be copied
* @src_char - 2 byte little-endian source character
* @cp - codepage to which character should be converted
* @mapchar - should character be mapped according to mapchars mount option?
*
* This function handles the conversion of a single character. It is the
* responsibility of the caller to ensure that the target buffer is large
* enough to hold the result of the conversion (at least NLS_MAX_CHARSET_SIZE).
*/
static int
cifs_mapchar(char *target, const __le16 src_char, const struct nls_table *cp,
bool mapchar)
{
int len = 1;

if (!mapchar)
goto cp_convert;

/*
* BB: Cannot handle remapping UNI_SLASH until all the calls to
* build_path_from_dentry are modified, as they use slash as
* separator.
*/
switch (le16_to_cpu(src_char)) {
case UNI_COLON:
*target = ':';
break;
case UNI_ASTERIK:
*target = '*';
break;
case UNI_QUESTION:
*target = '?';
break;
case UNI_PIPE:
*target = '|';
break;
case UNI_GRTRTHAN:
*target = '>';
break;
case UNI_LESSTHAN:
*target = '<';
break;
default:
goto cp_convert;
}

out:
return len;

cp_convert:
len = cp->uni2char(le16_to_cpu(src_char), target,
NLS_MAX_CHARSET_SIZE);
if (len <= 0) {
*target = '?';
len = 1;
}
goto out;
}

/*
* cifs_from_ucs2 - convert utf16le string to local charset
* @to - destination buffer
* @from - source buffer
* @tolen - destination buffer size (in bytes)
* @fromlen - source buffer size (in bytes)
* @codepage - codepage to which characters should be converted
* @mapchar - should characters be remapped according to the mapchars option?
*
* Convert a little-endian ucs2le string (as sent by the server) to a string
* in the provided codepage. The tolen and fromlen parameters are to ensure
* that the code doesn't walk off of the end of the buffer (which is always
* a danger if the alignment of the source buffer is off). The destination
* string is always properly null terminated and fits in the destination
* buffer. Returns the length of the destination string in bytes (including
* null terminator).
* FUNCTION: Convert little-endian unicode string to character string
*
* Note that some windows versions actually send multiword UTF-16 characters
* instead of straight UCS-2. The linux nls routines however aren't able to
* deal with those characters properly. In the event that we get some of
* those characters, they won't be translated properly.
*/
int
cifs_from_ucs2(char *to, const __le16 *from, int tolen, int fromlen,
const struct nls_table *codepage, bool mapchar)
cifs_strfromUCS_le(char *to, const __le16 *from,
int len, const struct nls_table *codepage)
{
int i, charlen, safelen;
int i;
int outlen = 0;
int nullsize = nls_nullsize(codepage);
int fromwords = fromlen / 2;
char tmp[NLS_MAX_CHARSET_SIZE];

/*
* because the chars can be of varying widths, we need to take care
* not to overflow the destination buffer when we get close to the
* end of it. Until we get to this offset, we don't need to check
* for overflow however.
*/
safelen = tolen - (NLS_MAX_CHARSET_SIZE + nullsize);

for (i = 0; i < fromwords && from[i]; i++) {
/*
* check to see if converting this character might make the
* conversion bleed into the null terminator
*/
if (outlen >= safelen) {
charlen = cifs_mapchar(tmp, from[i], codepage, mapchar);
if ((outlen + charlen) > (tolen - nullsize))
break;
for (i = 0; (i < len) && from[i]; i++) {
int charlen;
/* 2.4.0 kernel or greater */
charlen =
codepage->uni2char(le16_to_cpu(from[i]), &to[outlen],
NLS_MAX_CHARSET_SIZE);
if (charlen > 0) {
outlen += charlen;
} else {
to[outlen++] = '?';
}

/* put converted char into 'to' buffer */
charlen = cifs_mapchar(&to[outlen], from[i], codepage, mapchar);
outlen += charlen;
}

/* properly null-terminate string */
for (i = 0; i < nullsize; i++)
to[outlen++] = 0;

to[outlen] = 0;
return outlen;
}

Expand Down Expand Up @@ -214,41 +88,3 @@ cifs_strtoUCS(__le16 *to, const char *from, int len,
return i;
}

/*
* cifs_strndup_from_ucs - copy a string from wire format to the local codepage
* @src - source string
* @maxlen - don't walk past this many bytes in the source string
* @is_unicode - is this a unicode string?
* @codepage - destination codepage
*
* Take a string given by the server, convert it to the local codepage and
* put it in a new buffer. Returns a pointer to the new string or NULL on
* error.
*/
char *
cifs_strndup_from_ucs(const char *src, const int maxlen, const bool is_unicode,
const struct nls_table *codepage)
{
int len;
char *dst;

if (is_unicode) {
len = cifs_ucs2_bytes((__le16 *) src, maxlen, codepage);
len += nls_nullsize(codepage);
dst = kmalloc(len, GFP_KERNEL);
if (!dst)
return NULL;
cifs_from_ucs2(dst, (__le16 *) src, len, maxlen, codepage,
false);
} else {
len = strnlen(src, maxlen);
len++;
dst = kmalloc(len, GFP_KERNEL);
if (!dst)
return NULL;
strlcpy(dst, src, len);
}

return dst;
}

23 changes: 2 additions & 21 deletions trunk/fs/cifs/cifs_unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Convert a unicode character to upper or lower case using
* compressed tables.
*
* Copyright (c) International Business Machines Corp., 2000,2009
* Copyright (c) International Business Machines Corp., 2000,2007
*
* 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
Expand Down Expand Up @@ -37,19 +37,6 @@

#define UNIUPR_NOLOWER /* Example to not expand lower case tables */

/*
* Windows maps these to the user defined 16 bit Unicode range since they are
* reserved symbols (along with \ and /), otherwise illegal to store
* in filenames in NTFS
*/
#define UNI_ASTERIK (__u16) ('*' + 0xF000)
#define UNI_QUESTION (__u16) ('?' + 0xF000)
#define UNI_COLON (__u16) (':' + 0xF000)
#define UNI_GRTRTHAN (__u16) ('>' + 0xF000)
#define UNI_LESSTHAN (__u16) ('<' + 0xF000)
#define UNI_PIPE (__u16) ('|' + 0xF000)
#define UNI_SLASH (__u16) ('\\' + 0xF000)

/* Just define what we want from uniupr.h. We don't want to define the tables
* in each source file.
*/
Expand All @@ -72,14 +59,8 @@ extern struct UniCaseRange UniLowerRange[];
#endif /* UNIUPR_NOLOWER */

#ifdef __KERNEL__
int cifs_from_ucs2(char *to, const __le16 *from, int tolen, int fromlen,
const struct nls_table *codepage, bool mapchar);
int cifs_ucs2_bytes(const __le16 *from, int maxbytes,
const struct nls_table *codepage);
int cifs_strfromUCS_le(char *, const __le16 *, int, const struct nls_table *);
int cifs_strtoUCS(__le16 *, const char *, int, const struct nls_table *);
char *cifs_strndup_from_ucs(const char *src, const int maxlen,
const bool is_unicode,
const struct nls_table *codepage);
#endif

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/cifs/cifsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
extern const struct export_operations cifs_export_ops;
#endif /* EXPERIMENTAL */

#define CIFS_VERSION "1.58"
#define CIFS_VERSION "1.57"
#endif /* _CIFSFS_H */
Loading

0 comments on commit 0454aa1

Please sign in to comment.