@@ -111,11 +111,12 @@ static void tty_audit_buf_push(struct tty_audit_buf *buf)
111111void tty_audit_exit (void )
112112{
113113 struct tty_audit_buf * buf ;
114+ unsigned long flags ;
114115
115- spin_lock_irq (& current -> sighand -> siglock );
116+ spin_lock_irqsave (& current -> sighand -> siglock , flags );
116117 buf = current -> signal -> tty_audit_buf ;
117118 current -> signal -> tty_audit_buf = NULL ;
118- spin_unlock_irq (& current -> sighand -> siglock );
119+ spin_unlock_irqrestore (& current -> sighand -> siglock , flags );
119120 if (!buf )
120121 return ;
121122
@@ -133,9 +134,11 @@ void tty_audit_exit(void)
133134 */
134135void tty_audit_fork (struct signal_struct * sig )
135136{
136- spin_lock_irq (& current -> sighand -> siglock );
137+ unsigned long flags ;
138+
139+ spin_lock_irqsave (& current -> sighand -> siglock , flags );
137140 sig -> audit_tty = current -> signal -> audit_tty ;
138- spin_unlock_irq (& current -> sighand -> siglock );
141+ spin_unlock_irqrestore (& current -> sighand -> siglock , flags );
139142}
140143
141144/**
@@ -145,13 +148,14 @@ void tty_audit_tiocsti(struct tty_struct *tty, char ch)
145148{
146149 struct tty_audit_buf * buf ;
147150 int major , minor , should_audit ;
151+ unsigned long flags ;
148152
149- spin_lock_irq (& current -> sighand -> siglock );
153+ spin_lock_irqsave (& current -> sighand -> siglock , flags );
150154 should_audit = current -> signal -> audit_tty ;
151155 buf = current -> signal -> tty_audit_buf ;
152156 if (buf )
153157 atomic_inc (& buf -> count );
154- spin_unlock_irq (& current -> sighand -> siglock );
158+ spin_unlock_irqrestore (& current -> sighand -> siglock , flags );
155159
156160 major = tty -> driver -> major ;
157161 minor = tty -> driver -> minor_start + tty -> index ;
@@ -221,18 +225,19 @@ static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty,
221225 unsigned icanon )
222226{
223227 struct tty_audit_buf * buf , * buf2 ;
228+ unsigned long flags ;
224229
225230 buf = NULL ;
226231 buf2 = NULL ;
227- spin_lock_irq (& current -> sighand -> siglock );
232+ spin_lock_irqsave (& current -> sighand -> siglock , flags );
228233 if (likely (!current -> signal -> audit_tty ))
229234 goto out ;
230235 buf = current -> signal -> tty_audit_buf ;
231236 if (buf ) {
232237 atomic_inc (& buf -> count );
233238 goto out ;
234239 }
235- spin_unlock_irq (& current -> sighand -> siglock );
240+ spin_unlock_irqrestore (& current -> sighand -> siglock , flags );
236241
237242 buf2 = tty_audit_buf_alloc (tty -> driver -> major ,
238243 tty -> driver -> minor_start + tty -> index ,
@@ -242,7 +247,7 @@ static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty,
242247 return NULL ;
243248 }
244249
245- spin_lock_irq (& current -> sighand -> siglock );
250+ spin_lock_irqsave (& current -> sighand -> siglock , flags );
246251 if (!current -> signal -> audit_tty )
247252 goto out ;
248253 buf = current -> signal -> tty_audit_buf ;
@@ -254,7 +259,7 @@ static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty,
254259 atomic_inc (& buf -> count );
255260 /* Fall through */
256261 out :
257- spin_unlock_irq (& current -> sighand -> siglock );
262+ spin_unlock_irqrestore (& current -> sighand -> siglock , flags );
258263 if (buf2 )
259264 tty_audit_buf_free (buf2 );
260265 return buf ;
@@ -317,16 +322,17 @@ void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
317322void tty_audit_push (struct tty_struct * tty )
318323{
319324 struct tty_audit_buf * buf ;
325+ unsigned long flags ;
320326
321- spin_lock_irq (& current -> sighand -> siglock );
327+ spin_lock_irqsave (& current -> sighand -> siglock , flags );
322328 if (likely (!current -> signal -> audit_tty )) {
323- spin_unlock_irq (& current -> sighand -> siglock );
329+ spin_unlock_irqrestore (& current -> sighand -> siglock , flags );
324330 return ;
325331 }
326332 buf = current -> signal -> tty_audit_buf ;
327333 if (buf )
328334 atomic_inc (& buf -> count );
329- spin_unlock_irq (& current -> sighand -> siglock );
335+ spin_unlock_irqrestore (& current -> sighand -> siglock , flags );
330336
331337 if (buf ) {
332338 int major , minor ;
0 commit comments