@@ -495,6 +495,7 @@ struct find_symbol_arg {
495495 struct module * owner ;
496496 const s32 * crc ;
497497 const struct kernel_symbol * sym ;
498+ enum mod_license license ;
498499};
499500
500501static bool check_exported_symbol (const struct symsearch * syms ,
@@ -528,6 +529,7 @@ static bool check_exported_symbol(const struct symsearch *syms,
528529 fsa -> owner = owner ;
529530 fsa -> crc = symversion (syms -> crcs , symnum );
530531 fsa -> sym = & syms -> start [symnum ];
532+ fsa -> license = syms -> license ;
531533 return true;
532534}
533535
@@ -587,6 +589,7 @@ static bool find_exported_symbol_in_section(const struct symsearch *syms,
587589static const struct kernel_symbol * find_symbol (const char * name ,
588590 struct module * * owner ,
589591 const s32 * * crc ,
592+ enum mod_license * license ,
590593 bool gplok ,
591594 bool warn )
592595{
@@ -601,6 +604,8 @@ static const struct kernel_symbol *find_symbol(const char *name,
601604 * owner = fsa .owner ;
602605 if (crc )
603606 * crc = fsa .crc ;
607+ if (license )
608+ * license = fsa .license ;
604609 return fsa .sym ;
605610 }
606611
@@ -1074,7 +1079,7 @@ void __symbol_put(const char *symbol)
10741079 struct module * owner ;
10751080
10761081 preempt_disable ();
1077- if (!find_symbol (symbol , & owner , NULL , true, false))
1082+ if (!find_symbol (symbol , & owner , NULL , NULL , true, false))
10781083 BUG ();
10791084 module_put (owner );
10801085 preempt_enable ();
@@ -1352,7 +1357,7 @@ static inline int check_modstruct_version(const struct load_info *info,
13521357 * locking is necessary -- use preempt_disable() to placate lockdep.
13531358 */
13541359 preempt_disable ();
1355- if (!find_symbol ("module_layout" , NULL , & crc , true, false)) {
1360+ if (!find_symbol ("module_layout" , NULL , & crc , NULL , true, false)) {
13561361 preempt_enable ();
13571362 BUG ();
13581363 }
@@ -1436,6 +1441,7 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod,
14361441 struct module * owner ;
14371442 const struct kernel_symbol * sym ;
14381443 const s32 * crc ;
1444+ enum mod_license license ;
14391445 int err ;
14401446
14411447 /*
@@ -1445,7 +1451,7 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod,
14451451 */
14461452 sched_annotate_sleep ();
14471453 mutex_lock (& module_mutex );
1448- sym = find_symbol (name , & owner , & crc ,
1454+ sym = find_symbol (name , & owner , & crc , & license ,
14491455 !(mod -> taints & (1 << TAINT_PROPRIETARY_MODULE )), true);
14501456 if (!sym )
14511457 goto unlock ;
@@ -2213,7 +2219,7 @@ void *__symbol_get(const char *symbol)
22132219 const struct kernel_symbol * sym ;
22142220
22152221 preempt_disable ();
2216- sym = find_symbol (symbol , & owner , NULL , true, true);
2222+ sym = find_symbol (symbol , & owner , NULL , NULL , true, true);
22172223 if (sym && strong_try_module_get (owner ))
22182224 sym = NULL ;
22192225 preempt_enable ();
@@ -2249,7 +2255,7 @@ static int verify_exported_symbols(struct module *mod)
22492255 for (i = 0 ; i < ARRAY_SIZE (arr ); i ++ ) {
22502256 for (s = arr [i ].sym ; s < arr [i ].sym + arr [i ].num ; s ++ ) {
22512257 if (find_symbol (kernel_symbol_name (s ), & owner , NULL ,
2252- true, false)) {
2258+ NULL , true, false)) {
22532259 pr_err ("%s: exports duplicate symbol %s"
22542260 " (owned by %s)\n" ,
22552261 mod -> name , kernel_symbol_name (s ),
0 commit comments