Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 0118fb8

Browse files
committed
Merge branch 'android12-5.10' into branch 'android12-5.10-lts'
Sync up with android12-5.10 for the following commits: af699fd ANDROID: vendor_hook: skip trace_android_vh_page_trylock_set when ignore_references is true 5aec776 BACKPORT: ANDROID: dma-buf: Move sysfs work out of DMA-BUF export path d61d7eb UPSTREAM: wifi: mac80211: fix MBSSID parsing use-after-free 173913b UPSTREAM: wifi: mac80211: don't parse mbssid in assoc response 9ed9ab8 UPSTREAM: mac80211: mlme: find auth challenge directly d6e68e3 UPSTREAM: wifi: cfg80211: update hidden BSSes to avoid WARN_ON 3ea906b UPSTREAM: wifi: mac80211: fix crash in beacon protection for P2P-device 241426b UPSTREAM: wifi: mac80211_hwsim: avoid mac80211 warning on bad rate 50e2714 UPSTREAM: wifi: cfg80211: avoid nontransmitted BSS list corruption 05a0122 UPSTREAM: wifi: cfg80211: fix BSS refcounting bugs 2e8c292 UPSTREAM: wifi: cfg80211: ensure length byte is present before access 5f6b143 UPSTREAM: wifi: cfg80211/mac80211: reject bad MBSSID elements 6aeb3cc UPSTREAM: wifi: cfg80211: fix u8 overflow in cfg80211_update_notlisted_nontrans() 13a84bf ANDROID: GKI: Update symbols to symbol list 09f4246 ANDROID: sched: add restricted hooks to replace the former hooks 376aaf8 ANDROID: GKI: Add symbol snd_pcm_stop_xrun 8512c35 ANDROID: ABI: update allowed list for galaxy 439fc06 ANDROID: GKI: Update symbols to symbol list beaaa7b UPSTREAM: dma-buf: ensure unique directory name for dmabuf stats d71115b UPSTREAM: dma-buf: call dma_buf_stats_setup after dmabuf is in valid list f9a66cb ANDROID: GKI: Update symbol list for mtk AIoT projects a3835ce UPSTREAM: psi: Fix psi state corruption when schedule() races with cgroup move 3b39e91 BACKPORT: HID: steam: Prevent NULL pointer dereference in steam_{recv,send}_report c35cda5 BACKPORT: mm: don't be stuck to rmap lock on reclaim path 9613bc5 Revert "firmware_loader: use kernel credentials when reading firmware" 95f23ce UPSTREAM: crypto: jitter - add oversampling of noise source b046e2d ANDROID: Fix kenelci build-break for !CONFIG_PERF_EVENTS 24220df FROMGIT: f2fs: support recording stop_checkpoint reason into super_block f18e68a UPSTREAM: wifi: mac80211_hwsim: use 32-bit skb cookie 08cb67e UPSTREAM: wifi: mac80211_hwsim: add back erroneously removed cast 9b080ed UPSTREAM: wifi: mac80211_hwsim: fix race condition in pending packet Update the .xml file with the newly tracked symbols: Leaf changes summary: 30 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 24 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 6 Added variables 24 Added functions: [A] 'function void __rtnl_link_unregister(rtnl_link_ops*)' [A] 'function int __traceiter_android_rvh_alloc_si(void*, swap_info_struct**, bool*)' [A] 'function int __traceiter_android_rvh_alloc_swap_slot_cache(void*, swap_slots_cache*, int*, bool*)' [A] 'function int __traceiter_android_rvh_drain_slots_cache_cpu(void*, swap_slots_cache*, unsigned int, bool, bool*)' [A] 'function int __traceiter_android_rvh_free_swap_slot(void*, swp_entry_t, swap_slots_cache*, bool*)' [A] 'function int __traceiter_android_rvh_get_swap_page(void*, page*, swp_entry_t*, swap_slots_cache*, bool*)' [A] 'function int __traceiter_android_rvh_handle_pte_fault_end(void*, vm_fault*, unsigned long int)' [A] 'function net_device* dev_get_by_index_rcu(net*, int)' [A] 'function phy_device* fixed_phy_register(unsigned int, fixed_phy_status*, device_node*)' [A] 'function void fixed_phy_unregister(phy_device*)' [A] 'function irq_domain* irq_domain_add_simple(device_node*, unsigned int, unsigned int, const irq_domain_ops*, void*)' [A] 'function int nf_register_net_hook(net*, const nf_hook_ops*)' [A] 'function void nf_unregister_net_hook(net*, const nf_hook_ops*)' [A] 'function int phy_ethtool_set_wol(phy_device*, ethtool_wolinfo*)' [A] 'function int phy_register_fixup_for_uid(u32, u32, int (phy_device*)*)' [A] 'function int phy_save_page(phy_device*)' [A] 'function int phy_unregister_fixup_for_uid(u32, u32)' [A] 'function int snd_pcm_stop_xrun(snd_pcm_substream*)' [A] 'function void tty_encode_baud_rate(tty_struct*, speed_t, speed_t)' [A] 'function int usb_autopm_get_interface_async(usb_interface*)' [A] 'function void usb_autopm_put_interface_async(usb_interface*)' [A] 'function int usb_clear_halt(usb_device*, int)' [A] 'function int usb_interrupt_msg(usb_device*, unsigned int, void*, int, int*, int)' [A] 'function int usb_unlink_urb(urb*)' 6 Added variables: [A] 'tracepoint __tracepoint_android_rvh_alloc_si' [A] 'tracepoint __tracepoint_android_rvh_alloc_swap_slot_cache' [A] 'tracepoint __tracepoint_android_rvh_drain_slots_cache_cpu' [A] 'tracepoint __tracepoint_android_rvh_free_swap_slot' [A] 'tracepoint __tracepoint_android_rvh_get_swap_page' [A] 'tracepoint __tracepoint_android_rvh_handle_pte_fault_end' Signed-off-by: Greg Kroah-Hartman <[email protected]> Change-Id: I225d5838de38d886151cf619654412ee8c5428b2
2 parents 69a9a62 + af699fd commit 0118fb8

34 files changed

+1180
-843
lines changed

android/abi_gki_aarch64.xml

+856-758
Large diffs are not rendered by default.

android/abi_gki_aarch64_galaxy

+11
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,8 @@
19011901
find_vpid
19021902
finish_wait
19031903
firmware_request_nowarn
1904+
fixed_phy_register
1905+
fixed_phy_unregister
19041906
fixed_size_llseek
19051907
flow_keys_basic_dissector
19061908
flush_dcache_page
@@ -2327,6 +2329,7 @@
23272329
irq_create_mapping_affinity
23282330
irq_create_of_mapping
23292331
irq_dispose_mapping
2332+
irq_domain_add_simple
23302333
irq_domain_alloc_irqs_parent
23312334
irq_domain_create_hierarchy
23322335
irq_domain_free_irqs_common
@@ -3023,6 +3026,7 @@
30233026
phy_ethtool_get_link_ksettings
30243027
phy_ethtool_nway_reset
30253028
phy_ethtool_set_link_ksettings
3029+
phy_ethtool_set_wol
30263030
phy_exit
30273031
phy_find_first
30283032
phy_get_pause
@@ -3034,9 +3038,12 @@
30343038
phy_power_off
30353039
phy_power_on
30363040
phy_print_status
3041+
phy_register_fixup_for_uid
3042+
phy_save_page
30373043
phy_set_mode_ext
30383044
phy_start
30393045
phy_stop
3046+
phy_unregister_fixup_for_uid
30403047
pick_highest_pushable_task
30413048
pid_nr_ns
30423049
pid_task
@@ -4066,6 +4073,7 @@
40664073
ttm_tt_populate
40674074
ttm_tt_set_placement_caching
40684075
ttm_unmap_and_unpopulate_pages
4076+
tty_encode_baud_rate
40694077
tty_flip_buffer_push
40704078
tty_insert_flip_string_fixed_flag
40714079
tty_kref_put
@@ -4214,8 +4222,10 @@
42144222
usb_asmedia_modifyflowcontrol
42154223
usb_assign_descriptors
42164224
usb_autopm_get_interface
4225+
usb_autopm_get_interface_async
42174226
usb_autopm_get_interface_no_resume
42184227
usb_autopm_put_interface
4228+
usb_autopm_put_interface_async
42194229
usb_bulk_msg
42204230
usb_calc_bus_time
42214231
usb_choose_configuration
@@ -4293,6 +4303,7 @@
42934303
usb_ifnum_to_if
42944304
usb_initialize_gadget
42954305
usb_interface_id
4306+
usb_interrupt_msg
42964307
usb_kill_urb
42974308
usb_match_id
42984309
usb_match_one_id

android/abi_gki_aarch64_mtk

+2
Original file line numberDiff line numberDiff line change
@@ -3216,6 +3216,7 @@
32163216
update_devfreq
32173217
usb_add_phy_dev
32183218
usb_assign_descriptors
3219+
usb_clear_halt
32193220
usb_copy_descriptors
32203221
usb_ep_alloc_request
32213222
usb_ep_autoconfig
@@ -3239,6 +3240,7 @@
32393240
usb_phy_set_charger_current
32403241
usb_remove_phy
32413242
usb_role_switch_set_role
3243+
usb_unlink_urb
32423244
v4l2_async_notifier_add_subdev
32433245
v4l2_async_notifier_cleanup
32443246
v4l2_async_subdev_notifier_register

android/abi_gki_aarch64_oplus

+4
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@
408408
dev_fwnode
409409
__dev_get_by_index
410410
dev_get_by_index
411+
dev_get_by_index_rcu
411412
dev_get_by_name
412413
dev_get_regmap
413414
dev_get_stats
@@ -1658,7 +1659,9 @@
16581659
net_ratelimit
16591660
nf_ct_attach
16601661
nf_ct_delete
1662+
nf_register_net_hook
16611663
nf_register_net_hooks
1664+
nf_unregister_net_hook
16621665
nf_unregister_net_hooks
16631666
nla_find
16641667
nla_memcpy
@@ -2286,6 +2289,7 @@
22862289
rtc_update_irq
22872290
rtc_valid_tm
22882291
rtnl_is_locked
2292+
__rtnl_link_unregister
22892293
rtnl_lock
22902294
rtnl_unlock
22912295
runqueues

android/abi_gki_aarch64_rockchip

+1
Original file line numberDiff line numberDiff line change
@@ -2626,6 +2626,7 @@
26262626
snd_pcm_fill_iec958_consumer
26272627
snd_pcm_fill_iec958_consumer_hw_params
26282628
snd_pcm_hw_constraint_eld
2629+
snd_pcm_stop_xrun
26292630

26302631
# required by snd-soc-rk817.ko
26312632
snd_soc_component_exit_regmap

android/abi_gki_aarch64_transsion

+12
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
nr_swap_pages
1111
plist_requeue
1212
plist_del
13+
__traceiter_android_rvh_handle_pte_fault_end
1314
__traceiter_android_vh_handle_pte_fault_end
1415
__traceiter_android_vh_cow_user_page
1516
__traceiter_android_vh_swapin_add_anon_rmap
@@ -20,9 +21,13 @@
2021
__traceiter_android_vh_count_pswpout
2122
__traceiter_android_vh_count_swpout_vm_event
2223
__traceiter_android_vh_swap_slot_cache_active
24+
__traceiter_android_rvh_drain_slots_cache_cpu
2325
__traceiter_android_vh_drain_slots_cache_cpu
26+
__traceiter_android_rvh_alloc_swap_slot_cache
2427
__traceiter_android_vh_alloc_swap_slot_cache
28+
__traceiter_android_rvh_free_swap_slot
2529
__traceiter_android_vh_free_swap_slot
30+
__traceiter_android_rvh_get_swap_page
2631
__traceiter_android_vh_get_swap_page
2732
__traceiter_android_vh_page_isolated_for_reclaim
2833
__traceiter_android_vh_inactive_is_low
@@ -31,10 +36,12 @@
3136
__traceiter_android_vh_unuse_swap_page
3237
__traceiter_android_vh_init_swap_info_struct
3338
__traceiter_android_vh_si_swapinfo
39+
__traceiter_android_rvh_alloc_si
3440
__traceiter_android_vh_alloc_si
3541
__traceiter_android_vh_free_pages
3642
__traceiter_android_vh_set_shmem_page_flag
3743
__traceiter_android_vh_ra_tuning_max_page
44+
__tracepoint_android_rvh_handle_pte_fault_end
3845
__tracepoint_android_vh_handle_pte_fault_end
3946
__tracepoint_android_vh_cow_user_page
4047
__tracepoint_android_vh_swapin_add_anon_rmap
@@ -45,9 +52,13 @@
4552
__tracepoint_android_vh_count_pswpout
4653
__tracepoint_android_vh_count_swpout_vm_event
4754
__tracepoint_android_vh_swap_slot_cache_active
55+
__tracepoint_android_rvh_drain_slots_cache_cpu
4856
__tracepoint_android_vh_drain_slots_cache_cpu
57+
__tracepoint_android_rvh_alloc_swap_slot_cache
4958
__tracepoint_android_vh_alloc_swap_slot_cache
59+
__tracepoint_android_rvh_free_swap_slot
5060
__tracepoint_android_vh_free_swap_slot
61+
__tracepoint_android_rvh_get_swap_page
5162
__tracepoint_android_vh_get_swap_page
5263
__tracepoint_android_vh_page_isolated_for_reclaim
5364
__tracepoint_android_vh_inactive_is_low
@@ -56,6 +67,7 @@
5667
__tracepoint_android_vh_unuse_swap_page
5768
__tracepoint_android_vh_init_swap_info_struct
5869
__tracepoint_android_vh_si_swapinfo
70+
__tracepoint_android_rvh_alloc_si
5971
__tracepoint_android_vh_alloc_si
6072
__tracepoint_android_vh_free_pages
6173
__tracepoint_android_vh_set_shmem_page_flag

crypto/jitterentropy.c

+21-2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ struct rand_data {
117117
#define JENT_EHEALTH 9 /* Health test failed during initialization */
118118
#define JENT_ERCT 10 /* RCT failed during initialization */
119119

120+
/*
121+
* The output n bits can receive more than n bits of min entropy, of course,
122+
* but the fixed output of the conditioning function can only asymptotically
123+
* approach the output size bits of min entropy, not attain that bound. Random
124+
* maps will tend to have output collisions, which reduces the creditable
125+
* output entropy (that is what SP 800-90B Section 3.1.5.1.2 attempts to bound).
126+
*
127+
* The value "64" is justified in Appendix A.4 of the current 90C draft,
128+
* and aligns with NIST's in "epsilon" definition in this document, which is
129+
* that a string can be considered "full entropy" if you can bound the min
130+
* entropy in each bit of output to at least 1-epsilon, where epsilon is
131+
* required to be <= 2^(-32).
132+
*/
133+
#define JENT_ENTROPY_SAFETY_FACTOR 64
134+
135+
#include <linux/fips.h>
120136
#include "jitterentropy.h"
121137

122138
/***************************************************************************
@@ -546,7 +562,10 @@ static int jent_measure_jitter(struct rand_data *ec)
546562
*/
547563
static void jent_gen_entropy(struct rand_data *ec)
548564
{
549-
unsigned int k = 0;
565+
unsigned int k = 0, safety_factor = 0;
566+
567+
if (fips_enabled)
568+
safety_factor = JENT_ENTROPY_SAFETY_FACTOR;
550569

551570
/* priming of the ->prev_time value */
552571
jent_measure_jitter(ec);
@@ -560,7 +579,7 @@ static void jent_gen_entropy(struct rand_data *ec)
560579
* We multiply the loop value with ->osr to obtain the
561580
* oversampling rate requested by the caller
562581
*/
563-
if (++k >= (DATA_SIZE_BITS * ec->osr))
582+
if (++k >= ((DATA_SIZE_BITS + safety_factor) * ec->osr))
564583
break;
565584
}
566585
}

drivers/android/vendor_hooks.c

+6
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_read_done);
431431
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_tlb_conf);
432432
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node_memcgs);
433433
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ra_tuning_max_page);
434+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_handle_pte_fault_end);
434435
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_pte_fault_end);
435436
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cow_user_page);
436437
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_swapin_add_anon_rmap);
@@ -441,9 +442,13 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_pswpin);
441442
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_pswpout);
442443
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_swpout_vm_event);
443444
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_swap_slot_cache_active);
445+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_drain_slots_cache_cpu);
444446
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_drain_slots_cache_cpu);
447+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_alloc_swap_slot_cache);
445448
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_swap_slot_cache);
449+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_free_swap_slot);
446450
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_swap_slot);
451+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_get_swap_page);
447452
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_swap_page);
448453
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_madvise_cold_or_pageout);
449454
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_isolated_for_reclaim);
@@ -453,6 +458,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages);
453458
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page);
454459
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct);
455460
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo);
461+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_alloc_si);
456462
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si);
457463
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_pages);
458464
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag);

drivers/base/firmware_loader/main.c

-17
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,6 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
793793
size_t offset, u32 opt_flags)
794794
{
795795
struct firmware *fw = NULL;
796-
struct cred *kern_cred = NULL;
797-
const struct cred *old_cred;
798796
bool nondirect = false;
799797
int ret;
800798

@@ -811,18 +809,6 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
811809
if (ret <= 0) /* error or already assigned */
812810
goto out;
813811

814-
/*
815-
* We are about to try to access the firmware file. Because we may have been
816-
* called by a driver when serving an unrelated request from userland, we use
817-
* the kernel credentials to read the file.
818-
*/
819-
kern_cred = prepare_kernel_cred(NULL);
820-
if (!kern_cred) {
821-
ret = -ENOMEM;
822-
goto out;
823-
}
824-
old_cred = override_creds(kern_cred);
825-
826812
ret = fw_get_filesystem_firmware(device, fw->priv, "", NULL);
827813

828814
/* Only full reads can support decompression, platform, and sysfs. */
@@ -848,9 +834,6 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
848834
} else
849835
ret = assign_fw(fw, device);
850836

851-
revert_creds(old_cred);
852-
put_cred(kern_cred);
853-
854837
out:
855838
if (ret < 0) {
856839
fw_abort_batch_reqs(fw);

drivers/dma-buf/dma-buf-sysfs-stats.c

+52-14
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/printk.h>
1212
#include <linux/slab.h>
1313
#include <linux/sysfs.h>
14+
#include <linux/workqueue.h>
1415

1516
#include "dma-buf-sysfs-stats.h"
1617

@@ -135,10 +136,51 @@ void dma_buf_uninit_sysfs_statistics(void)
135136
kset_unregister(dma_buf_stats_kset);
136137
}
137138

139+
static void sysfs_add_workfn(struct work_struct *work)
140+
{
141+
/* The ABI would have to change for this to be false, but let's be paranoid. */
142+
_Static_assert(sizeof(struct kobject) >= sizeof(struct work_struct),
143+
"kobject is smaller than work_struct");
144+
145+
struct dma_buf_sysfs_entry *sysfs_entry =
146+
container_of((struct kobject *)work, struct dma_buf_sysfs_entry, kobj);
147+
struct dma_buf *dmabuf = sysfs_entry->dmabuf;
148+
149+
/*
150+
* A dmabuf is ref-counted via its file member. If this handler holds the only
151+
* reference to the dmabuf, there is no need for sysfs kobject creation. This is an
152+
* optimization and a race; when the reference count drops to 1 immediately after
153+
* this check it is not harmful as the sysfs entry will still get cleaned up in
154+
* dma_buf_stats_teardown, which won't get called until the final dmabuf reference
155+
* is released, and that can't happen until the end of this function.
156+
*/
157+
if (file_count(dmabuf->file) > 1) {
158+
/*
159+
* kobject_init_and_add expects kobject to be zero-filled, but we have populated it
160+
* to trigger this work function.
161+
*/
162+
memset(&dmabuf->sysfs_entry->kobj, 0, sizeof(dmabuf->sysfs_entry->kobj));
163+
dmabuf->sysfs_entry->kobj.kset = dma_buf_per_buffer_stats_kset;
164+
if (kobject_init_and_add(&dmabuf->sysfs_entry->kobj, &dma_buf_ktype, NULL,
165+
"%lu", file_inode(dmabuf->file)->i_ino)) {
166+
kobject_put(&dmabuf->sysfs_entry->kobj);
167+
dmabuf->sysfs_entry = NULL;
168+
}
169+
} else {
170+
/*
171+
* Free the sysfs_entry and reset the pointer so dma_buf_stats_teardown doesn't
172+
* attempt to operate on it.
173+
*/
174+
kfree(dmabuf->sysfs_entry);
175+
dmabuf->sysfs_entry = NULL;
176+
}
177+
dma_buf_put(dmabuf);
178+
}
179+
138180
int dma_buf_stats_setup(struct dma_buf *dmabuf)
139181
{
140182
struct dma_buf_sysfs_entry *sysfs_entry;
141-
int ret;
183+
struct work_struct *work;
142184

143185
if (!dmabuf || !dmabuf->file)
144186
return -EINVAL;
@@ -148,25 +190,21 @@ int dma_buf_stats_setup(struct dma_buf *dmabuf)
148190
return -EINVAL;
149191
}
150192

151-
sysfs_entry = kzalloc(sizeof(struct dma_buf_sysfs_entry), GFP_KERNEL);
193+
sysfs_entry = kmalloc(sizeof(struct dma_buf_sysfs_entry), GFP_KERNEL);
152194
if (!sysfs_entry)
153195
return -ENOMEM;
154196

155-
sysfs_entry->kobj.kset = dma_buf_per_buffer_stats_kset;
156197
sysfs_entry->dmabuf = dmabuf;
157-
158198
dmabuf->sysfs_entry = sysfs_entry;
159199

160-
/* create the directory for buffer stats */
161-
ret = kobject_init_and_add(&sysfs_entry->kobj, &dma_buf_ktype, NULL,
162-
"%lu", file_inode(dmabuf->file)->i_ino);
163-
if (ret)
164-
goto err_sysfs_dmabuf;
200+
/*
201+
* The use of kobj as a work_struct is an ugly hack
202+
* to avoid an ABI break in this frozen kernel.
203+
*/
204+
work = (struct work_struct *)&dmabuf->sysfs_entry->kobj;
205+
INIT_WORK(work, sysfs_add_workfn);
206+
get_dma_buf(dmabuf); /* This reference will be dropped in sysfs_add_workfn. */
207+
schedule_work(work);
165208

166209
return 0;
167-
168-
err_sysfs_dmabuf:
169-
kobject_put(&sysfs_entry->kobj);
170-
dmabuf->sysfs_entry = NULL;
171-
return ret;
172210
}

0 commit comments

Comments
 (0)