From patchwork Wed Dec 25 02:35:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 22746 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CFD33202FA for ; Wed, 25 Dec 2013 02:36:48 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf19002789pdj.11 for ; Tue, 24 Dec 2013 18:36:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=tnXt53hKTu8UniDsUWF/6V7tcxLT4ZTnDgsoAFKk1kI=; b=cIWd9KuVIy3RTx6tfDprHaxYrwMzKZK8tWXmIWja+y9Rucb+x0Vbyre4ImtJk4QfEx awxe+6/qRaYY0YpPsz4EOitf1NLItZZ0oGg/YfrQ0IW7r6eP+Qt5+U0xOrwSjAm3MTsj ZkbpWkWWIfJsxJTo3X/9POvPVzIGOXs1+M8kiwXaVdtlOjKJDx5wazA09/RF/2f0v30x 7LdfrUloPkHfPLe0W2xP9bwLuh2tgBeBWtvsq7llXtWgVdjPR2uyVK4xKvGznfxUF535 CBpZq9dMfgIsEhnYpTxb4hwo9GbFxjicHK4hLwet04ja6r+1b7g2q/08fCvTnkuif8lt SUKg== X-Gm-Message-State: ALoCoQl8EOtvVpoRIH3D2e1BEFrHxcO14f43yOGG8PatczRzHwtIvgPrbEgKVUcv3qeFnft1Dmw0 X-Received: by 10.66.231.132 with SMTP id tg4mr13363652pac.31.1387939007386; Tue, 24 Dec 2013 18:36:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.103 with SMTP id c7ls2132315qen.24.gmail; Tue, 24 Dec 2013 18:36:47 -0800 (PST) X-Received: by 10.58.168.205 with SMTP id zy13mr2512388veb.19.1387939007234; Tue, 24 Dec 2013 18:36:47 -0800 (PST) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id ec16si5981395veb.86.2013.12.24.18.36.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Dec 2013 18:36:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id x11so3663391vbb.36 for ; Tue, 24 Dec 2013 18:36:47 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr7008546vco.18.1387939007129; Tue, 24 Dec 2013 18:36:47 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp326078ved; Tue, 24 Dec 2013 18:36:46 -0800 (PST) X-Received: by 10.68.200.129 with SMTP id js1mr35988923pbc.14.1387939005479; Tue, 24 Dec 2013 18:36:45 -0800 (PST) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id ot3si17032139pac.21.2013.12.24.18.36.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Dec 2013 18:36:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of takahiro.akashi@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id md12so6941605pbc.19 for ; Tue, 24 Dec 2013 18:36:43 -0800 (PST) X-Received: by 10.66.123.5 with SMTP id lw5mr36041700pab.83.1387939003215; Tue, 24 Dec 2013 18:36:43 -0800 (PST) Received: from localhost.localdomain (KD182249080088.au-net.ne.jp. [182.249.80.88]) by mx.google.com with ESMTPSA id yi10sm58705800pab.8.2013.12.24.18.36.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Dec 2013 18:36:41 -0800 (PST) From: AKASHI Takahiro To: viro@zeniv.linux.org.uk, eparis@redhat.com Cc: linux-kernel@vger.kernel.org, linux-audit@redhat.com, patches@linaro.org, dsaxena@linaro.org, AKASHI Takahiro Subject: [PATCH] audit: correct a type mismatch in audit_syscall_exit() Date: Wed, 25 Dec 2013 11:35:53 +0900 Message-Id: <1387938953-15667-1-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: takahiro.akashi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , audit_syscall_exit() saves a result of regs_return_value() in intermediate "int" variable and passes it to __audit_syscall_exit(), which expects its second argument as a "long" value. This will result in truncating the value returned by a system call and making a wrong audit record. I don't know why gcc compiler doesn't complain about this, but anyway it causes a problem at runtime on arm64 (and probably most 64-bit archs). Signed-off-by: AKASHI Takahiro --- include/linux/audit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/audit.h b/include/linux/audit.h index c49a312..3dcb3f0 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -144,7 +144,7 @@ static inline void audit_syscall_exit(void *pt_regs) { if (unlikely(current->audit_context)) { int success = is_syscall_success(pt_regs); - int return_code = regs_return_value(pt_regs); + long return_code = regs_return_value(pt_regs); __audit_syscall_exit(success, return_code); }