Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: ima: hashing large files bug fix kernel_read: redefine offset type
This commit is contained in:
@@ -678,8 +678,8 @@ exit:
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(open_exec);
|
EXPORT_SYMBOL(open_exec);
|
||||||
|
|
||||||
int kernel_read(struct file *file, unsigned long offset,
|
int kernel_read(struct file *file, loff_t offset,
|
||||||
char *addr, unsigned long count)
|
char *addr, unsigned long count)
|
||||||
{
|
{
|
||||||
mm_segment_t old_fs;
|
mm_segment_t old_fs;
|
||||||
loff_t pos = offset;
|
loff_t pos = offset;
|
||||||
|
|||||||
@@ -2123,7 +2123,7 @@ extern struct file *do_filp_open(int dfd, const char *pathname,
|
|||||||
int open_flag, int mode, int acc_mode);
|
int open_flag, int mode, int acc_mode);
|
||||||
extern int may_open(struct path *, int, int);
|
extern int may_open(struct path *, int, int);
|
||||||
|
|
||||||
extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
|
extern int kernel_read(struct file *, loff_t, char *, unsigned long);
|
||||||
extern struct file * open_exec(const char *);
|
extern struct file * open_exec(const char *);
|
||||||
|
|
||||||
/* fs/dcache.c -- generic fs support functions */
|
/* fs/dcache.c -- generic fs support functions */
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ int ima_calc_hash(struct file *file, char *digest)
|
|||||||
{
|
{
|
||||||
struct hash_desc desc;
|
struct hash_desc desc;
|
||||||
struct scatterlist sg[1];
|
struct scatterlist sg[1];
|
||||||
loff_t i_size;
|
loff_t i_size, offset = 0;
|
||||||
char *rbuf;
|
char *rbuf;
|
||||||
int rc, offset = 0;
|
int rc;
|
||||||
|
|
||||||
rc = init_desc(&desc);
|
rc = init_desc(&desc);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
@@ -67,6 +67,8 @@ int ima_calc_hash(struct file *file, char *digest)
|
|||||||
rc = rbuf_len;
|
rc = rbuf_len;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (rbuf_len == 0)
|
||||||
|
break;
|
||||||
offset += rbuf_len;
|
offset += rbuf_len;
|
||||||
sg_init_one(sg, rbuf, rbuf_len);
|
sg_init_one(sg, rbuf, rbuf_len);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user