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: <20180213184033.GA24299@wunner.de>
Date:   Tue, 13 Feb 2018 19:40:33 +0100
From:   Lukas Wunner <lukas@...ner.de>
To:     SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc:     linux-efi@...r.kernel.org,
        Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] efi/apple-properties: Delete an error message for a
 failed memory allocation in unmarshal_devices()

On Tue, Feb 13, 2018 at 06:00:26PM +0100, SF Markus Elfring wrote:
> Omit an extra message for a memory allocation failure in this function.
[snip]
> --- a/drivers/firmware/efi/apple-properties.c
> +++ b/drivers/firmware/efi/apple-properties.c
> @@ -158,10 +158,8 @@ static int __init unmarshal_devices(struct properties_header *properties)
>  
>  		entry = kcalloc(dev_header->prop_count + 1, sizeof(*entry),
>  				GFP_KERNEL);
> -		if (!entry) {
> -			dev_err(dev, "cannot allocate properties\n");
> +		if (!entry)
>  			goto skip_device;
> -		}
>  
>  		unmarshal_key_value_pairs(dev_header, dev, ptr, entry);
>  		if (!entry[0].name)

While the allocator does print an error when allocations fail,
it may not be immediately apparent to the user what the
*consequences* are.  In this case, the consequence is that the
device properties will not be available for consumption by
drivers and they may fail to probe or behave in entirely
unexpected ways.  Hence I deliberately printed an error message
here so that the user can make the connection between erratic
behavior of drivers later on and the memory allocation error here.

You didn't cc me on your submission even though I'm the author of
99% of this file.  Please make an effort prior to submission to
identify interested parties.

Lukas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ