From: Roman Mashak <mrv@mojatatu.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, kernel@mojatatu.com, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us,
Roman Mashak <mrv@mojatatu.com>
Subject: [PATCH v2 net-next 6/6] net sched actions: avoid bitwise operation on signed value in pedit
Date: Wed, 27 Jun 2018 13:33:35 -0400 [thread overview]
Message-ID: <1530120815-13736-7-git-send-email-mrv@mojatatu.com> (raw)
In-Reply-To: <1530120815-13736-1-git-send-email-mrv@mojatatu.com>
Since char can be unsigned or signed, and bitwise operators may have
implementation-dependent results when performed on signed operands,
declare 'u8 *' operand instead.
Suggested-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
---
net/sched/act_pedit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index caa6927a992c..ab151346d3d4 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -311,7 +311,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
}
if (tkey->offmask) {
- char *d, _d;
+ u8 *d, _d;
if (!offset_valid(skb, hoffset + tkey->at)) {
pr_info("tc action pedit 'at' offset %d out of bounds\n",
--
2.7.4
next prev parent reply other threads:[~2018-06-27 17:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 17:33 [PATCH v2 net-next 0/6] net sched actions: code style cleanup and fixes Roman Mashak
2018-06-27 17:33 ` [PATCH v2 net-next 1/6] net sched actions: fix coding style in pedit action Roman Mashak
2018-06-27 17:33 ` [PATCH v2 net-next 2/6] net sched actions: fix coding style in pedit headers Roman Mashak
2018-06-27 17:33 ` [PATCH v2 net-next 3/6] net sched actions: fix sparse warning Roman Mashak
2018-06-27 17:33 ` [PATCH v2 net-next 4/6] net sched actions: use sizeof operator for buffer length Roman Mashak
2018-06-27 17:33 ` [PATCH v2 net-next 5/6] net sched actions: fix misleading text strings in pedit action Roman Mashak
2018-06-27 17:33 ` Roman Mashak [this message]
2018-06-28 12:26 ` [PATCH v2 net-next 0/6] net sched actions: code style cleanup and fixes Davide Caratti
2018-06-28 13:12 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1530120815-13736-7-git-send-email-mrv@mojatatu.com \
--to=mrv@mojatatu.com \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox