Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 683160 - tinc-1.0.35: RFC, PATCH: fix icmpv6 checksum
Summary: tinc-1.0.35: RFC, PATCH: fix icmpv6 checksum
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-12 14:33 UTC by Benda Xu
Modified: 2019-04-16 23:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
tinc-1.0.35-icmpv6-checksum.patch (tinc-1.0.35-icmpv6-checksum.patch,3.37 KB, patch)
2019-04-12 14:36 UTC, Benda Xu
Details | Diff
patch for workaround inet_checksum problem (0001-Work-around-a-GCC-bug-that-causes-inet_checksum-to-g.patch,1.77 KB, patch)
2019-04-15 02:12 UTC, Yixun Lan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2019-04-12 14:33:25 UTC
Hi,

The icmpv6 generation of tinc is not correct if the corresponding functions is compiled by gcc inline. I intend to adopt the Debian patch to advise gcc not to inline it and bump the ebuild version to 1.0.35-r2.

What do you think?  If there no objections, I would like to commit the patch in a week.

Benda

Reproducible: Always
Comment 1 Benda Xu gentoo-dev 2019-04-12 14:36:43 UTC
Created attachment 572566 [details, diff]
tinc-1.0.35-icmpv6-checksum.patch

The proposed commit.
Comment 2 Yixun Lan archtester gentoo-dev 2019-04-15 01:50:42 UTC
@heroxbd
thanks for the work, I'm fine with the patch included and have a revision bump

@blueness 
it's a trivial patch and should be quite safe to apply to ..
but can we report this to upstream and have them included it?
Comment 3 Yixun Lan archtester gentoo-dev 2019-04-15 02:12:28 UTC
Created attachment 572852 [details, diff]
patch for workaround inet_checksum problem

@heroxbd

hi, you propose a patch only for version 1.0.35? while I think 1.1 will be also affected by same issue, poke upstream's code I found this patch[1] in 1.1 branch, could you try to see if it also solve your problem?

[1] http://www.tinc-vpn.org/git/browse?p=tinc;a=commit;h=7c73cb3ace6659df58ec2382b8d47bb521dad886
Comment 4 Benda Xu gentoo-dev 2019-04-15 03:39:36 UTC
(In reply to Yixun Lan from comment #3)
> Created attachment 572852 [details, diff] [details, diff]
> patch for workaround inet_checksum problem
> 
> @heroxbd
> 
> hi, you propose a patch only for version 1.0.35? while I think 1.1 will be
> also affected by same issue, poke upstream's code I found this patch[1] in
> 1.1 branch, could you try to see if it also solve your problem?
> 
> [1]
> http://www.tinc-vpn.org/git/browse?p=tinc;a=commit;
> h=7c73cb3ace6659df58ec2382b8d47bb521dad886

Nice catch!

The tinc-1.1 patch works.  It is more suitable to be back-ported.

Benda
Comment 5 Larry the Git Cow gentoo-dev 2019-04-15 07:12:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34da8fc9b7346abe20d3f97fe319bc849a0518dc

commit 34da8fc9b7346abe20d3f97fe319bc849a0518dc
Author:     Yixun Lan <dlan@gentoo.org>
AuthorDate: 2019-04-15 07:07:20 +0000
Commit:     Yixun Lan <dlan@gentoo.org>
CommitDate: 2019-04-15 07:11:34 +0000

    net-vpn/tinc: fix icmpv6 checksum error
    
    backport the patch from tinc-1.1 branch,
    thanks Benda Xu for testing
    
    Closes: https://bugs.gentoo.org/683160
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Yixun Lan <dlan@gentoo.org>

 net-vpn/tinc/Manifest              |  1 +
 net-vpn/tinc/tinc-1.0.35-r2.ebuild | 54 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
Comment 6 Maciej S. Szmigiero 2019-04-16 13:07:41 UTC
This is really a strict aliasing violation in inet_checksum(), not a compiler
bug.
Please see https://github.com/gsliepen/tinc/pull/221 for a proper fix.
Comment 7 Benda Xu gentoo-dev 2019-04-16 15:49:07 UTC
(In reply to Maciej S. Szmigiero from comment #6)
> This is really a strict aliasing violation in inet_checksum(), not a compiler
> bug.
> Please see https://github.com/gsliepen/tinc/pull/221 for a proper fix.

Maciej, thank you so much for finally fixing this bug!
Comment 8 Maciej S. Szmigiero 2019-04-16 20:52:05 UTC
(In reply to Benda Xu from comment #7)
> Maciej, thank you so much for finally fixing this bug!

You're welcome.
Comment 9 Anthony Basile gentoo-dev 2019-04-16 23:32:27 UTC
thanks for taking care of this!