Giter Site home page Giter Site logo

CVE-2022-20385 about libnl HOT 7 CLOSED

chengyechun avatar chengyechun commented on August 19, 2024
CVE-2022-20385

from libnl.

Comments (7)

thom311 avatar thom311 commented on August 19, 2024

Are there more details?

from libnl.

chengyechun avatar chengyechun commented on August 19, 2024

Are there more details?

a function called 'nla_parse', do not check the len of para, it will check nla_type (which can be controlled by userspace) with 'maxtype' (in this case, it is GSCAN_MAX), then it access polciy array 'policy[type]', which OOB access happens.Product: AndroidVersions: Android SoCAndroid ID: A-238379819

This is the link to the NVD, https://nvd.nist.gov/vuln/detail/CVE-2022-20385

https://ubuntu.com/security/CVE-2022-20385

from libnl.

thom311 avatar thom311 commented on August 19, 2024

That explanation is not sufficient (for me). I don't see how that's the case.

The code is here.

In particular, nla_for_each_attr() calls nla_ok(), which checks the length.

Might it be that Android forked nla_parse() and has different code? Or that it doesn't actually use libnl, but a similar code?

from libnl.

tijko avatar tijko commented on August 19, 2024

@thom311 Also there is a "Note" on https://security-tracker.debian.org/tracker/CVE-2022-20385 which says "NOT-FOR-US: Android".

Not being familiar with Android development I have been trying to track this distinction down. Where, if I can find the actual code that is in question then maybe it can be addressed.

So far this is the only place I can see it being used:

https://android.googlesource.com/platform/external/libnl/

And the diff between the files android/lib/attr.c and libnl/lib/attr.c:

3,9d2
<  * lib/attr.c		Netlink Attributes
<  *
<  *	This library is free software; you can redistribute it and/or
<  *	modify it under the terms of the GNU Lesser General Public
<  *	License as published by the Free Software Foundation version 2.1
<  *	of the License.
<  *
260c253
< 				goto errout;
---
> 				return err;
270c263
< 	if (rem > 0)
---
> 	if (rem > 0) {
272a266
> 	}
274,276c268
< 	err = 0;
< errout:
< 	return err;
---
> 	return 0;
551a544,546
> 	if (nl_addr_get_len(addr) == 0)
> 		return -NLE_INVAL;
> 

So with most of their version being versioned as 3.0 the source I cloned from their repository has been patched quite a bit.

@thom311 If I can be of more assistance please let me know. I have been looking over the differences between your library and their fork.

from libnl.

chengyechun avatar chengyechun commented on August 19, 2024

I will pay attention to the follow-up of this CVE. I am not involved in the Android community. How to use this interface needs to be further understood. Thank you for your reply.

from libnl.

tijko avatar tijko commented on August 19, 2024

@chengyechun to be clear the CVE is concerned with a fork of this codebase. The changes were made that differ from what is here.

from libnl.

thom311 avatar thom311 commented on August 19, 2024

I close this issue, as I think we agree that it does not affect the source in this repository.

If you disagree, please reopen or send a patch. Thank you.

from libnl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.