Exploit databaseDownload repository ZIP
GH-a4473dcd9930d1ae4c0775adc06b1cfb
satheesh575555/linux-4.19.72_cve-2022-36946
Sources for CVE-2022-36946
2 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files219
satheesh575555/linux-4.19.72_cve-2022-36946Revision 34cc7d8183fd
- ↑..Parent directory
- include/
- Kconfig
- Makefile
- am33xx-restart.c
- am33xx.h
- board-generic.c
- board-n8x0.c
- clkt2xxx_dpll.c
- clkt2xxx_dpllcore.c
- clkt2xxx_virt_prcm_set.c
- clock.c
- clock.h
- clock2xxx.h
- clock3xxx.h
- clockdomain.c
- clockdomain.h
- clockdomains2420_data.c
- clockdomains2430_data.c
- clockdomains2xxx_3xxx_data.c
- clockdomains33xx_data.c
- clockdomains3xxx_data.c
- clockdomains43xx_data.c
- clockdomains44xx_data.c
- clockdomains54xx_data.c
- clockdomains7xx_data.c
- clockdomains81xx_data.c
- cm-regbits-24xx.h
- cm-regbits-33xx.h
- cm-regbits-34xx.h
- cm-regbits-44xx.h
- cm-regbits-54xx.h
- cm-regbits-7xx.h
- cm.h
- cm1_44xx.h
- cm1_54xx.h
- cm1_7xx.h
- cm2_44xx.h
- cm2_54xx.h
- cm2_7xx.h
- cm2xxx.c
- cm2xxx.h
- cm2xxx_3xxx.h
- cm33xx.c
- cm33xx.h
- cm3xxx.c
- cm3xxx.h
- cm44xx.h
- cm81xx.h
- cm_common.c
- cminst44xx.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
arch/arm/mach-omap2/omap_hwmod_reset.c
C · 3,823 bytes/*
* OMAP IP block custom reset and preprogramming stubs
*
* Copyright (C) 2012 Texas Instruments, Inc.
* Paul Walmsley
*
* A small number of IP blocks need custom reset and preprogramming
* functions. The stubs in this file provide a standard way for the
* hwmod code to call these functions, which are to be located under
* drivers/.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <sound/aess.h>
#include "omap_hwmod.h"
#include "common.h"
#define OMAP_RTC_STATUS_REG 0x44
#define OMAP_RTC_KICK0_REG 0x6c
#define OMAP_RTC_KICK1_REG 0x70
#define OMAP_RTC_KICK0_VALUE 0x83E70B13
#define OMAP_RTC_KICK1_VALUE 0x95A4F1E0
#define OMAP_RTC_STATUS_BUSY BIT(0)
#define OMAP_RTC_MAX_READY_TIME 50
/**
* omap_hwmod_aess_preprogram - enable AESS internal autogating
* @oh: struct omap_hwmod *
*
* The AESS will not IdleAck to the PRCM until its internal autogating
* is enabled. Since internal autogating is disabled by default after
* AESS reset, we must enable autogating after the hwmod code resets
* the AESS. Returns 0.
*/
int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
{
void __iomem *va;
va = omap_hwmod_get_mpu_rt_va(oh);
if (!va)
return -EINVAL;
aess_enable_autogating(va);
return 0;
}
/**
* omap_rtc_wait_not_busy - Wait for the RTC BUSY flag
* @oh: struct omap_hwmod *
*
* For updating certain RTC registers, the MPU must wait
* for the BUSY status in OMAP_RTC_STATUS_REG to become zero.
* Once the BUSY status is zero, there is a 15 microseconds access
* period in which the MPU can program.
*/
static void omap_rtc_wait_not_busy(struct omap_hwmod *oh)
{
int i;
/* BUSY may stay active for 1/32768 second (~30 usec) */
omap_test_timeout(omap_hwmod_read(oh, OMAP_RTC_STATUS_REG)
& OMAP_RTC_STATUS_BUSY, OMAP_RTC_MAX_READY_TIME, i);
/* now we have ~15 microseconds to read/write various registers */
}
/**
* omap_hwmod_rtc_unlock - Unlock the Kicker mechanism.
* @oh: struct omap_hwmod *
*
* RTC IP have kicker feature. This prevents spurious writes to its registers.
* In order to write into any of the RTC registers, KICK values has te be
* written in respective KICK registers. This is needed for hwmod to write into
* sysconfig register.
*/
void omap_hwmod_rtc_unlock(struct omap_hwmod *oh)
{
unsigned long flags;
local_irq_save(flags);
omap_rtc_wait_not_busy(oh);
omap_hwmod_write(OMAP_RTC_KICK0_VALUE, oh, OMAP_RTC_KICK0_REG);
omap_hwmod_write(OMAP_RTC_KICK1_VALUE, oh, OMAP_RTC_KICK1_REG);
local_irq_restore(flags);
}
/**
* omap_hwmod_rtc_lock - Lock the Kicker mechanism.
* @oh: struct omap_hwmod *
*
* RTC IP have kicker feature. This prevents spurious writes to its registers.
* Once the RTC registers are written, KICK mechanism needs to be locked,
* in order to prevent any spurious writes. This function locks back the RTC
* registers once hwmod completes its write into sysconfig register.
*/
void omap_hwmod_rtc_lock(struct omap_hwmod *oh)
{
unsigned long flags;
local_irq_save(flags);
omap_rtc_wait_not_busy(oh);
omap_hwmod_write(0x0, oh, OMAP_RTC_KICK0_REG);
omap_hwmod_write(0x0, oh, OMAP_RTC_KICK1_REG);
local_irq_restore(flags);
}