|
@@ -99,6 +99,9 @@ static ssize_t read_mem(struct file *file, char __user *buf,
|
|
ssize_t read, sz;
|
|
ssize_t read, sz;
|
|
char *ptr;
|
|
char *ptr;
|
|
|
|
|
|
|
|
+ if (p != *ppos)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
if (!valid_phys_addr_range(p, count))
|
|
if (!valid_phys_addr_range(p, count))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
read = 0;
|
|
read = 0;
|
|
@@ -157,6 +160,9 @@ static ssize_t write_mem(struct file *file, const char __user *buf,
|
|
unsigned long copied;
|
|
unsigned long copied;
|
|
void *ptr;
|
|
void *ptr;
|
|
|
|
|
|
|
|
+ if (p != *ppos)
|
|
|
|
+ return -EFBIG;
|
|
|
|
+
|
|
if (!valid_phys_addr_range(p, count))
|
|
if (!valid_phys_addr_range(p, count))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
|