stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.4] ipath: Restrict use of the write() interface
@ 2016-05-31  2:33 Ben Hutchings
  2016-08-14 16:00 ` Patch "ipath: Restrict use of the write() interface" has been added to the 4.4-stable tree gregkh
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2016-05-31  2:33 UTC (permalink / raw)
  To: stable; +Cc: Jason Gunthorpe, Doug Ledford, linux-rdma

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

Commit e6bd18f57aad ("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>
---
--- a/drivers/staging/rdma/ipath/ipath_file_ops.c
+++ b/drivers/staging/rdma/ipath/ipath_file_ops.c
@@ -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"
@@ -2243,6 +2245,9 @@ static ssize_t ipath_write(struct file *
 	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;

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-14 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-31  2:33 [PATCH 4.4] ipath: Restrict use of the write() interface Ben Hutchings
2016-08-14 16:00 ` Patch "ipath: Restrict use of the write() interface" has been added to the 4.4-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).