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]
Date:	Wed, 27 Nov 2013 11:20:22 +0000
From:	Matt Fleming <matt@...sole-pimps.org>
To:	Dave Young <dyoung@...hat.com>
Cc:	linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org,
	x86@...nel.org, mjg59@...f.ucam.org, hpa@...or.com,
	James.Bottomley@...senPartnership.com, vgoyal@...hat.com,
	ebiederm@...ssion.com, horms@...ge.net.au,
	kexec@...ts.infradead.org, bp@...en8.de, greg@...ah.com,
	toshi.kani@...com
Subject: Re: [PATCH v4 10/12] x86: export x86 boot_params to sysfs

On Tue, 26 Nov, at 01:57:55PM, Dave Young wrote:
> +Users:
> +		Kexec Mailing List <kexec@...ts.infradead.org>

"Kexec" please.

> +static ssize_t version_show(struct kobject *kobj,
> +					struct kobj_attribute *attr, char *buf)

This is pretty strange indentation. Usually we prefer to line up the
arguments like you've done elsewhere in this file.

> +{
> +	return sprintf(buf, "0x%04x\n", boot_params.hdr.version);
> +}
> +
> +static struct kobj_attribute boot_params_version_attr = __ATTR_RO(version);
> +
> +static ssize_t boot_params_data_read(struct file *fp, struct kobject *kobj,
> +				     struct bin_attribute *bin_attr,
> +				     char *buf, loff_t off, size_t count)
> +{
> +	memcpy(buf, (void *)&boot_params + off, count);
> +	return count;
> +}

Don't we need some checks here to ensure we don't read past the end of
boot_params?

> +static ssize_t type_show(struct kobject *kobj,
> +					struct kobj_attribute *attr, char *buf)

More whacky indentation.

> +static int __init create_setup_data_node(struct kobject *parent,
> +					struct kobject **kobjp, int nr)

Funky indentation.

-- 
Matt Fleming, Intel Open Source Technology Center
--
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