]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
slip: make slhc_free() silently accept an error pointer
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 25 Apr 2019 23:13:58 +0000 (16:13 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit6cbaec8dff7e67482a12f3319c33c3755d2d21ea
treea19f012a761fc9de9a89346f327fc2e828032eb5
parent1bd3165b2dab1676087bdd4f9d85c3cfdeea0d59
slip: make slhc_free() silently accept an error pointer

BugLink: https://bugs.launchpad.net/bugs/1838459
commit baf76f0c58aec435a3a864075b8f6d8ee5d1f17e upstream.

This way, slhc_free() accepts what slhc_init() returns, whether that is
an error or not.

In particular, the pattern in sl_alloc_bufs() is

        slcomp = slhc_init(16, 16);
        ...
        slhc_free(slcomp);

for the error handling path, and rather than complicate that code, just
make it ok to always free what was returned by the init function.

That's what the code used to do before commit 4ab42d78e37a ("ppp, slip:
Validate VJ compression slot parameters completely") when slhc_init()
just returned NULL for the error case, with no actual indication of the
details of the error.

Reported-by: syzbot+45474c076a4927533d2e@syzkaller.appspotmail.com
Fixes: 4ab42d78e37a ("ppp, slip: Validate VJ compression slot parameters completely")
Acked-by: Ben Hutchings <ben@decadent.org.uk>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/slip/slhc.c