mei: make me hw headers private to me hw.
Subsystems (2)
PATCH 1/3 mei: make me hw headers private to me hw.
Remove includes of me-hw.h and me-hw-regs.h headers from the mei generic code.
The mei layer should not depend on hw specific headers
--- drivers/misc/mei/amthif.c | 1 - drivers/misc/mei/bus.c | 1 - drivers/misc/mei/hbm.c | 1 - drivers/misc/mei/hw-me.c | 4 ++-- drivers/misc/mei/interrupt.c | 1 - drivers/misc/mei/main.c | 1 - drivers/misc/mei/mei_dev.h | 1 - drivers/misc/mei/pci-me.c | 3 ++- drivers/misc/mei/wd.c | 1 - 9 files changed, 4 insertions(+), 10 deletions(-)
drivers/misc/mei/amthif.c +0 -1
@@ -34,7 +34,6 @@#include "mei_dev.h" #include "hbm.h" -#include "hw-me.h" #include "client.h" const uuid_le mei_amthif_guid = UUID_LE(0x12f80028, 0xb4b7, 0x4b2d,
drivers/misc/mei/bus.c +0 -1
@@ -26,7 +26,6 @@#include <linux/mei_cl_bus.h> #include "mei_dev.h" -#include "hw-me.h" #include "client.h" #define to_mei_cl_driver (d) container_of(d, struct mei_cl_driver, driver)
drivers/misc/mei/hbm.c +0 -1
@@ -21,7 +21,6 @@#include "mei_dev.h" #include "hbm.h" -#include "hw-me.h" #include "client.h" static const char *mei_cl_conn_status_str (enum mei_cl_connect_status status)
drivers/misc/mei/hw-me.c +2 -2
@@ -20,10 +20,10 @@#include <linux/interrupt.h> #include "mei_dev.h" -#include "hw-me.h" -#include "hbm.h" +#include "hw-me.h" +#include "hw-me-regs.h" /** * mei_me_reg_read - Reads 32bit data from the mei device
drivers/misc/mei/interrupt.c +0 -1
@@ -26,7 +26,6 @@#include "mei_dev.h" #include "hbm.h" -#include "hw-me.h" #include "client.h"
drivers/misc/mei/main.c +0 -1
@@ -40,7 +40,6 @@#include <linux/mei.h> #include "mei_dev.h" -#include "hw-me.h" #include "client.h" /**
drivers/misc/mei/mei_dev.h +0 -1
@@ -24,7 +24,6 @@#include <linux/mei_cl_bus.h> #include "hw.h" -#include "hw-me-regs.h" #include "hbm.h" /*
drivers/misc/mei/pci-me.c +2 -1
@@ -39,8 +39,9 @@#include <linux/mei.h> #include "mei_dev.h" -#include "hw-me.h" #include "client.h" +#include "hw-me-regs.h" +#include "hw-me.h" /* mei_pci_tbl - PCI Device ID Table */ static DEFINE_PCI_DEVICE_TABLE (mei_me_pci_tbl) = {
drivers/misc/mei/wd.c +0 -1
@@ -25,7 +25,6 @@#include "mei_dev.h" #include "hbm.h" -#include "hw-me.h" #include "client.h" static const u8 mei_start_wd_params[] = {0x02 ,0x12 ,0x13 ,0x10 };
Signature · 1 line
1.8.5.3
PATCH 2/3 mei: drop pr_fmt macros
we are using dev_ logging facility so we don't need pr_fmt macros
--- drivers/misc/mei/main.c | 3 --- drivers/misc/mei/pci-me.c | 3 --- 2 files changed, 6 deletions(-)
drivers/misc/mei/main.c +0 -3
@@ -13,9 +13,6 @@* more details. * */ - -#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h>
drivers/misc/mei/pci-me.c +0 -3
@@ -13,9 +13,6 @@* more details. * */ - -#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h>
Signature · 1 line
1.8.5.3
PATCH 3/3 mei: report consistently copy_from/to_user failures
In reply to Tomas WinklerFrom: Alexander Usyskin <[email protected]>
Consistently display error on possible copy_from/to_user failures and replace dev_dbg with dev_err
--- drivers/misc/mei/amthif.c | 4 +++- drivers/misc/mei/main.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/misc/mei/amthif.c +3 -1
@@ -244,8 +244,10 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,* the buf_idx may point beyond */ length =min_t (size_t, length, (cb->buf_idx - *offset)); -if (copy_to_user (ubuf, cb->response_buffer.data + *offset, length)) +if (copy_to_user (ubuf, cb->response_buffer.data + *offset, length)) { +dev_err (&dev->pdev->dev,"failed to copy data to userland\n" ); rets = -EFAULT ; + }else { rets = length;if ((*offset + length) < cb->buf_idx) {
drivers/misc/mei/main.c +2 -1
@@ -280,6 +280,7 @@ copy_buffer: length =min_t (size_t, length, cb->buf_idx - *offset);if (copy_to_user (ubuf, cb->response_buffer.data + *offset, length)) { +dev_err (&dev->pdev->dev,"failed to copy data to userland\n" ); rets = -EFAULT ; goto free; }
@@ -579,7 +580,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)dev_dbg (&dev->pdev->dev,"copy connect data to user\n" );if (copy_to_user ((char __user *)data, connect_data,sizeof (struct mei_connect_client_data ))) { -dev_dbg (&dev->pdev->dev,"failed to copy data to userland\n" ); +dev_err (&dev->pdev->dev,"failed to copy data to userland\n" ); rets = -EFAULT ; goto out; }
Signature · 1 line
1.8.5.3
Re: [char-misc-next 3/3] mei: report consistently copy_from/to_user failures
Quoted 4 lines · On Tue, 11 Mar 2014 14:49:25 +0200 Tomas Winkler <[email protected]>…
From: Alexander Usyskin <[email protected]>
Consistently display error on possible copy_from/to_user failures and replace
dev_dbgwithdev_err
NAK
This allows users to flood the logs by deliberately causing lots of these failed to copy data error messages, and if they can flood the logs they can hide other stuff.
The -EFAULT cases should be consistent - but consistently *not* logged.
Alan
RE: [char-misc-next 3/3] mei: report consistently copy_from/to_user failures
Quoted 10 lines
Quoted 4 lines · On Tue, 11 Mar 2014 14:49:25 +0200 Tomas Winkler <[email protected]>…
From: Alexander Usyskin <[email protected]>
Consistently display error on possible copy_from/to_user failures and replace
dev_dbgwithdev_err
Quoted 7 lines
NAK
This allows users to flood the logs by deliberately causing lots of these failed to copy data error messages, and if they can flood the logs they can hide other stuff.
The
-EFAULTcases should be consistent - but consistently *not* logged.
Yep, that's really looks like a possible exploit, please drop this patch. Tomas