Commit 36749a96 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/linux-grsec: enable brcmfmac driver

used by macbook pro
parent a1b7cef2
......@@ -7,7 +7,7 @@ case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=${pkgver};;
esac
pkgrel=0
pkgrel=1
pkgdesc="Linux kernel with grsecurity"
url=http://grsecurity.net
depends="mkinitfs"
......@@ -21,6 +21,7 @@ source="http://ftp.kernel.org/pub/linux/kernel/v4.x/linux-$_kernver.tar.xz
fix-spi-nor-namespace-clash.patch
imx6q-no-unclocked-sleep.patch
gcc6.patch
config-grsec.x86
config-grsec.x86_64
......@@ -99,6 +100,7 @@ build() {
cd "$srcdir"/build-$i
make CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" \
KCFLAGS="-fno-pie" \
|| return 1
done
}
......@@ -172,6 +174,7 @@ _dev() {
echo "-$pkgrel-$_flavor" > "$dir"/localversion-alpine \
|| return 1
make -j1 -C "$srcdir"/linux-$_kernver O="$dir" HOSTCC="${CC:-gcc}" \
KCFLAGS="-fno-pie" \
silentoldconfig prepare modules_prepare scripts
# remove the stuff that poits to real sources. we want 3rd party
......@@ -215,8 +218,9 @@ md5sums="9a78fa2eb6c68ca5a40ed5af08142599 linux-4.4.tar.xz
ac33314348f124d01417693f252ced42 grsecurity-3.1-4.4.14-201604252206-alpine.patch
c32f1d7517a095a2645fc1c7dec5db8f fix-spi-nor-namespace-clash.patch
b11c29ee88f7f537973191036d48bee7 imx6q-no-unclocked-sleep.patch
0f3836729769884621131f0620b65482 config-grsec.x86
e7ce299970a212c6482f1d7f433ee1dc config-grsec.x86_64
90e0fca6cb7bca277394b0db7f605098 gcc6.patch
2da05cb44c4f954f05f58734f4e16760 config-grsec.x86
8d86b346ae0a68fea58f3eab2338641b config-grsec.x86_64
bd9cf4d55fef7f6f716bcd3878533a41 config-grsec.armhf
effe99ef985cebae1208c87530aace1a config-virtgrsec.x86
e6b011c803981b0105b2882254a9b8ae config-virtgrsec.x86_64"
......@@ -225,8 +229,9 @@ sha256sums="401d7c8fef594999a460d10c72c5a94e9c2e1022f16795ec51746b0d165418b2 li
06ae459e4a0b26d4abc4b5e2e5a48cd977c7b67bb2457d9c15af11fff7b863d8 grsecurity-3.1-4.4.14-201604252206-alpine.patch
b8ce28c61663dbd92f7e1c862c042c88c4d0459ce15f6e6ea121e20705b66212 fix-spi-nor-namespace-clash.patch
7e8a954750139a421a76e414e19a3b57645c9ec70e6c14a6b7708a3fa0cfd5e4 imx6q-no-unclocked-sleep.patch
b4c077e6de0fa122530422b04d7d4584da1765b9ae05d4b844bf0f3b0fafb148 config-grsec.x86
69ecc65ffa5b6ae82bfceb7549f19668e813f69aca7e295bf0d871c36d23f628 config-grsec.x86_64
21640b417cb9a389bf7be6a11dc71a481ec76fcfcc758992a9be158ab6a643e8 gcc6.patch
4098706e52e79c99b56e74c5aea53ba157c561c794819c130656d92a7b452210 config-grsec.x86
7a332837c3d63bf90bbab1df759801834393894e13f8a0647976dcec9d87a376 config-grsec.x86_64
5722cf941ae841f28306f785ccb478a99ed167c910a83f80ba570022d53a323e config-grsec.armhf
31098b41a807b671108546361f012b4a870d9d3532bc64ab8f36ac98a6a79908 config-virtgrsec.x86
14a9f1fc57d3c826b81148f497a9b2299c558a615fdee193e395833abec896b3 config-virtgrsec.x86_64"
......@@ -235,8 +240,9 @@ ee029b1b5df9787ce87ae7d1c25fa9782ce6be0bf27ae638f57e020f5035dbbd00b6d24bf7ce9601
605e4197093228e3fd84712dcfea3411829538f73bb547322d4442beec80f8e8f68a5ade81b05213e71a427b948a8df97c217efc99287a27d5032bf1f5c6ba28 grsecurity-3.1-4.4.14-201604252206-alpine.patch
410fe7dae27cb4998d17a441a5b2a19dd350636ead2de97d4ef5317501d9e82e2550bfca0f022c9be6296907c076c381e1e13060d1900ff26ee7d47f234fb104 fix-spi-nor-namespace-clash.patch
9980eb10f529bc5ce482ab0a0037febbc982b528c3e4d02fc4547e6dd45dc529a7b1711d0c89f942b1ae27842c3794b68a6b8959ef80f6fd00183d3a591cea07 imx6q-no-unclocked-sleep.patch
da2ff042bb35be1517dc0233d6ff90ad437d7b20c5ab8e72c58c3186cf5233378752f0ae12f49a35f3c4c218752a50bc04ee72215f7314b97fea58e7074d871e config-grsec.x86
34fb49b667520e7c2bbb2f6a0219b494b796d7fcf5603d129395ca4bc1567232186cb329678f9681b77c31beb75ad5c687bdcea93d268760da84493c92384694 config-grsec.x86_64
edcebc229956a05621ec1c89039b56aa61b468c74b54420ff72bd08658b65d29d6af385a7d78d1ce4b39889b407106b99efe7309f8a82974a74eb9edb9e89b64 gcc6.patch
0ba45dc80b9070a18bd31155eb2e658efdf8106fb331978d0b32bea68c9a401990b681df834319c9fa8599a78583bd4c45c274aa3d251aabc740d06141c5beb6 config-grsec.x86
65c8a18d3107be8766060eb7d7c89f2b865b38dc7e93f4110bffd98ef009f9cc192b3c9ad6fecbe412208c8efa93a526e81d4362bd207e6a585f30cc22ee8603 config-grsec.x86_64
8ac8719bd3b85f54d5d6abf1aa7b5dc21641b2c1e0a9cd880acfb8ee625500f39f07787e4daae3c8a88a136197ef3cc130be8b6ce0cccaf4f418577324f01415 config-grsec.armhf
fa699c514fffed626002bfaf9a17ce63f3cd8a8f8d42229f279d504097a8fe3047d8a3c11068ff58a08b5bf26e2883fc2141b1bbd886d3fb1a91a04b93d39e1a config-virtgrsec.x86
ba9ffcbea285ebffa0740a1ff8e5812da13d6fd51405cdf758cbb8e3d0567505e35a10add4ad7d326b1e9fce9ebe3521ccc7375082102bac5be40edee421067d config-virtgrsec.x86_64"
#
# Automatically generated file; DO NOT EDIT.
# Linux/i386 4.4.6 Kernel Configuration
# Linux/i386 4.4.14 Kernel Configuration
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
......@@ -2690,7 +2690,12 @@ CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
# CONFIG_B43LEGACY_PIO_MODE is not set
CONFIG_BRCMUTIL=m
CONFIG_BRCMSMAC=m
# CONFIG_BRCMFMAC is not set
CONFIG_BRCMFMAC=m
CONFIG_BRCMFMAC_PROTO_BCDC=y
CONFIG_BRCMFMAC_PROTO_MSGBUF=y
CONFIG_BRCMFMAC_SDIO=y
CONFIG_BRCMFMAC_USB=y
CONFIG_BRCMFMAC_PCIE=y
# CONFIG_BRCM_TRACING is not set
# CONFIG_BRCMDBG is not set
CONFIG_HOSTAP=m
......
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.4.6 Kernel Configuration
# Linux/x86 4.4.14 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
......@@ -2660,7 +2660,12 @@ CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
# CONFIG_B43LEGACY_PIO_MODE is not set
CONFIG_BRCMUTIL=m
CONFIG_BRCMSMAC=m
# CONFIG_BRCMFMAC is not set
CONFIG_BRCMFMAC=m
CONFIG_BRCMFMAC_PROTO_BCDC=y
CONFIG_BRCMFMAC_PROTO_MSGBUF=y
CONFIG_BRCMFMAC_SDIO=y
CONFIG_BRCMFMAC_USB=y
CONFIG_BRCMFMAC_PCIE=y
# CONFIG_BRCM_TRACING is not set
# CONFIG_BRCMDBG is not set
CONFIG_HOSTAP=m
......
diff --git a/grsecurity/gracl.c b/grsecurity/gracl.c
index 7ad630a..3c66319 100644
--- a/grsecurity/gracl.c
+++ b/grsecurity/gracl.c
@@ -196,7 +196,7 @@ static int prepend(char **buffer, int *buflen, const char *str, int namelen)
static int prepend_name(char **buffer, int *buflen, struct qstr *name)
{
- return prepend(buffer, buflen, name->name, name->len);
+ return prepend(buffer, buflen, (const char *)name->name, name->len);
}
static int prepend_path(const struct path *path, struct path *root,
@@ -560,7 +560,7 @@ struct name_entry *
__lookup_name_entry(const struct gr_policy_state *state, const char *name)
{
unsigned int len = strlen(name);
- unsigned int key = full_name_hash(name, len);
+ unsigned int key = full_name_hash((const unsigned char *)name, len);
unsigned int index = key % state->name_set.n_size;
struct name_entry *match;
@@ -582,7 +582,7 @@ static struct name_entry *
lookup_name_entry_create(const char *name)
{
unsigned int len = strlen(name);
- unsigned int key = full_name_hash(name, len);
+ unsigned int key = full_name_hash((const unsigned char *)name, len);
unsigned int index = key % running_polstate.name_set.n_size;
struct name_entry *match;
diff --git a/grsecurity/gracl_policy.c b/grsecurity/gracl_policy.c
index 0773423..bfcd64a 100644
--- a/grsecurity/gracl_policy.c
+++ b/grsecurity/gracl_policy.c
@@ -351,7 +351,7 @@ insert_name_entry(char *name, const u64 inode, const dev_t device, __u8 deleted)
struct name_entry **curr, *nentry;
struct inodev_entry *ientry;
unsigned int len = strlen(name);
- unsigned int key = full_name_hash(name, len);
+ unsigned int key = full_name_hash((const unsigned char *)name, len);
unsigned int index = key % polstate->name_set.n_size;
curr = &polstate->name_set.n_hash[index];
@@ -1376,7 +1376,7 @@ lookup_special_role_auth(__u16 mode, const char *rolename, unsigned char **salt,
FOR_EACH_ROLE_END(r)
for (i = 0; i < polstate->num_sprole_pws; i++) {
- if (!strcmp(rolename, polstate->acl_special_roles[i]->rolename)) {
+ if (!strcmp(rolename, (const char *)polstate->acl_special_roles[i]->rolename)) {
*salt = polstate->acl_special_roles[i]->salt;
*sum = polstate->acl_special_roles[i]->sum;
return 1;
@@ -1664,11 +1664,11 @@ write_grsec_handler(struct file *file, const char __user * buf, size_t count, lo
}
if (lookup_special_role_auth
- (gr_usermode->mode, gr_usermode->sp_role, &sprole_salt, &sprole_sum)
+ (gr_usermode->mode, (const char *)gr_usermode->sp_role, &sprole_salt, &sprole_sum)
&& ((!sprole_salt && !sprole_sum)
|| !(chkpw(gr_usermode, sprole_salt, sprole_sum)))) {
char *p = "";
- assign_special_role(gr_usermode->sp_role);
+ assign_special_role((const char *)gr_usermode->sp_role);
read_lock(&tasklist_lock);
if (current->real_parent)
p = current->real_parent->role->rolename;
diff --git a/grsecurity/grsum.c b/grsecurity/grsum.c
index 4fb2ce6..aef6b92 100644
--- a/grsecurity/grsum.c
+++ b/grsecurity/grsum.c
@@ -32,12 +32,12 @@ chkpw(struct gr_arg *entry, unsigned char *salt, unsigned char *sum)
sg_init_table(sg, 2);
sg_set_buf(&sg[0], salt, GR_SALT_LEN);
- sg_set_buf(&sg[1], entry->pw, strlen(entry->pw));
+ sg_set_buf(&sg[1], entry->pw, strlen((const char *)entry->pw));
desc.tfm = tfm;
desc.flags = 0;
- cryptres = crypto_hash_digest(&desc, sg, GR_SALT_LEN + strlen(entry->pw),
+ cryptres = crypto_hash_digest(&desc, sg, GR_SALT_LEN + strlen((const char *)entry->pw),
temp_sum);
memset(entry->pw, 0, GR_PW_LEN);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 25820d8..0491a0f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2386,7 +2386,7 @@ extern void sched_clock_init(void);
static inline void populate_stack(void)
{
struct task_struct *curtask = current;
- int c;
+ int __always_unused c;
int *ptr = curtask->stack;
int *end = curtask->stack + THREAD_SIZE;
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index a34ab2d..70fffac 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -517,7 +517,7 @@ static inline void sysfs_notify_dirent(struct kernfs_node *kn)
static inline struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent,
const unsigned char *name)
{
- return kernfs_find_and_get(parent, name);
+ return kernfs_find_and_get(parent, (const char *)name);
}
static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment