Re: [PATCH 1/2] sparc64 - strict devmem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bob Picco <bpicco@xxxxxxxxxx>
Date: Tue, 18 Feb 2014 14:11:18 -0500

> +#ifdef CONFIG_STRICT_DEVMEM
> +/* devmem_is_allowed for sparc.
> + */
> +int devmem_is_allowed(unsigned long pagenr)
> +{
> +	int  rc = page_is_ram(pagenr);
> +
> +	return rc;
> +}
> +#endif

We already go through all of the effort to build
sparc64_valid_addr_bitmap, please use it via kern_addr_valid().

Using resources is over-engineering.  We never provided that stuff
in /proc/iomem on sparc so no need to add it unnecessarily.

Furthermore, the /dev/kmem device probably needs similar restrictions,
it just blindly copies things as long as the address is lower than
high memory.

All of this stuff can potentially trigger bus errors, and really the
right thing to do is:

1) Add the necessary address validations as being discussed here

2) Put the accessed behind something like the PCI config space poking
   framework, it is able to recover from BUS errors cleanly.  Take
   a look at the code mentioning 'pci_poke_in_progress'.

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux