Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3928097imm; Mon, 8 Oct 2018 11:50:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV60arQaOfZJKP0CXDJ4xiXAtOBWdjaaVvEOOzX7yuVluYIRMo54dpVOHOL5UnOCZN8a4SawZ X-Received: by 2002:a17:902:ab93:: with SMTP id f19-v6mr13185596plr.63.1539024613147; Mon, 08 Oct 2018 11:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024613; cv=none; d=google.com; s=arc-20160816; b=YtFanM0RcbvpzNyUBGN5xg9qgaKU7SbVlSxYfm7B/zS3AYAUIyRBYUkV4S4KQ53e1K xpzYJsQS4EBv7ALN4uDfHM07VI+UCCjlQyzEcTw4b0FlPzdeX4e6uM4koAuJ6isSH3wr 1EWxqQd5QckgGAFpGqIfgdop4lsNKp9Gr/A0990tQ+mpM18uobylv2DmOfwxQJe4Sd6Z dBHXh/BUM6PXWDJNASZOGwlNOAKw98TymaDtu41cEOTO9A2/PrKUBbkeL7PuvZpKB7TH 4CsGlj3drwQY9+bNlk3VPQCbbyPa5taQmXNqjnmUkgdB+pdhkQ0Or0NaGnfkFbuq62O2 /kVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1m5kBtslmlISpMRg8Jn2TDZYceMrOfxRX+BvbVo7wGk=; b=E7qWHeVThuMtwfp/iLQHzNDCSZ8jyk6Rdj6U2eKbc3pZCuAt0LFSyYWIdvNAVeqTyM pi1ow+C7N6TCsal2fdsDX/sqdIzjDtwJHtKCKFzFx6kl8P3MiVEmqfmcHzOUKN2VxdSr H7QQt8p26JyU6CQYpXrXFlwBhlvI5J7d0ILfeEoVGBciLNwub94sdcO+ifOacXV8Cg6C RcFp2mvOAacCGy0TPLP2KThJEGRVx7Y+Qq7w9CDAFm4Wd0aOb470KW84yvsoujXoKYRA U9uzwGnJ2gPzC2Swt0qUdngEEEPFzssKt5b+YJWQeCiLoooeCJ7V2w3gGbF1M7LLYrJn tv0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ep3COYZO; 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 e23-v6si17346003pgg.394.2018.10.08.11.49.58; Mon, 08 Oct 2018 11:50:13 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Ep3COYZO; 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 S1731970AbeJICC5 (ORCPT + 99 others); Mon, 8 Oct 2018 22:02:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:52342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730559AbeJICC4 (ORCPT ); Mon, 8 Oct 2018 22:02:56 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 B4A10204FD; Mon, 8 Oct 2018 18:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024589; bh=2+5CX9mfV/8kGn5Lipvzlt8Tg2C2qdBHEjEDxKR5rSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ep3COYZOVK5aOuwQ1qi5IC19ejhop7p3tL+t5xJYs0YiS0Hn2pRi5h3V30vYQB+K/ G9i7od+3U6FFRIagHL1/QOsb4VnW0mDiPphN0LQAG5PMxBJfu19F+cNDtfJAXlDZ9k YRTmLXcAQX+QdytqG5RFp3ZdTQ0WNQfd+w5I2aoY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Greentime Hu , Sasha Levin Subject: [PATCH 4.18 066/168] nds32: fix logic for module Date: Mon, 8 Oct 2018 20:30:46 +0200 Message-Id: <20181008175622.561691456@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greentime Hu [ Upstream commit 1dfdf99106668679b0de5a62fd4f42c1a11c9445 ] This bug is report by Dan Carpenter. We shall use ~loc_mask instead of !loc_mask because we need to and(&) the bits of ~loc_mask. Reported-by: Dan Carpenter Fixes: c9a4a8da6baa ("nds32: Loadable modules") Signed-off-by: Greentime Hu Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/nds32/kernel/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/nds32/kernel/module.c +++ b/arch/nds32/kernel/module.c @@ -40,7 +40,7 @@ void do_reloc16(unsigned int val, unsign tmp2 = tmp & loc_mask; if (partial_in_place) { - tmp &= (!loc_mask); + tmp &= (~loc_mask); tmp = tmp2 | ((tmp + ((val & val_mask) >> val_shift)) & val_mask); } else { @@ -70,7 +70,7 @@ void do_reloc32(unsigned int val, unsign tmp2 = tmp & loc_mask; if (partial_in_place) { - tmp &= (!loc_mask); + tmp &= (~loc_mask); tmp = tmp2 | ((tmp + ((val & val_mask) >> val_shift)) & val_mask); } else {