Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1368588 > unrolled thread

[PATCH 4.2.y-ckt 075/218] libnvdimm: Fix security issue with DSM IOCTL.

Started byKamal Mostafa <kamal@canonical.com>
First post2016-03-31 22:20 +0200
Last post2016-03-31 22:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.2.y-ckt 075/218] libnvdimm: Fix security issue with DSM IOCTL. Kamal Mostafa <kamal@canonical.com> - 2016-03-31 22:20 +0200

#1368588 — [PATCH 4.2.y-ckt 075/218] libnvdimm: Fix security issue with DSM IOCTL.

FromKamal Mostafa <kamal@canonical.com>
Date2016-03-31 22:20 +0200
Subject[PATCH 4.2.y-ckt 075/218] libnvdimm: Fix security issue with DSM IOCTL.
Message-ID<riReq-1PN-7@gated-at.bofh.it>
4.2.8-ckt7 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Jerry Hoemann <jerry.hoemann@hpe.com>

commit 07accfa9d1a8bac8262f6d24a94a54d2d1f35149 upstream.

Code attempts to prevent certain IOCTL DSM from being called
when device is opened read only.  This security feature can
be trivially overcome by changing the size portion of the
ioctl_command which isn't used.

Check only the _IOC_NR (i.e. the command).

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/nvdimm/bus.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index 7e2c43f..496b9b6 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -513,10 +513,10 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
 
 	/* fail write commands (when read-only) */
 	if (read_only)
-		switch (ioctl_cmd) {
-		case ND_IOCTL_VENDOR:
-		case ND_IOCTL_SET_CONFIG_DATA:
-		case ND_IOCTL_ARS_START:
+		switch (cmd) {
+		case ND_CMD_VENDOR:
+		case ND_CMD_SET_CONFIG_DATA:
+		case ND_CMD_ARS_START:
 			dev_dbg(&nvdimm_bus->dev, "'%s' command while read-only.\n",
 					nvdimm ? nvdimm_cmd_name(cmd)
 					: nvdimm_bus_cmd_name(cmd));
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web