From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88559C2D0A3 for ; Mon, 9 Nov 2020 13:06:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3770B20663 for ; Mon, 9 Nov 2020 13:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927213; bh=Y+h7QsOu55ZB97VkRuEf0hf6PppXRgG7RLw3rou4IEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hWbRRSJiYZqQy7WTDgBhDuy+ONnW5IIIUuGh7i5DeaTVG2D5vEdiOawJjqpROsGEq +5uJQRGInpkMGVIF4i+rORa7046ilgi/d4V5kt15GjLi7Oi+kW58DhgFNAyG4j8i9M WRtR5XbkdZ6VGPrrA2Bgl/HCxKKCnAVB2vKPvsYA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731155AbgKINGw (ORCPT ); Mon, 9 Nov 2020 08:06:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:59366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731111AbgKINGj (ORCPT ); Mon, 9 Nov 2020 08:06:39 -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 EA3A3206B2; Mon, 9 Nov 2020 13:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927198; bh=Y+h7QsOu55ZB97VkRuEf0hf6PppXRgG7RLw3rou4IEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lciy+1GTzvrD6eYVp0oCdb0RNz+gkJGLVc2w3UINwp47ICvGzi5PyOLweYsac8CVP z8gJ+H01B1pTbuOwm7sSKrQCFzX7EQAMiN/4GQID5WwwEuesl76aR2SMkJmjulvfEt KjBLfhFSeUtUfLojhQBzI1pv3gyTDZrE499VA28M= 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 4.14 07/48] sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms Date: Mon, 9 Nov 2020 13:55:16 +0100 Message-Id: <20201109125017.105494941@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125016.734107741@linuxfoundation.org> References: <20201109125016.734107741@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 @@ -1591,12 +1591,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: