Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1412664imm; Thu, 5 Jul 2018 22:55:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0FFZI9QKmOdxuNp21MJdnsKxrowryOeVy2nBR5djg+80sCF4m8rzaVx//g58licMaQeda X-Received: by 2002:a63:81c3:: with SMTP id t186-v6mr1976874pgd.413.1530856512986; Thu, 05 Jul 2018 22:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530856512; cv=none; d=google.com; s=arc-20160816; b=XU9iUjF1qaWDxP1DOkzdgLxpqEhH0s9tsWDtBKvHU+XBUv7UxYOIgWfeiiAvpkSEqr DBw9Hdnjt8kxwVueimZLU65n0ld6zXjrMKvl496F+NbfEcLp81WKqAv3Ujrq/Vl2JGI8 BpQkwjdW9T29XGTt+HegnVUpjx1+Vl4XiesDv9M3LFacxRnuIc1+giY7kEB6kdO3eEb3 Np3Q8Zw+REz0I6M6jNUUHXpaHvh5OD+k+8KBXvn2ym+jRgHFQnLVJrjDDqiiDs7Ng+oT BCgPP7edKAHJiDi9C+vKvzYEMIBCfEBNKl6O8/Zx4/y+zqefx4whILhUN/N7gCOeS6mY pUXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=0vERNaNbC9X7+DsJ/wuISrTUGdZPRdjlcXNPq8MeIFs=; b=TgWWB4y8eNx5MP2ocp0vBpwzXc+bbhWaL8WOeIORygxc9QIRXoxanZZoyYQFgVxD7l uqwg9ZU8spJu4bUEFEqDpsT+QoqJ9OgvSXjgayseHnCVCHG4POf11xx7QHi0HY5oqyLR 1N8gZFReN+3q7IFHMDKq+1tcJzSlBoLaRl1fCocO+YGGZlBvSCipmJHw5CL6QzFPIpcS wTCV+hs3BPgrQNlTnFqJRhw6CunDX/NA6CNs9jOPGClKnl5xK6BEQnN/jJY8AuyNP/tZ dMnehFB1xJ83Nmxd5fwheus5c6nyBKay0y9ASxw00IwLROrrQEz0HuujEnyvEda0lpyr EYhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y187-v6si7030721pgd.459.2018.07.05.22.54.59; Thu, 05 Jul 2018 22:55:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934728AbeGFFw7 (ORCPT + 99 others); Fri, 6 Jul 2018 01:52:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34006 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934704AbeGFFwt (ORCPT ); Fri, 6 Jul 2018 01:52:49 -0400 Received: from localhost (D57D388D.static.ziggozakelijk.nl [213.125.56.141]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 79C85898; Fri, 6 Jul 2018 05:52:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ivan Bornyakov , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 52/61] atm: zatm: fix memcmp casting Date: Fri, 6 Jul 2018 07:47:16 +0200 Message-Id: <20180706054714.330511750@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180706054712.332416244@linuxfoundation.org> References: <20180706054712.332416244@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ivan Bornyakov [ Upstream commit f9c6442a8f0b1dde9e755eb4ff6fa22bcce4eabc ] memcmp() returns int, but eprom_try_esi() cast it to unsigned char. One can lose significant bits and get 0 from non-0 value returned by the memcmp(). Signed-off-by: Ivan Bornyakov Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/atm/zatm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c @@ -1151,8 +1151,8 @@ static void eprom_get_byte(struct zatm_d } -static unsigned char eprom_try_esi(struct atm_dev *dev, unsigned short cmd, - int offset, int swap) +static int eprom_try_esi(struct atm_dev *dev, unsigned short cmd, int offset, + int swap) { unsigned char buf[ZEPROM_SIZE]; struct zatm_dev *zatm_dev;