Skip to content

Commit

Permalink
random: drop weird m_time/a_time manipulation
Browse files Browse the repository at this point in the history
commit a996996 upstream.

No other driver does anything remotely like this that I know of except
for the tty drivers, and I can't see any reason for random/urandom to do
it. In fact, it's a (trivial, harmless) timing information leak. And
obviously, it generates power- and flash-cycle wasting I/O, especially
if combined with something like hwrngd. Also, it breaks ubifs's
expectations.

Signed-off-by: Matt Mackall <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Matt Mackall authored and gregkh committed Feb 9, 2010
1 parent 94af44b commit 8857a1a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,6 @@ random_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
/* like a named pipe */
}

/*
* If we gave the user some bytes, update the access time.
*/
if (count)
file_accessed(file);

return (count ? count : retval);
}

Expand Down Expand Up @@ -1116,8 +1110,6 @@ static ssize_t random_write(struct file *file, const char __user *buffer,
if (ret)
return ret;

inode->i_mtime = current_fs_time(inode->i_sb);
mark_inode_dirty(inode);
return (ssize_t)count;
}

Expand Down

0 comments on commit 8857a1a

Please sign in to comment.