Exploit databaseDownload repository ZIP
GH-cd474985a1d611a2a689e02bc95daae0
satheesh575555/frameworks_base_aosp10_r33_cve-2022-20142
Sources for CVE-2022-20142
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files61
satheesh575555/frameworks_base_aosp10_r33_cve-2022-20142Revision 0b10dce4665c
- ↑..Parent directory
- dump/
- function/
- ArrayUtils.java
- AsyncChannel.java
- AsyncService.java
- BitUtils.java
- BitwiseInputStream.java
- BitwiseOutputStream.java
- CallbackRegistry.java
- CharSequences.java
- CollectionUtils.java
- ConcurrentUtils.java
- ContrastColorUtil.java
- DumpUtils.java
- EmergencyAffordanceManager.java
- ExponentiallyBucketedHistogram.java
- FastMath.java
- FastPrintWriter.java
- FastXmlSerializer.java
- FileRotator.java
- FunctionalUtils.java
- GrowingArrayUtils.java
- HexDump.java
- IState.java
- ImageUtils.java
- IndentingPrintWriter.java
- IntPair.java
- JournaledFile.java
- LatencyTracker.java
- LineBreakBufferedWriter.java
- LocalLog.java
- MemInfoReader.java
- MessageUtils.java
- MimeIconUtils.java
- NotificationMessagingUtil.java
- OWNERS
- ObjectUtils.java
- ParseUtils.java
- Preconditions.java
- ProcFileReader.java
- ProgressReporter.java
- Protocol.java
- ProviderAccessStats.java
- RingBuffer.java
- RingBufferIndices.java
- ScreenRecordHelper.java
- ScreenShapeHelper.java
- ScreenshotHelper.java
- SizedInputStream.java
- StatLogger.java
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
core/java/com/android/internal/util/MemInfoReader.java
Java · 3,508 bytes/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.util;
import android.annotation.UnsupportedAppUsage;
import android.os.Debug;
import android.os.StrictMode;
public final class MemInfoReader {
final long[] mInfos = new long[Debug.MEMINFO_COUNT];
@UnsupportedAppUsage
public void readMemInfo() {
// Permit disk reads here, as /proc/meminfo isn't really "on
// disk" and should be fast. TODO: make BlockGuard ignore
// /proc/ and /sys/ files perhaps?
StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskReads();
try {
Debug.getMemInfo(mInfos);
} finally {
StrictMode.setThreadPolicy(savedPolicy);
}
}
/**
* Total amount of RAM available to the kernel.
*/
@UnsupportedAppUsage
public long getTotalSize() {
return mInfos[Debug.MEMINFO_TOTAL] * 1024;
}
/**
* Amount of RAM that is not being used for anything.
*/
@UnsupportedAppUsage
public long getFreeSize() {
return mInfos[Debug.MEMINFO_FREE] * 1024;
}
/**
* Amount of RAM that the kernel is being used for caches, not counting caches
* that are mapped in to processes.
*/
@UnsupportedAppUsage
public long getCachedSize() {
return getCachedSizeKb() * 1024;
}
/**
* Amount of RAM that is in use by the kernel for actual allocations.
*/
public long getKernelUsedSize() {
return getKernelUsedSizeKb() * 1024;
}
/**
* Total amount of RAM available to the kernel.
*/
public long getTotalSizeKb() {
return mInfos[Debug.MEMINFO_TOTAL];
}
/**
* Amount of RAM that is not being used for anything.
*/
public long getFreeSizeKb() {
return mInfos[Debug.MEMINFO_FREE];
}
/**
* Amount of RAM that the kernel is being used for caches, not counting caches
* that are mapped in to processes.
*/
public long getCachedSizeKb() {
return mInfos[Debug.MEMINFO_BUFFERS] + mInfos[Debug.MEMINFO_SLAB_RECLAIMABLE]
+ mInfos[Debug.MEMINFO_CACHED] - mInfos[Debug.MEMINFO_MAPPED];
}
/**
* Amount of RAM that is in use by the kernel for actual allocations.
*/
public long getKernelUsedSizeKb() {
return mInfos[Debug.MEMINFO_SHMEM] + mInfos[Debug.MEMINFO_SLAB_UNRECLAIMABLE]
+ mInfos[Debug.MEMINFO_VM_ALLOC_USED] + mInfos[Debug.MEMINFO_PAGE_TABLES]
+ mInfos[Debug.MEMINFO_KERNEL_STACK];
}
public long getSwapTotalSizeKb() {
return mInfos[Debug.MEMINFO_SWAP_TOTAL];
}
public long getSwapFreeSizeKb() {
return mInfos[Debug.MEMINFO_SWAP_FREE];
}
public long getZramTotalSizeKb() {
return mInfos[Debug.MEMINFO_ZRAM_TOTAL];
}
@UnsupportedAppUsage
public long[] getRawInfo() {
return mInfos;
}
}