lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 26 May 2018 12:24:00 +0200
From:   Stefan Wahren <stefan.wahren@...e.com>
To:     Jassi Brar <jassisinghbrar@...il.com>,
        Eric Anholt <eric@...olt.net>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        Ray Jui <rjui@...adcom.com>,
        Scott Branden <sbranden@...adcom.com>,
        Phil Elwell <phil@...pberrypi.org>,
        bcm-kernel-feedback-list@...adcom.com,
        linux-kernel@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
        Stefan Wahren <stefan.wahren@...e.com>
Subject: [PATCH] mailbox: bcm2835: Fix of_xlate return value

The bcm2835-mailbox returns NULL instead of an error pointer, which could
result in a NULL ptr dereference in mbox_request_channel. So fix this
by returning a proper error pointer.

Signed-off-by: Stefan Wahren <stefan.wahren@...e.com>
Fixes: 0bae6af6d704 ("mailbox: Enable BCM2835 mailbox support")
---
 drivers/mailbox/bcm2835-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/bcm2835-mailbox.c b/drivers/mailbox/bcm2835-mailbox.c
index cfb4b44..e92bbc5 100644
--- a/drivers/mailbox/bcm2835-mailbox.c
+++ b/drivers/mailbox/bcm2835-mailbox.c
@@ -134,7 +134,7 @@ static struct mbox_chan *bcm2835_mbox_index_xlate(struct mbox_controller *mbox,
 		    const struct of_phandle_args *sp)
 {
 	if (sp->args_count != 0)
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	return &mbox->chans[0];
 }
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ