···421421 * @work: the worker that implements software debouncing422422 * @sw_debounced: flag indicating if the software debouncer is active423423 * @level: the current debounced physical level of the line424424+ * @hdesc: the Hardware Timestamp Engine (HTE) descriptor425425+ * @raw_level: the line level at the time of event426426+ * @total_discard_seq: the running counter of the discarded events427427+ * @last_seqno: the last sequence number before debounce period expires424428 */425429struct line {426430 struct gpio_desc *desc;
···3434#define WATCH_QUEUE_NOTE_SIZE 1283535#define WATCH_QUEUE_NOTES_PER_PAGE (PAGE_SIZE / WATCH_QUEUE_NOTE_SIZE)36363737+/*3838+ * This must be called under the RCU read-lock, which makes3939+ * sure that the wqueue still exists. It can then take the lock,4040+ * and check that the wqueue hasn't been destroyed, which in4141+ * turn makes sure that the notification pipe still exists.4242+ */4343+static inline bool lock_wqueue(struct watch_queue *wqueue)4444+{4545+ spin_lock_bh(&wqueue->lock);4646+ if (unlikely(wqueue->defunct)) {4747+ spin_unlock_bh(&wqueue->lock);4848+ return false;4949+ }5050+ return true;5151+}5252+5353+static inline void unlock_wqueue(struct watch_queue *wqueue)5454+{5555+ spin_unlock_bh(&wqueue->lock);5656+}5757+3758static void watch_queue_pipe_buf_release(struct pipe_inode_info *pipe,3859 struct pipe_buffer *buf)3960{···90699170/*9271 * Post a notification to a watch queue.7272+ *7373+ * Must be called with the RCU lock for reading, and the7474+ * watch_queue lock held, which guarantees that the pipe7575+ * hasn't been released.9376 */9477static bool post_one_notification(struct watch_queue *wqueue,9578 struct watch_notification *n)···10984 return false;1108511186 spin_lock_irq(&pipe->rd_wait.lock);112112-113113- if (wqueue->defunct)114114- goto out;1158711688 mask = pipe->ring_size - 1;11789 head = pipe->head;···225203 if (security_post_notification(watch->cred, cred, n) < 0)226204 continue;227205228228- post_one_notification(wqueue, n);206206+ if (lock_wqueue(wqueue)) {207207+ post_one_notification(wqueue, n);208208+ unlock_wqueue(wqueue);;209209+ }229210 }230211231212 rcu_read_unlock();···487462 return -EAGAIN;488463 }489464490490- spin_lock_bh(&wqueue->lock);491491- kref_get(&wqueue->usage);492492- kref_get(&watch->usage);493493- hlist_add_head(&watch->queue_node, &wqueue->watches);494494- spin_unlock_bh(&wqueue->lock);465465+ if (lock_wqueue(wqueue)) {466466+ kref_get(&wqueue->usage);467467+ kref_get(&watch->usage);468468+ hlist_add_head(&watch->queue_node, &wqueue->watches);469469+ unlock_wqueue(wqueue);470470+ }495471496472 hlist_add_head(&watch->list_node, &wlist->watchers);497473 return 0;···546520547521 wqueue = rcu_dereference(watch->queue);548522549549- /* We don't need the watch list lock for the next bit as RCU is550550- * protecting *wqueue from deallocation.551551- */552552- if (wqueue) {523523+ if (lock_wqueue(wqueue)) {553524 post_one_notification(wqueue, &n.watch);554554-555555- spin_lock_bh(&wqueue->lock);556525557526 if (!hlist_unhashed(&watch->queue_node)) {558527 hlist_del_init_rcu(&watch->queue_node);559528 put_watch(watch);560529 }561530562562- spin_unlock_bh(&wqueue->lock);531531+ unlock_wqueue(wqueue);563532 }564533565534 if (wlist->release_watch) {
+4
security/integrity/ima/ima_policy.c
···22472247 if (id >= READING_MAX_ID)22482248 return false;2249224922502250+ if (id == READING_KEXEC_IMAGE && !(ima_appraise & IMA_APPRAISE_ENFORCE)22512251+ && security_locked_down(LOCKDOWN_KEXEC))22522252+ return false;22532253+22502254 func = read_idmap[id] ?: FILE_CHECK;2251225522522256 rcu_read_lock();