Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
checks: write
pull-requests: write

jobs:
ci:
runs-on: ubuntu-latest
name: CI for Pull Request
steps:
- name: Checkout the source code
uses: actions/checkout@v3
with:
path: src/src

- name: CI
uses: bluez/action-ci@main
with:
task: ci
base_folder: src
space: kernel
github_token: ${{ secrets.GITHUB_TOKEN }}
email_token: ${{ secrets.EMAIL_TOKEN }}
patchwork_token: ${{ secrets.PATCHWORK_TOKEN }}
patchwork_user: ${{ secrets.PATCHWORK_USER }}

44 changes: 44 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Sync

on:
schedule:
- cron: "*/5 * * * *"

jobs:
sync_repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master

- name: Sync Repo
uses: bluez/action-ci@main
with:
task: sync
workflow: workflow
upstream_repo: 'https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup PR
uses: bluez/action-ci@main
with:
task: cleanup
github_token: ${{ secrets.ACTION_TOKEN }}

sync_patchwork:
needs: sync_repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Sync Patchwork
uses: bluez/action-ci@main
with:
task: patchwork
workflow: workflow
space: kernel
github_token: ${{ secrets.ACTION_TOKEN }}
email_token: ${{ secrets.EMAIL_TOKEN }}
patchwork_token: ${{ secrets.PATCHWORK_TOKEN }}
patchwork_user: ${{ secrets.PATCHWORK_USER }}
8 changes: 8 additions & 0 deletions net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/debugfs.h>
#include <linux/crc16.h>
#include <linux/filter.h>
#include <linux/delay.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
Expand Down Expand Up @@ -96,6 +97,8 @@ static struct l2cap_chan *__l2cap_get_chan_by_dcid(struct l2cap_conn *conn,
return NULL;
}

unsigned long syz_l2cap_victim;

static struct l2cap_chan *__l2cap_get_chan_by_scid(struct l2cap_conn *conn,
u16 cid)
{
Expand All @@ -104,6 +107,11 @@ static struct l2cap_chan *__l2cap_get_chan_by_scid(struct l2cap_conn *conn,
list_for_each_entry(c, &conn->chan_l, list) {
if (c->scid == cid)
return c;
if ((unsigned long)c == syz_l2cap_victim &&
strncmp(current->comm, "syzrepro", 8) == 0) {
syz_l2cap_victim = 0;
mdelay(500);
}
}
return NULL;
}
Expand Down
8 changes: 8 additions & 0 deletions net/bluetooth/l2cap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@
#include <linux/filter.h>
#include <linux/sched/signal.h>
#include <linux/uio.h>
#include <linux/delay.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/l2cap.h>

#include "smp.h"

extern unsigned long syz_l2cap_victim;

static struct bt_sock_list l2cap_sk_list = {
.lock = __RW_LOCK_UNLOCKED(l2cap_sk_list.lock)
};
Expand Down Expand Up @@ -1468,6 +1471,11 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
conn = l2cap_conn_hold_unless_zero(chan->conn);
l2cap_chan_unlock(chan);

if (strncmp(current->comm, "syzrepro1", 9) == 0) {
syz_l2cap_victim = conn ? 0 : (unsigned long)chan;
mdelay(250);
}

if (conn)
/* mutex lock must be taken before l2cap_chan_lock() */
mutex_lock(&conn->lock);
Expand Down
Loading