Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2022-1015 — Linux Kernel 1-Day Analysis & Exploitation | Kitploit
Tools/GitHubGitHub/more-kohii/cve-2022-1015
Vulnerability AnalysisExploitationLearning & EducationBinary Exploitation
GitHubmore-kohii/cve-2022-1015

CVE-2022-1015

Linux Kernel 1-Day Analysis & Exploitation

View Repository
113 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2022-1015

Root Cause

In the nft_parse_register function, because there is no validation when the arg defaults, an out-of-bounds (OOB) occurs on the stack of the nft_do_chain function.

At this point, using the payload expression allows both read and write.

The payload operates as follows:

image

That is, by appropriately adjusting the index, OOB read/write on the stack is possible.

However, there is a function that validates regs.

root@kitploit:~
default:
		if (reg < NFT_REG_1 * NFT_REG_SIZE / NFT_REG32_SIZE)
			return -EINVAL;
		if (len == 0)
			return -EINVAL;
		if (reg * NFT_REG32_SIZE + len >
		    sizeof_field(struct nft_regs, data))
			return -ERANGE;

		if (data != NULL && type != NFT_DATA_VALUE)
			return -EINVAL;
		return 0;

Looking at the code above, it must satisfy reg * NFT_REG32_SIZE + len > sizeof_field(struct nft_regs, data).

Plugging in constants, it must satisfy reg * 4 + len > 80.

Download Tool

That is, you need to adjust len appropriately according to reg.

Reference Source Code

  • nft_regs

    root@kitploit:~
    struct nft_regs {
    	union {
    		u32			data[20];
    		struct nft_verdict	verdict;
    	};
    };
    
  • nft_do_chain

    root@kitploit:~
    unsigned int
    nft_do_chain(struct nft_pktinfo *pkt, void *priv)
    {
    	const struct nft_chain *chain = priv, *basechain = chain;
    	const struct net *net = nft_net(pkt);
    	struct nft_rule *const *rules;
    	const struct nft_rule *rule;
    	const struct nft_expr *expr, *last;
    	struct nft_regs regs;
    	...
    }
    
  • nft_parse_register

    root@kitploit:~
    static unsigned int nft_parse_register(const struct nlattr *attr)
    {
    	unsigned int reg;
    
    	reg = ntohl(nla_get_be32(attr));
    	switch (reg) {
    	case NFT_REG_VERDICT...NFT_REG_4:
    		return reg * NFT_REG_SIZE / NFT_REG32_SIZE;
    	default:
    		return reg + NFT_REG_SIZE / NFT_REG32_SIZE - NFT_REG32_00;
    	}
    }