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] [day] [month] [year] [list]
Date:	Thu, 23 May 2013 12:06:53 -0700
From:	Joe Perches <joe@...ches.com>
To:	Peter Jones <pjones@...hat.com>
Cc:	Matt Fleming <matt.fleming@...el.com>,
	Matthew Garrett <matthew.garrett@...ula.com>,
	linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Print the actual UEFI error name, not just the error
 code.

On Thu, 2013-05-23 at 14:37 -0400, Peter Jones wrote:
> EFI error numbers are useful, but symbol names are way easier to
> understand when you're reading bug reports.  And since, for the most
> part, we know the names, we should show them.
[]
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
[]
> +#define efi_pr_warn(status, fmt, ...) ({				\
> +		typeof(status) __status = EFI_REVERSE_ERROR(status);	\
> +		if (__status >= 0 &&					\
> +				__status <= EFI_REVERSE_ERROR(EFI_MAX_ERROR))\
> +			pr_warn(fmt ": %s (0x%lx)\n", ## __VA_ARGS__,	\
> +				efi_error_strings[__status], __status);	\
> +		else							\
> +			pr_warn(fmt ": 0x%lx\n", ## __VA_ARGS__, __status);\
> +	})

This doubles the number of formats (and code size text) used.

Please don't remove trailing newlines from these sorts
of messages.  

I think a function to return "unknown efi error" would be
acceptable and these should become something like:

const char *efi_error_string(unsigned long status)
{
	if (status <= EFI_REVERSE_ERROR(EFI_MAX_ERROR))
		return efi_error_strings[status];
	return "unknown efi error";
}

and the uses something like:

> -		printk(KERN_WARNING "efivars: set_variable() failed: status=%lx\n",
> -			status);
--
	pr_warn("set_variable() failed: %s (%lx)\n",
		efi_error_string(status), status);

(with #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ