From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-kernel@vger.kernel.org, David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH 0/5] tun/macvtap: TUNSETIFF fixes
Date: Wed, 17 Dec 2014 03:19:52 +0008 [thread overview]
Message-ID: <1418785912.6058.0@smtp.corp.redhat.com> (raw)
In-Reply-To: <1418732988-3535-1-git-send-email-mst@redhat.com>
On Tue, Dec 16, 2014 at 9:04 PM, Michael S. Tsirkin <mst@redhat.com>
wrote:
> Dan Carpenter reported the following:
> static checker warning:
>
> drivers/net/tun.c:1694 tun_set_iff()
> warn: 0x17100 is larger than 16 bits
>
> drivers/net/tun.c
> 1692
> 1693 tun->flags = (tun->flags & ~TUN_FEATURES) |
> 1694 (ifr->ifr_flags & TUN_FEATURES);
> 1695
>
> It's complaining because the "ifr->ifr_flags" variable is a short
> (should it be unsigned?). The new define:
>
> #define IFF_VNET_LE 0x10000
>
> doesn't fit in two bytes. Other suspect looking code could be:
>
> return __virtio16_to_cpu(q->flags & IFF_VNET_LE, val);
>
> And that's true: we have run out of IFF flags in tun.
I don't have objections on this series.
Just note that we still have several bits available.
>
> So let's not try to add more: add simple GET/SET ioctls
> instead. Easy to test, leads to clear semantics.
>
> Alternatively we'll have to revert the whole thing for 3.19,
> but that seems more work as this has dependencies
> in other places.
>
> While here, I noticed that macvtap was actually reading
> ifreq flags as a 32 bit field.
> Fix that up as well.
>
> Michael S. Tsirkin (5):
> macvtap: fix uninitialized access on TUNSETIFF
> if_tun: add TUNSETVNETLE/TUNGETVNETLE
> tun: drop broken IFF_VNET_LE
> macvtap: drop broken IFF_VNET_LE
> if_tun: drop broken IFF_VNET_LE
>
> include/uapi/linux/if_tun.h | 3 ++-
> drivers/net/macvtap.c | 30 ++++++++++++++++++++++++------
> drivers/net/tun.c | 26 +++++++++++++++++++++++---
> 3 files changed, 49 insertions(+), 10 deletions(-)
>
> --
> MST
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-12-17 3:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-16 13:04 Michael S. Tsirkin
2014-12-16 13:04 ` [PATCH 1/5] macvtap: fix uninitialized access on TUNSETIFF Michael S. Tsirkin
2014-12-16 13:05 ` [PATCH 2/5] if_tun: add TUNSETVNETLE/TUNGETVNETLE Michael S. Tsirkin
2014-12-16 13:05 ` [PATCH 3/5] tun: drop broken IFF_VNET_LE Michael S. Tsirkin
2014-12-17 3:15 ` Jason Wang
2014-12-16 13:05 ` [PATCH 4/5] macvtap: " Michael S. Tsirkin
2014-12-16 13:05 ` [PATCH 5/5] if_tun: " Michael S. Tsirkin
2014-12-16 16:20 ` [PATCH 0/5] tun/macvtap: TUNSETIFF fixes David Miller
2014-12-17 3:11 ` Jason Wang [this message]
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=1418785912.6058.0@smtp.corp.redhat.com \
--to=jasowang@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
/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
Powered by JetHome