Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3203204pxb; Mon, 9 Nov 2020 05:31:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwK5vLwWpSHi1ncchIVCpK4jaoa/us0Uk5B1HDnt08Njp7Y2hrtoc6j+kKaRHzkRvOKyTOC X-Received: by 2002:a50:96d2:: with SMTP id z18mr16042969eda.367.1604928668644; Mon, 09 Nov 2020 05:31:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928668; cv=none; d=google.com; s=arc-20160816; b=lP0oQuO837/K5i4GTZQw864IzoIGCFsK9Sq9tEw317b0dPYzwN3dlPazmnodT9R4Wy CnST6uigUGJBIJoQEYlqZhVS8544vDxGEHo/IfdAEbnE3S2DF+UYkAcVgrQdOjRBN9ke vxfMlYQbeoA4jc71XHPsCvm5sDQzZvqmJUICOooUVQErJqH1RF5jDXeiRy6zidyyvLX8 FFf6cwb1+CfxxOTeiceXKxQnJv8lDAmACeYnOhcGPlFBgylEOOBBBaJE71eFQryMYF/I 3pKUjt7aQNAVmaRgUUW8IqLZjj3q6zx/6ZcSLfrwhGDo8c5S/eaUHnB9VjrtabErmzjp tzYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o0zvj1Pb42odZUGqvH6lsoVnobtvFqPX1fqNo/deu9I=; b=xg2BsmgGkPMsHVfoR38uC4+1abTpi/KHQBnnCALjbaq9Mrvtsl5rz5RVIQIPt1B8iA J357Uhdt+ExNmHSlk91z9i8WlZjIKh7txQb/k5WASJn2CaGvD8UzEDmm+QzzRisohgQe SPxXAUOraAlHXKGMIxA1CLrar6mlpQ2GQFEv4+RnWjPKeacbZjuyl6WiEc4Ln3Iy+Jri 2YDs+APaspu8Gu+uwrSKTCYWgGb+a33uw+XJZeHgU+SBnAnWs1Kw0RohRfXXNqtiCFoJ Dwxl0K4de6S2+K55h3UwsnaZdsnpvwy40RB8lZu7TnvYOYfan9ZKJmMAYaSjUzarvNhs 7/ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iOTOiwVE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si7050304edq.363.2020.11.09.05.30.44; Mon, 09 Nov 2020 05:31:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iOTOiwVE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732571AbgKINMX (ORCPT + 99 others); Mon, 9 Nov 2020 08:12:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:37784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731873AbgKINMO (ORCPT ); Mon, 9 Nov 2020 08:12:14 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE01C2083B; Mon, 9 Nov 2020 13:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927533; bh=0QOxvSJhpAHWuVkKjKqImBorpm9ydfXg0rELIMh5bqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iOTOiwVEy7Ene+3yZa7uOUDVbc8HydgoNaSHsQ0TJEDng05t3RuJndtebbT8ekqJu XjCINdPcrMcj+9OMi/YhLQbAO/VALwM+UWlFyfT5d2+Fya1p5rQ+980DpsXBzPRLSf w1QCxqxH3iiaB0e1ZcreigcW5vYGs/17QM2INLoI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Petr Malat , Marcelo Ricardo Leitner , Jakub Kicinski Subject: [PATCH 5.4 20/85] sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms Date: Mon, 9 Nov 2020 13:55:17 +0100 Message-Id: <20201109125023.555225859@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125022.614792961@linuxfoundation.org> References: <20201109125022.614792961@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Petr Malat [ Upstream commit b6df8c81412190fbd5eaa3cec7f642142d9c16cd ] Commit 978aa0474115 ("sctp: fix some type cast warnings introduced since very beginning")' broke err reading from sctp_arg, because it reads the value as 32-bit integer, although the value is stored as 16-bit integer. Later this value is passed to the userspace in 16-bit variable, thus the user always gets 0 on big-endian platforms. Fix it by reading the __u16 field of sctp_arg union, as reading err field would produce a sparse warning. Fixes: 978aa0474115 ("sctp: fix some type cast warnings introduced since very beginning") Signed-off-by: Petr Malat Acked-by: Marcelo Ricardo Leitner Link: https://lore.kernel.org/r/20201030132633.7045-1-oss@malat.biz Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/sctp/sm_sideeffect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c @@ -1600,12 +1600,12 @@ static int sctp_cmd_interpreter(enum sct break; case SCTP_CMD_INIT_FAILED: - sctp_cmd_init_failed(commands, asoc, cmd->obj.u32); + sctp_cmd_init_failed(commands, asoc, cmd->obj.u16); break; case SCTP_CMD_ASSOC_FAILED: sctp_cmd_assoc_failed(commands, asoc, event_type, - subtype, chunk, cmd->obj.u32); + subtype, chunk, cmd->obj.u16); break; case SCTP_CMD_INIT_COUNTER_INC: