Skip to content

Commit

Permalink
ipath: Restrict use of the write() interface
Browse files Browse the repository at this point in the history
Commit e6bd18f ("IB/security: Restrict use of the write()
interface") fixed a security problem with various write()
implementations in the Infiniband subsystem.  In older kernel versions
the ipath_write() function has the same problem and needs the same
restriction.  (The ipath driver has been completely removed upstream.)

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
bwhacks authored and gregkh committed Aug 16, 2016
1 parent 9c946c9 commit 694dfd0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/staging/rdma/ipath/ipath_file_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#include <linux/uio.h>
#include <asm/pgtable.h>

#include <rdma/ib.h>

#include "ipath_kernel.h"
#include "ipath_common.h"
#include "ipath_user_sdma.h"
Expand Down Expand Up @@ -2243,6 +2245,9 @@ static ssize_t ipath_write(struct file *fp, const char __user *data,
ssize_t ret = 0;
void *dest;

if (WARN_ON_ONCE(!ib_safe_file_access(fp)))
return -EACCES;

if (count < sizeof(cmd.type)) {
ret = -EINVAL;
goto bail;
Expand Down

0 comments on commit 694dfd0

Please sign in to comment.