Re: [PATCH 00/14] Cleanup chardev instances with helper function

2017-02-20 Thread Richard Weinberger
Logan, Am 21.02.2017 um 06:00 schrieb Logan Gunthorpe: > Hello, > > Our story for this patch-set begins with a new driver I wrote and am in > the process of submitting upstream. That driver creates a fairly > standard char device and the code for it was copied from a similar > instance in device-

Re: [PATCH 01/14] chardev: add helper function to register char devs with a struct device

2017-02-20 Thread Logan Gunthorpe
On 20/02/17 10:35 PM, Dmitry Torokhov wrote: > My only objection is to this statement. There is absolutely nothing that > prevents from calling device_unregister() first and cdev_del() later. > Refcounting will sort it all out. Yeah, I was really trying to warn people against calling cdev_del wi

Re: [PATCH 01/14] chardev: add helper function to register char devs with a struct device

2017-02-20 Thread Dmitry Torokhov
On Mon, Feb 20, 2017 at 10:00:40PM -0700, Logan Gunthorpe wrote: > Credit for this patch goes entirely to Dan Williams [1]. I've just > fleshed out the comments and created the patch, but the premise > remains exactly the same. > > There's a common pattern in the kernel whereby a struct cdev is pl

[PATCH 08/14] iio:core: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/iio/industrialio-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index aaca428..b0ef245 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industri

[PATCH 05/14] tpm-chip: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/char/tpm/tpm-chip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index a77262d..dc90b45 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -187,

[PATCH 07/14] infiniband: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
This patch updates core/ucm.c which didn't originally use the cdev.kobj.parent with it's parent device. I did not look heavily into whether this was a bug or not, but it seems likely to me there would be a use before free. I also took a look at core/uverbs_main.c, core/user_mad.c and hw/hfi1/devic

[PATCH 10/14] mtd: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Note: neither of the cdev instances in the mtd tree originally set the kobject parent. Thus, I'm reasonably confident that both these instances would have suffered from a minor use after free bug if the cdevs were open when the backing device was released. Signed-off-by: Logan Gunthorpe --- driv

[PATCH 14/14] switchtec: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/pci/switch/switchtec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 82bfd18..95aabd0 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switc

[PATCH 11/14] rapidio: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Note: the chardev instance in rio_mport_cdev originally did not set the kobject parent. Thus, I'm reasonably confident that because of this, this code would have suffered from a minor use after free bug if the cdev was open when the backing device was released. Signed-off-by: Logan Gunthorpe ---

[PATCH 00/14] Cleanup chardev instances with helper function

2017-02-20 Thread Logan Gunthorpe
Hello, Our story for this patch-set begins with a new driver I wrote and am in the process of submitting upstream. That driver creates a fairly standard char device and the code for it was copied from a similar instance in device-dax. However, upon review, Greg Kroah-Hartman noticed [1] a suspicio

[PATCH 12/14] rtc: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/rtc/rtc-dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index a6d9434..e4012bb 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c @@ -477,12 +477,11 @@ void rtc_dev_pre

[PATCH 03/14] input: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/input/evdev.c| 3 +-- drivers/input/joydev.c | 3 +-- drivers/input/mousedev.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index e9ae3d5..a3407ea 100644 --- a/drivers/input/e

[PATCH 02/14] device-dax: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/dax/dax.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c index ed758b7..0d24822 100644 --- a/drivers/dax/dax.c +++ b/drivers/dax/dax.c @@ -701,12 +701,12 @@ struct dax_dev *devm_create_dax_d

[PATCH 13/14] scsi: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Note: the chardev instance in osd_uld.c originally did not set the kobject parent. Thus, I'm reasonably confident that because of this, this code would have suffered from a minor use after free bug if the cdev was open when the backing device was released. Signed-off-by: Logan Gunthorpe --- dri

[PATCH 09/14] media: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/media/cec/cec-core.c | 3 +-- drivers/media/media-devnode.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c index aca3ab8..a475aa5 100644 --- a/drivers/media/cec/cec-cor

[PATCH 01/14] chardev: add helper function to register char devs with a struct device

2017-02-20 Thread Logan Gunthorpe
Credit for this patch goes entirely to Dan Williams [1]. I've just fleshed out the comments and created the patch, but the premise remains exactly the same. There's a common pattern in the kernel whereby a struct cdev is placed in a structure along side a struct device which manages the life-cycle

[PATCH 06/14] platform/chrome: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/platform/chrome/cros_ec_dev.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c index 47268ec..658fb99 100644 --- a/drivers/platform/chrome/cros_ec_dev

[PATCH 04/14] gpiolib: utilize new device_add_cdev helper function

2017-02-20 Thread Logan Gunthorpe
Signed-off-by: Logan Gunthorpe --- drivers/gpio/gpiolib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index a07ae9e..04dbc4a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1036,9 +1036,8 @@ static int

Exciting Machine Vision/Robotics Opportunities (Tokyo)

2017-02-20 Thread Nicholas Meyler
My new client is an exciting machine vision and robotics software company based in Tokyo, which is looking to recruit the brightest talent in the field to work in their location. In the future, some remote or US-based work will probably be available, but not now. They were stealthily founded th