Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1358781 - TestOnly: Fix missing error checking in iproute_restore()
Summary: TestOnly: Fix missing error checking in iproute_restore()
Keywords:
Status: MODIFIED
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iproute
Version: 7.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Matteo Croce
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On: 1435647
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-21 12:59 UTC by Phil Sutter
Modified: 2018-11-08 14:22 UTC (History)
8 users (show)

Fixed In Version: iproute-4.11.0-4.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Phil Sutter 2016-07-21 12:59:50 UTC
That function has several problems:
* ftell() may return -1 in error case, which is not handled and therefore pass a negative offset to fseek().
* return code of fseek() is not checked.

AFAICT, it looks like this could lead to sending garbage to the kernel.

Comment 1 Hangbin Liu 2016-09-22 06:51:23 UTC
commit bffb68b6c28a942d5341a912f5a11894f8bcf243
Author: Hangbin Liu <liuhangbin@gmail.com>
Date:   Thu Sep 8 10:26:57 2016 +0800

    ip route: check ftell, fseek return value

Comment 2 Matteo Croce 2017-08-08 09:53:14 UTC
It seems that this change (or part of it) is needed before bffb68b6c2

commit 74af8dd9620e4322babf9d2a936b1d333a4e37e0
Author: Xin Long <lucien.xin@gmail.com>
Date:   Tue Jul 12 21:37:58 2016 +0800

    ip route: restore route entries in correct order

Comment 3 Phil Sutter 2017-08-08 18:37:31 UTC
Hi Matteo,

(In reply to Matteo Croce from comment #2)
> It seems that this change (or part of it) is needed before bffb68b6c2
> 
> commit 74af8dd9620e4322babf9d2a936b1d333a4e37e0
> Author: Xin Long <lucien.xin@gmail.com>
> Date:   Tue Jul 12 21:37:58 2016 +0800
> 
>     ip route: restore route entries in correct order

This commit has been backported to RHEL7 in iproute-3.10.0-69.el7 and it is upstream since v4.7.0. Am I missing something?

Cheers, Phil

Comment 4 Matteo Croce 2017-08-09 09:08:09 UTC
Sorry, I was looking at the master branch.
I switched to rhel7.4, thanks


Note You need to log in before you can comment on or make changes to this bug.