aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/parisc/Makefile7
-rw-r--r--arch/parisc/kernel/ptrace.c6
-rw-r--r--drivers/parisc/pdc_stable.c15
3 files changed, 17 insertions, 11 deletions
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 7187664034c3..5db8882f732c 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -48,7 +48,12 @@ cflags-y := -pipe
48 48
49# These flags should be implied by an hppa-linux configuration, but they 49# These flags should be implied by an hppa-linux configuration, but they
50# are not in gcc 3.2. 50# are not in gcc 3.2.
51cflags-y += -mno-space-regs -mfast-indirect-calls 51cflags-y += -mno-space-regs
52
53# -mfast-indirect-calls is only relevant for 32-bit kernels.
54ifndef CONFIG_64BIT
55cflags-y += -mfast-indirect-calls
56endif
52 57
53# Currently we save and restore fpregs on all kernel entry/interruption paths. 58# Currently we save and restore fpregs on all kernel entry/interruption paths.
54# If that gets optimized, we might need to disable the use of fpregs in the 59# If that gets optimized, we might need to disable the use of fpregs in the
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 3bab72462ab5..92438c21d453 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -17,6 +17,7 @@
17#include <linux/user.h> 17#include <linux/user.h>
18#include <linux/personality.h> 18#include <linux/personality.h>
19#include <linux/security.h> 19#include <linux/security.h>
20#include <linux/seccomp.h>
20#include <linux/compat.h> 21#include <linux/compat.h>
21#include <linux/signal.h> 22#include <linux/signal.h>
22#include <linux/audit.h> 23#include <linux/audit.h>
@@ -271,10 +272,7 @@ long do_syscall_trace_enter(struct pt_regs *regs)
271 long ret = 0; 272 long ret = 0;
272 273
273 /* Do the secure computing check first. */ 274 /* Do the secure computing check first. */
274 if (secure_computing(regs->gr[20])) { 275 secure_computing_strict(regs->gr[20]);
275 /* seccomp failures shouldn't expose any additional code. */
276 return -1;
277 }
278 276
279 if (test_thread_flag(TIF_SYSCALL_TRACE) && 277 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
280 tracehook_report_syscall_entry(regs)) 278 tracehook_report_syscall_entry(regs))
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 0f54ab6260df..3651c3871d5b 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -278,7 +278,7 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
278{ 278{
279 struct hardware_path hwpath; 279 struct hardware_path hwpath;
280 unsigned short i; 280 unsigned short i;
281 char in[count+1], *temp; 281 char in[64], *temp;
282 struct device *dev; 282 struct device *dev;
283 int ret; 283 int ret;
284 284
@@ -286,8 +286,9 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
286 return -EINVAL; 286 return -EINVAL;
287 287
288 /* We'll use a local copy of buf */ 288 /* We'll use a local copy of buf */
289 memset(in, 0, count+1); 289 count = min_t(size_t, count, sizeof(in)-1);
290 strncpy(in, buf, count); 290 strncpy(in, buf, count);
291 in[count] = '\0';
291 292
292 /* Let's clean up the target. 0xff is a blank pattern */ 293 /* Let's clean up the target. 0xff is a blank pattern */
293 memset(&hwpath, 0xff, sizeof(hwpath)); 294 memset(&hwpath, 0xff, sizeof(hwpath));
@@ -393,14 +394,15 @@ pdcspath_layer_write(struct pdcspath_entry *entry, const char *buf, size_t count
393{ 394{
394 unsigned int layers[6]; /* device-specific info (ctlr#, unit#, ...) */ 395 unsigned int layers[6]; /* device-specific info (ctlr#, unit#, ...) */
395 unsigned short i; 396 unsigned short i;
396 char in[count+1], *temp; 397 char in[64], *temp;
397 398
398 if (!entry || !buf || !count) 399 if (!entry || !buf || !count)
399 return -EINVAL; 400 return -EINVAL;
400 401
401 /* We'll use a local copy of buf */ 402 /* We'll use a local copy of buf */
402 memset(in, 0, count+1); 403 count = min_t(size_t, count, sizeof(in)-1);
403 strncpy(in, buf, count); 404 strncpy(in, buf, count);
405 in[count] = '\0';
404 406
405 /* Let's clean up the target. 0 is a blank pattern */ 407 /* Let's clean up the target. 0 is a blank pattern */
406 memset(&layers, 0, sizeof(layers)); 408 memset(&layers, 0, sizeof(layers));
@@ -755,7 +757,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
755{ 757{
756 struct pdcspath_entry *pathentry; 758 struct pdcspath_entry *pathentry;
757 unsigned char flags; 759 unsigned char flags;
758 char in[count+1], *temp; 760 char in[8], *temp;
759 char c; 761 char c;
760 762
761 if (!capable(CAP_SYS_ADMIN)) 763 if (!capable(CAP_SYS_ADMIN))
@@ -765,8 +767,9 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
765 return -EINVAL; 767 return -EINVAL;
766 768
767 /* We'll use a local copy of buf */ 769 /* We'll use a local copy of buf */
768 memset(in, 0, count+1); 770 count = min_t(size_t, count, sizeof(in)-1);
769 strncpy(in, buf, count); 771 strncpy(in, buf, count);
772 in[count] = '\0';
770 773
771 /* Current flags are stored in primary boot path entry */ 774 /* Current flags are stored in primary boot path entry */
772 pathentry = &pdcspath_entry_primary; 775 pathentry = &pdcspath_entry_primary;