diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig.debug | 3 | ||||
| -rw-r--r-- | lib/kobject_uevent.c | 49 | ||||
| -rw-r--r-- | lib/rhashtable.c | 9 |
3 files changed, 48 insertions, 13 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index b19c491cbc4e..2689b7c50c52 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
| @@ -219,7 +219,8 @@ config FRAME_WARN | |||
| 219 | range 0 8192 | 219 | range 0 8192 |
| 220 | default 0 if KASAN | 220 | default 0 if KASAN |
| 221 | default 2048 if GCC_PLUGIN_LATENT_ENTROPY | 221 | default 2048 if GCC_PLUGIN_LATENT_ENTROPY |
| 222 | default 1024 if !64BIT | 222 | default 1280 if (!64BIT && PARISC) |
| 223 | default 1024 if (!64BIT && !PARISC) | ||
| 223 | default 2048 if 64BIT | 224 | default 2048 if 64BIT |
| 224 | help | 225 | help |
| 225 | Tell gcc to warn at build time for stack frames larger than this. | 226 | Tell gcc to warn at build time for stack frames larger than this. |
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index e590523ea476..f237a09a5862 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c | |||
| @@ -294,6 +294,26 @@ static void cleanup_uevent_env(struct subprocess_info *info) | |||
| 294 | } | 294 | } |
| 295 | #endif | 295 | #endif |
| 296 | 296 | ||
| 297 | static void zap_modalias_env(struct kobj_uevent_env *env) | ||
| 298 | { | ||
| 299 | static const char modalias_prefix[] = "MODALIAS="; | ||
| 300 | int i; | ||
| 301 | |||
| 302 | for (i = 0; i < env->envp_idx;) { | ||
| 303 | if (strncmp(env->envp[i], modalias_prefix, | ||
| 304 | sizeof(modalias_prefix) - 1)) { | ||
| 305 | i++; | ||
| 306 | continue; | ||
| 307 | } | ||
| 308 | |||
| 309 | if (i != env->envp_idx - 1) | ||
| 310 | memmove(&env->envp[i], &env->envp[i + 1], | ||
| 311 | sizeof(env->envp[i]) * env->envp_idx - 1); | ||
| 312 | |||
| 313 | env->envp_idx--; | ||
| 314 | } | ||
| 315 | } | ||
| 316 | |||
| 297 | /** | 317 | /** |
| 298 | * kobject_uevent_env - send an uevent with environmental data | 318 | * kobject_uevent_env - send an uevent with environmental data |
| 299 | * | 319 | * |
| @@ -409,16 +429,29 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | |||
| 409 | } | 429 | } |
| 410 | } | 430 | } |
| 411 | 431 | ||
| 412 | /* | 432 | switch (action) { |
| 413 | * Mark "add" and "remove" events in the object to ensure proper | 433 | case KOBJ_ADD: |
| 414 | * events to userspace during automatic cleanup. If the object did | 434 | /* |
| 415 | * send an "add" event, "remove" will automatically generated by | 435 | * Mark "add" event so we can make sure we deliver "remove" |
| 416 | * the core, if not already done by the caller. | 436 | * event to userspace during automatic cleanup. If |
| 417 | */ | 437 | * the object did send an "add" event, "remove" will |
| 418 | if (action == KOBJ_ADD) | 438 | * automatically generated by the core, if not already done |
| 439 | * by the caller. | ||
| 440 | */ | ||
| 419 | kobj->state_add_uevent_sent = 1; | 441 | kobj->state_add_uevent_sent = 1; |
| 420 | else if (action == KOBJ_REMOVE) | 442 | break; |
| 443 | |||
| 444 | case KOBJ_REMOVE: | ||
| 421 | kobj->state_remove_uevent_sent = 1; | 445 | kobj->state_remove_uevent_sent = 1; |
| 446 | break; | ||
| 447 | |||
| 448 | case KOBJ_UNBIND: | ||
| 449 | zap_modalias_env(env); | ||
| 450 | break; | ||
| 451 | |||
| 452 | default: | ||
| 453 | break; | ||
| 454 | } | ||
| 422 | 455 | ||
| 423 | mutex_lock(&uevent_sock_mutex); | 456 | mutex_lock(&uevent_sock_mutex); |
| 424 | /* we will send an event, so request a new sequence number */ | 457 | /* we will send an event, so request a new sequence number */ |
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 707ca5d677c6..ddd7dde87c3c 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
| @@ -735,9 +735,9 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_exit); | |||
| 735 | * rhashtable_walk_start - Start a hash table walk | 735 | * rhashtable_walk_start - Start a hash table walk |
| 736 | * @iter: Hash table iterator | 736 | * @iter: Hash table iterator |
| 737 | * | 737 | * |
| 738 | * Start a hash table walk. Note that we take the RCU lock in all | 738 | * Start a hash table walk at the current iterator position. Note that we take |
| 739 | * cases including when we return an error. So you must always call | 739 | * the RCU lock in all cases including when we return an error. So you must |
| 740 | * rhashtable_walk_stop to clean up. | 740 | * always call rhashtable_walk_stop to clean up. |
| 741 | * | 741 | * |
| 742 | * Returns zero if successful. | 742 | * Returns zero if successful. |
| 743 | * | 743 | * |
| @@ -846,7 +846,8 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_next); | |||
| 846 | * rhashtable_walk_stop - Finish a hash table walk | 846 | * rhashtable_walk_stop - Finish a hash table walk |
| 847 | * @iter: Hash table iterator | 847 | * @iter: Hash table iterator |
| 848 | * | 848 | * |
| 849 | * Finish a hash table walk. | 849 | * Finish a hash table walk. Does not reset the iterator to the start of the |
| 850 | * hash table. | ||
| 850 | */ | 851 | */ |
| 851 | void rhashtable_walk_stop(struct rhashtable_iter *iter) | 852 | void rhashtable_walk_stop(struct rhashtable_iter *iter) |
| 852 | __releases(RCU) | 853 | __releases(RCU) |
