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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190320105631.GT3622@lahna.fi.intel.com>
Date:   Wed, 20 Mar 2019 12:56:31 +0200
From:   Mika Westerberg <mika.westerberg@...ux.intel.com>
To:     Aditya Pakki <pakki001@....edu>
Cc:     kjlu@....edu, Andreas Noever <andreas.noever@...il.com>,
        Michael Jamet <michael.jamet@...el.com>,
        Yehezkel Bernat <YehezkelShB@...il.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] thunderbolt: Fix to check return value of ida_simple_get

On Tue, Mar 19, 2019 at 12:22:59PM -0500, Aditya Pakki wrote:
> ida_simple_get on failure can return an error. The patch ensures that
> the dev_set_name is set on non failure cases.
> 
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
>  drivers/thunderbolt/xdomain.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c
> index e27dd8beb94b..b1768f595259 100644
> --- a/drivers/thunderbolt/xdomain.c
> +++ b/drivers/thunderbolt/xdomain.c
> @@ -772,7 +772,9 @@ static void enumerate_services(struct tb_xdomain *xd)
>  		svc->dev.bus = &tb_bus_type;
>  		svc->dev.type = &tb_service_type;
>  		svc->dev.parent = &xd->dev;
> -		dev_set_name(&svc->dev, "%s.%d", dev_name(&xd->dev), svc->id);
> +		if (svc->id >= 0)
> +			dev_set_name(&svc->dev, "%s.%d", dev_name(&xd->dev),
> +					svc->id);

I think the correct way to handle this case is to cleanup svc right
after the allocation fails and then break out without enumerating more
services.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ