git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Fix IPMI watchdog set_param_str() using kstrdup
[pandora-kernel.git]
/
drivers
/
char
/
random.c
diff --git
a/drivers/char/random.c
b/drivers/char/random.c
index
eb6b13f
..
13d0b13
100644
(file)
--- a/
drivers/char/random.c
+++ b/
drivers/char/random.c
@@
-1048,7
+1048,7
@@
random_write(struct file * file, const char __user * buffer,
if (p == buffer) {
return (ssize_t)ret;
} else {
if (p == buffer) {
return (ssize_t)ret;
} else {
- struct inode *inode = file->f_dentry->d_inode;
+ struct inode *inode = file->f_
path.
dentry->d_inode;
inode->i_mtime = current_fs_time(inode->i_sb);
mark_inode_dirty(inode);
return (ssize_t)(p - buffer);
inode->i_mtime = current_fs_time(inode->i_sb);
mark_inode_dirty(inode);
return (ssize_t)(p - buffer);
@@
-1203,7
+1203,7
@@
static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
static int uuid_strategy(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
static int uuid_strategy(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
- void __user *newval, size_t newlen
, void **context
)
+ void __user *newval, size_t newlen)
{
unsigned char tmp_uuid[16], *uuid;
unsigned int len;
{
unsigned char tmp_uuid[16], *uuid;
unsigned int len;
@@
-1422,9
+1422,9
@@
static struct keydata {
static unsigned int ip_cnt;
static unsigned int ip_cnt;
-static void rekey_seq_generator(
void *private_
);
+static void rekey_seq_generator(
struct work_struct *work
);
-static DECLARE_
WORK(rekey_work, rekey_seq_generator, NULL
);
+static DECLARE_
DELAYED_WORK(rekey_work, rekey_seq_generator
);
/*
* Lock avoidance:
/*
* Lock avoidance:
@@
-1438,7
+1438,7
@@
static DECLARE_WORK(rekey_work, rekey_seq_generator, NULL);
* happen, and even if that happens only a not perfectly compliant
* ISN is generated, nothing fatal.
*/
* happen, and even if that happens only a not perfectly compliant
* ISN is generated, nothing fatal.
*/
-static void rekey_seq_generator(
void *private_
)
+static void rekey_seq_generator(
struct work_struct *work
)
{
struct keydata *keyptr = &ip_keydata[1 ^ (ip_cnt & 1)];
{
struct keydata *keyptr = &ip_keydata[1 ^ (ip_cnt & 1)];
@@
-1466,8
+1466,8
@@
static __init int seqgen_init(void)
late_initcall(seqgen_init);
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
late_initcall(seqgen_init);
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-__u32 secure_tcpv6_sequence_number(__
u32 *saddr, __u
32 *daddr,
- __
u16 sport, __u
16 dport)
+__u32 secure_tcpv6_sequence_number(__
be32 *saddr, __be
32 *daddr,
+ __
be16 sport, __be
16 dport)
{
struct timeval tv;
__u32 seq;
{
struct timeval tv;
__u32 seq;
@@
-1479,10
+1479,10
@@
__u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr,
*/
memcpy(hash, saddr, 16);
*/
memcpy(hash, saddr, 16);
- hash[4]=(
sport << 16) +
dport;
+ hash[4]=(
(__force u16)sport << 16) + (__force u16)
dport;
memcpy(&hash[5],keyptr->secret,sizeof(__u32) * 7);
memcpy(&hash[5],keyptr->secret,sizeof(__u32) * 7);
- seq = twothirdsMD4Transform(daddr, hash) & HASH_MASK;
+ seq = twothirdsMD4Transform(
(const __u32 *)
daddr, hash) & HASH_MASK;
seq += keyptr->count;
do_gettimeofday(&tv);
seq += keyptr->count;
do_gettimeofday(&tv);
@@
-1496,7
+1496,7
@@
EXPORT_SYMBOL(secure_tcpv6_sequence_number);
/* The code below is shamelessly stolen from secure_tcp_sequence_number().
* All blames to Andrey V. Savochkin <saw@msu.ru>.
*/
/* The code below is shamelessly stolen from secure_tcp_sequence_number().
* All blames to Andrey V. Savochkin <saw@msu.ru>.
*/
-__u32 secure_ip_id(__
u
32 daddr)
+__u32 secure_ip_id(__
be
32 daddr)
{
struct keydata *keyptr;
__u32 hash[4];
{
struct keydata *keyptr;
__u32 hash[4];
@@
-1508,7
+1508,7
@@
__u32 secure_ip_id(__u32 daddr)
* The dest ip address is placed in the starting vector,
* which is then hashed with random data.
*/
* The dest ip address is placed in the starting vector,
* which is then hashed with random data.
*/
- hash[0] = daddr;
+ hash[0] =
(__force __u32)
daddr;
hash[1] = keyptr->secret[9];
hash[2] = keyptr->secret[10];
hash[3] = keyptr->secret[11];
hash[1] = keyptr->secret[9];
hash[2] = keyptr->secret[10];
hash[3] = keyptr->secret[11];
@@
-1518,8
+1518,8
@@
__u32 secure_ip_id(__u32 daddr)
#ifdef CONFIG_INET
#ifdef CONFIG_INET
-__u32 secure_tcp_sequence_number(__
u32 saddr, __u
32 daddr,
- __
u16 sport, __u
16 dport)
+__u32 secure_tcp_sequence_number(__
be32 saddr, __be
32 daddr,
+ __
be16 sport, __be
16 dport)
{
struct timeval tv;
__u32 seq;
{
struct timeval tv;
__u32 seq;
@@
-1532,9
+1532,9
@@
__u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr,
* Note that the words are placed into the starting vector, which is
* then mixed with a partial MD4 over random data.
*/
* Note that the words are placed into the starting vector, which is
* then mixed with a partial MD4 over random data.
*/
- hash[0]=saddr;
- hash[1]=daddr;
- hash[2]=(
sport << 16) +
dport;
+ hash[0]=
(__force u32)
saddr;
+ hash[1]=
(__force u32)
daddr;
+ hash[2]=(
(__force u16)sport << 16) + (__force u16)
dport;
hash[3]=keyptr->secret[11];
seq = half_md4_transform(hash, keyptr->secret) & HASH_MASK;
hash[3]=keyptr->secret[11];
seq = half_md4_transform(hash, keyptr->secret) & HASH_MASK;
@@
-1559,7
+1559,7
@@
__u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr,
EXPORT_SYMBOL(secure_tcp_sequence_number);
/* Generate secure starting point for ephemeral IPV4 transport port search */
EXPORT_SYMBOL(secure_tcp_sequence_number);
/* Generate secure starting point for ephemeral IPV4 transport port search */
-u32 secure_ipv4_port_ephemeral(__
u32 saddr, __u32 daddr, __u
16 dport)
+u32 secure_ipv4_port_ephemeral(__
be32 saddr, __be32 daddr, __be
16 dport)
{
struct keydata *keyptr = get_keyptr();
u32 hash[4];
{
struct keydata *keyptr = get_keyptr();
u32 hash[4];
@@
-1568,25
+1568,25
@@
u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport)
* Pick a unique starting offset for each ephemeral port search
* (saddr, daddr, dport) and 48bits of random data.
*/
* Pick a unique starting offset for each ephemeral port search
* (saddr, daddr, dport) and 48bits of random data.
*/
- hash[0] = saddr;
- hash[1] = daddr;
- hash[2] = dport ^ keyptr->secret[10];
+ hash[0] =
(__force u32)
saddr;
+ hash[1] =
(__force u32)
daddr;
+ hash[2] =
(__force u32)
dport ^ keyptr->secret[10];
hash[3] = keyptr->secret[11];
return half_md4_transform(hash, keyptr->secret);
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
hash[3] = keyptr->secret[11];
return half_md4_transform(hash, keyptr->secret);
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-u32 secure_ipv6_port_ephemeral(const __
u32 *saddr, const __u32 *daddr, __u
16 dport)
+u32 secure_ipv6_port_ephemeral(const __
be32 *saddr, const __be32 *daddr, __be
16 dport)
{
struct keydata *keyptr = get_keyptr();
u32 hash[12];
memcpy(hash, saddr, 16);
{
struct keydata *keyptr = get_keyptr();
u32 hash[12];
memcpy(hash, saddr, 16);
- hash[4] = dport;
+ hash[4] =
(__force u32)
dport;
memcpy(&hash[5],keyptr->secret,sizeof(__u32) * 7);
memcpy(&hash[5],keyptr->secret,sizeof(__u32) * 7);
- return twothirdsMD4Transform(daddr, hash);
+ return twothirdsMD4Transform(
(const __u32 *)
daddr, hash);
}
#endif
}
#endif
@@
-1595,17
+1595,17
@@
u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, __u16 dpo
* bit's 32-47 increase every key exchange
* 0-31 hash(source, dest)
*/
* bit's 32-47 increase every key exchange
* 0-31 hash(source, dest)
*/
-u64 secure_dccp_sequence_number(__
u32 saddr, __u
32 daddr,
- __
u16 sport, __u
16 dport)
+u64 secure_dccp_sequence_number(__
be32 saddr, __be
32 daddr,
+ __
be16 sport, __be
16 dport)
{
struct timeval tv;
u64 seq;
__u32 hash[4];
struct keydata *keyptr = get_keyptr();
{
struct timeval tv;
u64 seq;
__u32 hash[4];
struct keydata *keyptr = get_keyptr();
- hash[0] = saddr;
- hash[1] = daddr;
- hash[2] = (
sport << 16) +
dport;
+ hash[0] =
(__force u32)
saddr;
+ hash[1] =
(__force u32)
daddr;
+ hash[2] = (
(__force u16)sport << 16) + (__force u16)
dport;
hash[3] = keyptr->secret[11];
seq = half_md4_transform(hash, keyptr->secret);
hash[3] = keyptr->secret[11];
seq = half_md4_transform(hash, keyptr->secret);
@@
-1641,7
+1641,7
@@
unsigned int get_random_int(void)
* drain on it), and uses halfMD4Transform within the second. We
* also mix it with jiffies and the PID:
*/
* drain on it), and uses halfMD4Transform within the second. We
* also mix it with jiffies and the PID:
*/
- return secure_ip_id(
current->pid + jiffies
);
+ return secure_ip_id(
(__force __be32)(current->pid + jiffies)
);
}
/*
}
/*