| From nobody Mon Sep 17 00:00:00 2001 |
| Subject: [PATCH] moxa serial: add proper capability check |
| From: Alan Cox <alan@redhat.com> |
| Date: 1136817328 -0500 |
| |
| This requires the proper capabilities for the moxa bios update ioctl's. |
| |
| Signed-off-by: Alan Cox <alan@redhat.com> |
| Signed-off-by: Linus Torvalds <torvalds@osdl.org> |
| Signed-off-by: Chris Wright <chrisw@sous-sol.org> |
| --- |
| drivers/char/moxa.c | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| --- linux-2.6.15.y.orig/drivers/char/moxa.c |
| +++ linux-2.6.15.y/drivers/char/moxa.c |
| @@ -1661,6 +1661,8 @@ int MoxaDriverIoctl(unsigned int cmd, un |
| case MOXA_FIND_BOARD: |
| case MOXA_LOAD_C320B: |
| case MOXA_LOAD_CODE: |
| + if (!capable(CAP_SYS_RAWIO)) |
| + return -EPERM; |
| break; |
| } |
| |