Re: [PATCH 1/1] Punch a hole in /dev/mem for librtas

2011-12-04 Thread Segher Boessenkool
+static inline int page_is_rtas_user_buf(unsigned long pfn) +{ + unsigned long paddr = (pfn << PAGE_SHIFT); + if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_RMOBUF_MAX)) It probably cannot overflow with actual values of rtas_rmo_buf and RTAS_RMOBUF_MAX, but otherwise it is

Re: [PATCH 1/1] Punch a hole in /dev/mem for librtas

2011-12-04 Thread Benjamin Herrenschmidt
On Sat, 2011-12-03 at 04:22 +0100, Segher Boessenkool wrote: > > +static inline int page_is_rtas_user_buf(unsigned long pfn) > > +{ > > + unsigned long paddr = (pfn << PAGE_SHIFT); > > + if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + > > RTAS_RMOBUF_MAX)) > > It probably cannot overflo

Re: [PATCH 1/1] Punch a hole in /dev/mem for librtas

2011-12-02 Thread Segher Boessenkool
+static inline int page_is_rtas_user_buf(unsigned long pfn) +{ + unsigned long paddr = (pfn << PAGE_SHIFT); + if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_RMOBUF_MAX)) It probably cannot overflow with actual values of rtas_rmo_buf and RTAS_RMOBUF_MAX, but otherwise it is an

[PATCH 1/1] Punch a hole in /dev/mem for librtas

2011-12-02 Thread Sukadev Bhattiprolu
Subject: [PATCH 1/1] Punch a hole in /dev/mem for librtas With CONFIG_STRICT_DEVMEM=y, user space cannot read any part of /dev/mem. Since this breaks librtas, punch a hole in /dev/mem to allow access to the rmo_buffer that librtas needs. Anton Blanchard reported the problem and helped with the