Re: [PATCH] parisc: eisa_enumerator: Fix out-of-bounds reads of the EEPROM buffer

Rolf Eike Beer <[email protected]>
Newsgroups org.kernel.vger.linux-parisc,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
> @@ -491,6 +492,13 @@ int eisa_enumerator(unsigned long eeprom_addr,
> printk(KERN_INFO "Enumerating EISA bus\n");
>   
> eh = (struct eeprom_header*)(eeprom_buf);
> +	/*
> +	* The EEPROM contents are not to be trusted: clamp the number of
> +	* slots so that all slot records fit into eeprom_buf.
> +	*/
> +	eh->num_slots = min_t(u8, eh->num_slots,
> +			     (HPEE_MAX_LENGTH - sizeof(*eh)) /
> +			     sizeof(struct eeprom_eisa_slot_info));

I wonder if that should write out any sort of warning message about a broken 
EEPROM here.

Greetings,

Eike
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iFwEABECAB0WIQSaYVDeqwKa3fTXNeNcpIk+abn8TgUCaotJUAAKCRBcpIk+abn8
Tq46AJj0fUmYxztYmJ6jUrwFRpqsRGm9AJ45oAHxyvx4lQFR3VtmOXUAqFK8Dw==
=OyIJ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.