Skip to content

see if we can get kernel src rpm #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
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
9 changes: 7 additions & 2 deletions .github/workflows/build-check_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ on:
jobs:
kernel-build-job:
runs-on:
labels: kernel-build
labels: ubuntu-latest
container:
image: rockylinux:9
env:
ROCKY_ENV: rocky9
ports:
- 80
options: --cpus 8
options: --cpus 4
steps:
- name: Install tools and Libraries
run: |
Expand All @@ -32,3 +32,8 @@ jobs:
cp configs/kernel-x86_64-rhel.config .config
make ARCH=x86_64 CROSS_COMPILE=./scripts/dummy-tools/ olddefconfig
make -j8
- name: Check kabi
run: |
git clone --branch r9 --single-branch https://git.rockylinux.org/staging/rpms/kernel.git kernel-dist-git
git -C kernel-dist-git reset --hard imports/r9/kernel-5.14.0-284.30.1.el9_2
./kernel-dist-git/SOURCES/check-kabi -k ./kernel-dist-git/SOURCES/Module.kabi_x86_64 -s Module.symvers
5 changes: 5 additions & 0 deletions arch/arm64/kvm/vgic/vgic-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,11 @@ static struct vgic_irq *vgic_its_check_cache(struct kvm *kvm, phys_addr_t db,
unsigned long flags;

raw_spin_lock_irqsave(&dist->lpi_list_lock, flags);

irq = __vgic_its_check_cache(dist, db, devid, eventid);
if (irq)
vgic_get_irq_kref(irq);

raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags);

return irq;
Expand Down Expand Up @@ -763,6 +767,7 @@ int vgic_its_inject_cached_translation(struct kvm *kvm, struct kvm_msi *msi)
raw_spin_lock_irqsave(&irq->irq_lock, flags);
irq->pending_latch = true;
vgic_queue_irq_unlock(kvm, irq, flags);
vgic_put_irq(kvm, irq);

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@ static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
/* allow 20secs for mount/unmount for now - revisit */
if (signal_pending(current) ||
(schedule_timeout(20*HZ) == 0)) {
finish_wait(&nn->nfsd_ssc_waitq, &wait);
kfree(work);
return nfserr_eagain;
}
Expand Down
3 changes: 3 additions & 0 deletions include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct perf_guest_info_callbacks {
#include <linux/security.h>
#include <linux/static_call.h>
#include <linux/lockdep.h>
#include <linux/rh_kabi.h>
#include <asm/local.h>

struct perf_callchain_entry {
Expand Down Expand Up @@ -803,6 +804,8 @@ struct perf_event {
void *security;
#endif
struct list_head sb_list;

RH_KABI_EXTEND(unsigned int group_generation)
#endif /* CONFIG_PERF_EVENTS */
};

Expand Down
40 changes: 34 additions & 6 deletions kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,7 @@ static void perf_group_attach(struct perf_event *event)

list_add_tail(&event->sibling_list, &group_leader->sibling_list);
group_leader->nr_siblings++;
group_leader->group_generation++;

perf_event__header_size(group_leader);

Expand Down Expand Up @@ -2150,6 +2151,7 @@ static void perf_group_detach(struct perf_event *event)
if (leader != event) {
list_del_init(&event->sibling_list);
event->group_leader->nr_siblings--;
event->group_leader->group_generation++;
goto out;
}

Expand Down Expand Up @@ -5239,7 +5241,7 @@ static int __perf_read_group_add(struct perf_event *leader,
u64 read_format, u64 *values)
{
struct perf_event_context *ctx = leader->ctx;
struct perf_event *sub;
struct perf_event *sub, *parent;
unsigned long flags;
int n = 1; /* skip @nr */
int ret;
Expand All @@ -5249,6 +5251,33 @@ static int __perf_read_group_add(struct perf_event *leader,
return ret;

raw_spin_lock_irqsave(&ctx->lock, flags);
/*
* Verify the grouping between the parent and child (inherited)
* events is still in tact.
*
* Specifically:
* - leader->ctx->lock pins leader->sibling_list
* - parent->child_mutex pins parent->child_list
* - parent->ctx->mutex pins parent->sibling_list
*
* Because parent->ctx != leader->ctx (and child_list nests inside
* ctx->mutex), group destruction is not atomic between children, also
* see perf_event_release_kernel(). Additionally, parent can grow the
* group.
*
* Therefore it is possible to have parent and child groups in a
* different configuration and summing over such a beast makes no sense
* what so ever.
*
* Reject this.
*/
parent = leader->parent;
if (parent &&
(parent->group_generation != leader->group_generation ||
parent->nr_siblings != leader->nr_siblings)) {
ret = -ECHILD;
goto unlock;
}

/*
* Since we co-schedule groups, {enabled,running} times of siblings
Expand Down Expand Up @@ -5282,8 +5311,9 @@ static int __perf_read_group_add(struct perf_event *leader,
values[n++] = atomic64_read(&sub->lost_samples);
}

unlock:
raw_spin_unlock_irqrestore(&ctx->lock, flags);
return 0;
return ret;
}

static int perf_read_group(struct perf_event *event,
Expand All @@ -5302,10 +5332,6 @@ static int perf_read_group(struct perf_event *event,

values[0] = 1 + leader->nr_siblings;

/*
* By locking the child_mutex of the leader we effectively
* lock the child list of all siblings.. XXX explain how.
*/
mutex_lock(&leader->child_mutex);

ret = __perf_read_group_add(leader, read_format, values);
Expand Down Expand Up @@ -13117,6 +13143,8 @@ static int inherit_group(struct perf_event *parent_event,
!perf_get_aux_event(child_ctr, leader))
return -EINVAL;
}
if (leader)
leader->group_generation = parent_event->group_generation;
return 0;
}

Expand Down
6 changes: 2 additions & 4 deletions net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,11 @@ static void hci_conn_cleanup(struct hci_conn *conn)
hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);
}

hci_conn_del_sysfs(conn);

debugfs_remove_recursive(conn->debugfs);

hci_dev_put(hdev);
hci_conn_del_sysfs(conn);

hci_conn_put(conn);
hci_dev_put(hdev);
}

static void le_scan_cleanup(struct work_struct *work)
Expand Down
23 changes: 12 additions & 11 deletions net/bluetooth/hci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void hci_conn_init_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;

BT_DBG("conn %p", conn);
bt_dev_dbg(hdev, "conn %p", conn);

conn->dev.type = &bt_link;
conn->dev.class = bt_class;
Expand All @@ -46,24 +46,27 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;

BT_DBG("conn %p", conn);
bt_dev_dbg(hdev, "conn %p", conn);

dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);

if (device_add(&conn->dev) < 0) {
if (device_add(&conn->dev) < 0)
bt_dev_err(hdev, "failed to register connection device");
return;
}

hci_dev_hold(hdev);
}

void hci_conn_del_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;

if (!device_is_registered(&conn->dev))
bt_dev_dbg(hdev, "conn %p", conn);

if (!device_is_registered(&conn->dev)) {
/* If device_add() has *not* succeeded, use *only* put_device()
* to drop the reference count.
*/
put_device(&conn->dev);
return;
}

while (1) {
struct device *dev;
Expand All @@ -75,9 +78,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn)
put_device(dev);
}

device_del(&conn->dev);

hci_dev_put(hdev);
device_unregister(&conn->dev);
}

static void bt_host_release(struct device *dev)
Expand Down
22 changes: 10 additions & 12 deletions net/ipv4/af_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,32 +367,30 @@ static int inet_create(struct net *net, struct socket *sock, int protocol,
inet->inet_sport = htons(inet->inet_num);
/* Add to protocol hash chains. */
err = sk->sk_prot->hash(sk);
if (err) {
sk_common_release(sk);
goto out;
}
if (err)
goto out_sk_release;
}

if (sk->sk_prot->init) {
err = sk->sk_prot->init(sk);
if (err) {
sk_common_release(sk);
goto out;
}
if (err)
goto out_sk_release;
}

if (!kern) {
err = BPF_CGROUP_RUN_PROG_INET_SOCK(sk);
if (err) {
sk_common_release(sk);
goto out;
}
if (err)
goto out_sk_release;
}
out:
return err;
out_rcu_unlock:
rcu_read_unlock();
goto out;
out_sk_release:
sk_common_release(sk);
sock->sk = NULL;
goto out;
}


Expand Down
29 changes: 29 additions & 0 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,30 @@ static int nft_objname_hash_cmp(struct rhashtable_compare_arg *arg,
return strcmp(obj->key.name, k->name);
}

static bool nft_supported_family(u8 family)
{
return false
#ifdef CONFIG_NF_TABLES_INET
|| family == NFPROTO_INET
#endif
#ifdef CONFIG_NF_TABLES_IPV4
|| family == NFPROTO_IPV4
#endif
#ifdef CONFIG_NF_TABLES_ARP
|| family == NFPROTO_ARP
#endif
#ifdef CONFIG_NF_TABLES_NETDEV
|| family == NFPROTO_NETDEV
#endif
#if IS_ENABLED(CONFIG_NF_TABLES_BRIDGE)
|| family == NFPROTO_BRIDGE
#endif
#ifdef CONFIG_NF_TABLES_IPV6
|| family == NFPROTO_IPV6
#endif
;
}

static int nf_tables_newtable(struct sk_buff *skb, const struct nfnl_info *info,
const struct nlattr * const nla[])
{
Expand All @@ -1178,6 +1202,9 @@ static int nf_tables_newtable(struct sk_buff *skb, const struct nfnl_info *info,
u32 flags = 0;
int err;

if (!nft_supported_family(family))
return -EOPNOTSUPP;

lockdep_assert_held(&nft_net->commit_mutex);
attr = nla[NFTA_TABLE_NAME];
table = nft_table_lookup(net, attr, family, genmask,
Expand Down Expand Up @@ -3729,6 +3756,8 @@ static int nf_tables_delrule(struct sk_buff *skb, const struct nfnl_info *info,
list_for_each_entry(chain, &table->chains, list) {
if (!nft_is_active_next(net, chain))
continue;
if (nft_chain_is_bound(chain))
continue;

ctx.chain = chain;
err = nft_delrule_by_chain(&ctx);
Expand Down
5 changes: 5 additions & 0 deletions net/tipc/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,12 +817,16 @@ static int tipc_aead_encrypt(struct tipc_aead *aead, struct sk_buff *skb,
goto exit;
}

/* Get net to avoid freed tipc_crypto when delete namespace */
get_net(aead->crypto->net);

/* Now, do encrypt */
rc = crypto_aead_encrypt(req);
if (rc == -EINPROGRESS || rc == -EBUSY)
return rc;

tipc_bearer_put(b);
put_net(aead->crypto->net);

exit:
kfree(ctx);
Expand Down Expand Up @@ -860,6 +864,7 @@ static void tipc_aead_encrypt_done(struct crypto_async_request *base, int err)
kfree(tx_ctx);
tipc_bearer_put(b);
tipc_aead_put(aead);
put_net(net);
}

/**
Expand Down
Loading