[bug report] ACPI: NFIT: Define runtime firmware activation commands

2020-11-11 Thread Dan Carpenter
"; 492 } 493 494 if (!desc || (cmd && (desc->out_num + desc->in_num == 0))) 495 return -ENOTTY; 496 497 /* 498 * Check for a valid command. For ND_CMD_CALL, we also have to 499 * make sure that

[bug report] device-dax: add dis-contiguous resource support

2020-08-31 Thread Dan Carpenter
{ 786 .pgoff = pgoff, 787 .range = { 788 .start = alloc->start, Dereferences. 789 .end = alloc->end, 790

[PATCH 1/2] acpi/nfit: improve bounds checking for 'func'

2020-02-25 Thread Dan Carpenter
oduced the NVDIMM_CMD_MAX (31) define and updated nfit_dsm_revid() to use that define as well instead of magic numbers. Fixes: 11189c1089da ("acpi/nfit: Fix command-supported detection") Signed-off-by: Dan Carpenter --- drivers/acpi/nfit/core.c | 10 ++ drivers/acpi/nfit/nfit.h

[PATCH 2/2] libnvdimm: Out of bounds read in __nd_ioctl()

2020-02-25 Thread Dan Carpenter
2e45f4a2 ("libnvdimm: control (ioctl) messages for nvdimm_bus and nvdimm devices") Signed-off-by: Dan Carpenter --- drivers/nvdimm/bus.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index a8b515968569..09087c38fabd 100

Re: [bug report] libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver infrastructure

2020-02-05 Thread Dan Carpenter
On Wed, Feb 05, 2020 at 12:04:15PM -0800, Dan Williams wrote: > On Wed, Feb 5, 2020 at 11:28 AM Dan Carpenter > wrote: > > > > On Wed, Feb 05, 2020 at 11:16:22AM -0800, Dan Williams wrote: > > > Ugh, sorry I thought you were pointing out that there's too many > >

Re: [bug report] libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver infrastructure

2020-02-05 Thread Dan Carpenter
device_put(>dev); return NULL; } return nvdimm; regards, dan carpenter ___ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-le...@lists.01.org

Re: [bug report] libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver infrastructure

2020-02-05 Thread Dan Carpenter
n it decrements it twice. Now the refcount is zero so we call nvdimm_release(). This leads to a use after free on the next line: put_device(dev); if (dev->parent) There is a trick here because depending on the debug options it might free immediately or it might call nvdimm_re

Re: [bug report] libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver infrastructure

2020-02-05 Thread Dan Carpenter
On Wed, Feb 05, 2020 at 09:47:01AM -0800, Dan Williams wrote: > On Wed, Feb 5, 2020 at 4:38 AM Dan Carpenter wrote: > > > > Hello Dan Williams, > > > > The patch 4d88a97aa9e8: "libnvdimm, nvdimm: dimm driver and base > > libnvdimm device-driver in

[bug report] libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver infrastructure

2020-02-05 Thread Dan Carpenter
, I guess. It seems buggy to call put device twice on error. regards, dan carpenter regards, dan carpenter ___ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-le...@lists.01.org

Re: KASAN: vmalloc-out-of-bounds Read in acpi_nfit_ctl

2020-01-14 Thread Dan Carpenter
((1 << func) & NVDIMM_INTEL_SECURITY_CMDMASK) ^^^^^ This is undefined if func is greater than 31. 3496 return -EOPNOTSUPP; 3497 } 3498 3499 return __acpi_nfit_clear_to_send(nd_desc, nvdimm, cmd); 3500 } regards, dan carpenter ___ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-le...@lists.01.org

[PATCH] acpi/nfit: unlock on error in scrub_show()

2019-10-18 Thread Dan Carpenter
We change the locking in this function and forgot to update this error path so we are accidentally still holding the "dev->lockdep_mutex". Fixes: 87a30e1f05d7 ("driver-core, libnvdimm: Let device subsystems add local lockdep coverage") Signed-off-by: Dan Carpenter --- d

Re: [PATCH V3] libnvdimm/namsepace: Don't set claim_class on error

2019-09-26 Thread Dan Carpenter
lear about the values it is returning. > > This was found via code inspection. > > Reported-by: Dan Carpenter > Reviewed-by: Vishal Verma > Signed-off-by: Ira Weiny > > --- > V1->V2 > Add space after variable declaration... > > V2->V3 > Fix

[PATCH] libnvdimm/namespace: Fix a signedness bug in __holder_class_store()

2019-09-25 Thread Dan Carpenter
The "ndns->claim_class" variable is an enum but in this case GCC will treat it as an unsigned int so the error handling is never triggered. Fixes: 14e494542636 ("libnvdimm, btt: BTT updates for UEFI 2.7 format") Signed-off-by: Dan Carpenter --- drivers/nvdimm/namespac

Re: [Ksummit-discuss] [PATCH v2 3/3] libnvdimm, MAINTAINERS: Maintainer Entry Profile

2019-09-16 Thread Dan Carpenter
for networking, but it's kind of a pain in the butt and I mess up surpisingly often for how much effort I put into getting it right. regards, dan carpenter ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [Ksummit-discuss] [PATCH v2 3/3] libnvdimm, MAINTAINERS: Maintainer Entry Profile

2019-09-13 Thread Dan Carpenter
On Fri, Sep 13, 2019 at 01:09:37AM -0600, Jonathan Corbet wrote: > On Wed, 11 Sep 2019 16:11:29 -0600 > Jens Axboe wrote: > > > On 9/11/19 12:43 PM, Dan Carpenter wrote: > > > > > > I kind of hate all this extra documentation because now everyone thinks > &

Re: [Ksummit-discuss] [PATCH v2 3/3] libnvdimm, MAINTAINERS: Maintainer Entry Profile

2019-09-11 Thread Dan Carpenter
ne who tries to tag their patches is going to do it badly anyway. regards, dan carpenter ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

[bug report] acpi/nfit: Add support for Intel DSM 1.8 commands

2019-05-02 Thread Dan Carpenter
nd_command; 3510 if ((1 << func) & NVDIMM_INTEL_SECURITY_CMDMASK) ^ This is undefined and it would be nice to fix, but not important for run time. 3511 return -EOPNOTSUPP; 3512 } 3513 3514

Re: [RFC v4 08/17] kunit: test: add support for test abort

2019-02-28 Thread Dan Carpenter
mix them, it means that NULL is a special kind of success. Like we try to load a feature and we get back: valid pointer <-- success null <-- feature is disabled. not an error. error pointer <-- feature is broken. fail. regards, dan carpenter ___

[bug report] acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value

2018-07-11 Thread Dan Carpenter
if (offset + in_buf.buffer.length < buf_len) { 572 if (i >= 1) { 573 /* 574 * status valid, return the number of bytes left 575 * unfilled in the output buffer 576

[bug report] libnvdimm: add support for clear poison list and badblocks for device dax

2017-10-26 Thread Dan Carpenter
pend = nsio->res.end - end_trunc; 868 869 if ((pstart >= start) && (pend <= end)) 870 return -EBUSY; 871 872 return 0; 873 874 } regards, dan carpenter ___ Linux-nvdimm m

[bug report] libnvdimm: clear the internal poison_list when clearing badblocks

2017-10-26 Thread Dan Carpenter
pl->start > clr_end) 622 continue; 623 /* Delete completely overlapped poison entries */ 624 if ((pl->start >= start) && (pl_end <= clr_end)) { 625

[bug report] libnvdimm: control (ioctl) messages for nvdimm_bus and nvdimm devices

2017-07-27 Thread Dan Carpenter
locate less than intended. 1019 if (!buf) 1020 return -ENOMEM; 1021 1022 if (copy_from_user(buf, p, buf_len)) { 1023 rc = -EFAULT; 1024 goto out; 1025 } regards, dan carpenter ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

[patch] libnvdimm, namespace: potential NULL deref on allocation error

2016-10-12 Thread Dan Carpenter
If the kcalloc() fails then "devs" can be NULL and we dereference it checking "devs[i]". Fixes: 1b40e09a1232 ('libnvdimm: blk labels and namespace instantiation') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/nvdimm/namespa