lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20181203031747.GC11573@altlinux.org>
Date:   Mon, 3 Dec 2018 06:17:47 +0300
From:   "Dmitry V. Levin" <ldv@...linux.org>
To:     Ley Foon Tan <lftan@...era.com>
Cc:     Elvira Khabirova <lineprinter@...linux.org>,
        Eugene Syromyatnikov <esyr@...hat.com>,
        nios2-dev@...ts.rocketboards.org, linux-kernel@...r.kernel.org
Subject: [PATCH] nios2: fix syscall_get_error()

According to documentation in include/asm-generic/syscall.h,
syscall_get_error() should return -ERRORCODE if the system call failed.

This change fixes syscall_get_error() implementation on nios2 to match
its own syscall_set_return_value(), the documentation, and other
architectures where syscall_get_error() returns a non-positive value.

Fixes: 1000197d80132 ("nios2: System calls handling")
Cc: stable@...r.kernel.org # v3.19+
Signed-off-by: Dmitry V. Levin <ldv@...linux.org>
---
 arch/nios2/include/asm/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/nios2/include/asm/syscall.h b/arch/nios2/include/asm/syscall.h
index 9de220854c4a..abf54addb804 100644
--- a/arch/nios2/include/asm/syscall.h
+++ b/arch/nios2/include/asm/syscall.h
@@ -35,7 +35,7 @@ static inline void syscall_rollback(struct task_struct *task,
 static inline long syscall_get_error(struct task_struct *task,
 				struct pt_regs *regs)
 {
-	return regs->r7 ? regs->r2 : 0;
+	return regs->r7 ? -regs->r2 : 0;
 }
 
 static inline long syscall_get_return_value(struct task_struct *task,
-- 
ldv

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ