Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2003 08:01:01 -0300
From:      "Daniel C. Sobral" <dcs@tcoip.com.br>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: mac_mls still panics
Message-ID:  <3E5C9E6D.5040309@tcoip.com.br>
In-Reply-To: <Pine.NEB.3.96L.1030225140317.88812B-100000@fledge.watson.org>
References:  <Pine.NEB.3.96L.1030225140317.88812B-100000@fledge.watson.org>

index | next in thread | previous in thread | raw e-mail

Robert Watson wrote:
> Question on both of these: could you inspect the struct ifnet pointer on
> the mbuf and see what interface they originated from?  Also, the dumps are
 > still showing NULL local variables where it should not be possible -- 
does
 > manual inspection of the variables in the debugger reveal different 
values
 > (ifnetlabel, mbuflabel, etc).  You might want to see if compiling 
with -O0

Doesn't make much sense to me. Mmmmm. Well, have a peek:

(kgdb) up 10
#10 0xc0278d16 in mac_mls_check_ifnet_transmit (ifnet=0xc25ebc00, 
ifnetlabel=0x0, m=0xc0ee1800, mbuflabel=0x0)
     at /usr/src/sys/security/mac_mls/mac_mls.c:1462
1462            return (mac_mls_single_in_range(p, i) ? 0 : EACCES);
(kgdb) p/x *ifnet
$1 = {if_softc = 0xc25ebc00, if_name = 0xc031d9bb, if_link = {tqe_next = 
0xc25cde00, tqe_prev = 0xc0362f94},
   if_addrhead = {tqh_first = 0xc2608400, tqh_last = 0xc2608e60}, 
if_klist = {slh_first = 0x0},
   if_pcount = 0x0, if_bpf = 0x0, if_index = 0x1, if_unit = 0x0, 
if_timer = 0x0, if_nvlans = 0x0,
   if_flags = 0x8843, if_capabilities = 0x8, if_capenable = 0x0, 
if_ipending = 0x0, if_linkmib = 0x0,
   if_linkmiblen = 0x0, if_data = {ifi_type = 0x6, ifi_physical = 0x0, 
ifi_addrlen = 0x6, ifi_hdrlen = 0x12,
     ifi_recvquota = 0x0, ifi_xmitquota = 0x0, ifi_mtu = 0x5dc, 
ifi_metric = 0x0, ifi_baudrate = 0x5f5e100,
     ifi_ipackets = 0x10b22, ifi_ierrors = 0x0, ifi_opackets = 0x663, 
ifi_oerrors = 0x0, ifi_collisions = 0x0,
     ifi_ibytes = 0x9ef12c, ifi_obytes = 0x1be94, ifi_imcasts = 0x10201, 
ifi_omcasts = 0x0, ifi_iqdrops = 0x0,
     ifi_noproto = 0x0, ifi_hwassist = 0x0, ifi_unused = 0x0, 
ifi_lastchange = {tv_sec = 0x0, tv_usec = 0x0}},
   if_multiaddrs = {tqh_first = 0xc25c8640, tqh_last = 0xc25c8620}, 
if_amcount = 0x0, if_output = 0xc02527e0,
   if_input = 0xc0252fb0, if_start = 0xc014b430, if_done = 0x0, if_ioctl 
= 0xc014d570,
   if_watchdog = 0xc014c140, if_poll_recv = 0x0, if_poll_xmit = 0x0, 
if_poll_intren = 0x0,
   if_poll_slowinput = 0x0, if_init = 0xc014c180, if_resolvemulti = 
0xc02537e0, if_snd = {ifq_head = 0x0,
     ifq_tail = 0x0, ifq_len = 0x0, ifq_maxlen = 0x7f, ifq_drops = 0x0, 
ifq_mtx = {mtx_object = {
         lo_class = 0xc035ab00, lo_name = 0xc031d9bb, lo_type = 
0xc03339a6, lo_flags = 0x30000, lo_list = {
           tqe_next = 0xc260847c, tqe_prev = 0xc25d7274}, lo_witness = 
0xc038c700}, mtx_lock = 0x4,
       mtx_recurse = 0x0, mtx_blocked = {tqh_first = 0x0, tqh_last = 
0xc25ebd08}, mtx_contested = {
         le_next = 0x0, le_prev = 0x0}}}, if_poll_slowq = 0x0, 
if_prefixhead = {tqh_first = 0x0,
     tqh_last = 0xc25ebd1c}, if_broadcastaddr = 0xc0362fc0, if_label = 
{l_flags = 0x1, l_perpolicy = {{
         l_ptr = 0xc218b120, l_long = 0xc218b120}, {l_ptr = 0xc2605e80, 
l_long = 0xc2605e80}, {
         l_ptr = 0xc2605f00, l_long = 0xc2605f00}, {l_ptr = 0x0, l_long 
= 0x0}}}}
(kgdb) p ifnetlabel
$2 = (struct label *) 0x0
(kgdb) p mbuflabel
$3 = (struct label *) 0x0
(kgdb) up
#11 0xc01dad8a in mac_check_ifnet_transmit (ifnet=0xc25ebc00, 
mbuf=0xc0ee1800)
     at /usr/src/sys/kern/kern_mac.c:2269
2269                &mbuf->m_pkthdr.label);
(kgdb) p/x *ifnet
$4 = {if_softc = 0xc25ebc00, if_name = 0xc031d9bb, if_link = {tqe_next = 
0xc25cde00, tqe_prev = 0xc0362f94},
   if_addrhead = {tqh_first = 0xc2608400, tqh_last = 0xc2608e60}, 
if_klist = {slh_first = 0x0},
   if_pcount = 0x0, if_bpf = 0x0, if_index = 0x1, if_unit = 0x0, 
if_timer = 0x0, if_nvlans = 0x0,
   if_flags = 0x8843, if_capabilities = 0x8, if_capenable = 0x0, 
if_ipending = 0x0, if_linkmib = 0x0,
   if_linkmiblen = 0x0, if_data = {ifi_type = 0x6, ifi_physical = 0x0, 
ifi_addrlen = 0x6, ifi_hdrlen = 0x12,
     ifi_recvquota = 0x0, ifi_xmitquota = 0x0, ifi_mtu = 0x5dc, 
ifi_metric = 0x0, ifi_baudrate = 0x5f5e100,
     ifi_ipackets = 0x10b22, ifi_ierrors = 0x0, ifi_opackets = 0x663, 
ifi_oerrors = 0x0, ifi_collisions = 0x0,
     ifi_ibytes = 0x9ef12c, ifi_obytes = 0x1be94, ifi_imcasts = 0x10201, 
ifi_omcasts = 0x0, ifi_iqdrops = 0x0,
     ifi_noproto = 0x0, ifi_hwassist = 0x0, ifi_unused = 0x0, 
ifi_lastchange = {tv_sec = 0x0, tv_usec = 0x0}},
   if_multiaddrs = {tqh_first = 0xc25c8640, tqh_last = 0xc25c8620}, 
if_amcount = 0x0, if_output = 0xc02527e0,
   if_input = 0xc0252fb0, if_start = 0xc014b430, if_done = 0x0, if_ioctl 
= 0xc014d570,
   if_watchdog = 0xc014c140, if_poll_recv = 0x0, if_poll_xmit = 0x0, 
if_poll_intren = 0x0,
   if_poll_slowinput = 0x0, if_init = 0xc014c180, if_resolvemulti = 
0xc02537e0, if_snd = {ifq_head = 0x0,
     ifq_tail = 0x0, ifq_len = 0x0, ifq_maxlen = 0x7f, ifq_drops = 0x0, 
ifq_mtx = {mtx_object = {
         lo_class = 0xc035ab00, lo_name = 0xc031d9bb, lo_type = 
0xc03339a6, lo_flags = 0x30000, lo_list = {
           tqe_next = 0xc260847c, tqe_prev = 0xc25d7274}, lo_witness = 
0xc038c700}, mtx_lock = 0x4,
       mtx_recurse = 0x0, mtx_blocked = {tqh_first = 0x0, tqh_last = 
0xc25ebd08}, mtx_contested = {
         le_next = 0x0, le_prev = 0x0}}}, if_poll_slowq = 0x0, 
if_prefixhead = {tqh_first = 0x0,
     tqh_last = 0xc25ebd1c}, if_broadcastaddr = 0xc0362fc0, if_label = 
{l_flags = 0x1, l_perpolicy = {{
         l_ptr = 0xc218b120, l_long = 0xc218b120}, {l_ptr = 0xc2605e80, 
l_long = 0xc2605e80}, {
         l_ptr = 0xc2605f00, l_long = 0xc2605f00}, {l_ptr = 0x0, l_long 
= 0x0}}}}
(kgdb) p/x *mbuf
$5 = {m_hdr = {mh_next = 0x0, mh_nextpkt = 0x0, mh_data = 0xc0ee1854, 
mh_len = 0x34, mh_flags = 0x2,
     mh_type = 0x2}, M_dat = {MH = {MH_pkthdr = {rcvif = 0x0, len = 
0x34, header = 0x0, csum_flags = 0x0,
         csum_data = 0x10, tags = {slh_first = 0x0}, label = {l_flags = 
0x1, l_perpolicy = {{
               l_ptr = 0xbbefa5bb, l_long = 0xbbefa5bb}, {l_ptr = 
0xc2e5c000, l_long = 0xc2e5c000}, {
               l_ptr = 0xc3410580, l_long = 0xc3410580}, {l_ptr = 0x0, 
l_long = 0x0}}}}, MH_dat = {MH_ext = {
           ext_buf = 0xc138c000, ext_free = 0x0, ext_args = 0x0, 
ext_size = 0x800, ref_cnt = 0x34001045,
           ext_type = 0x6606}, MH_databuf = {0x0, 0xc0, 0x38, 0xc1, 0x0, 
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
           0x0, 0x8, 0x0, 0x0, 0x45, 0x10, 0x0, 0x34, 0x6, 0x66, 0x0, 
0x0, 0x40, 0x6, 0xa1, 0x93, 0xa, 0x0,
           0x2, 0x6, 0xc0, 0xa8, 0x6, 0xd, 0xc0, 0x3, 0x0, 0x16, 0xd1, 
0x2b, 0x3, 0xdc, 0xa0, 0x42, 0xca, 0xfe,
           0x80, 0x10, 0x82, 0x17, 0x20, 0x46, 0x0, 0x0, 0x1, 0x1, 0x8, 
0xa, 0x0, 0x36, 0xf9, 0x6f, 0x0, 0x95,
           0x7, 0x7, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x3c, 0x83, 
0xe, 0x29, 0xc, 0x0, 0x0, 0x0, 0x0,
           0x8, 0x0, 0x0, 0x48, 0xf2, 0xbf, 0xbf, 0xa1, 0x92, 0xd, 0x29, 
0x4, 0x0, 0xe0, 0x1, 0x62, 0x1, 0x0,
           0x0, 0x3c, 0x32, 0x39, 0x3e, 0x46, 0x65, 0x62, 0x20, 0x32, 
0x35, 0x20, 0x31, 0x34, 0x3a, 0x31, 0x31,
           0x3a, 0x33, 0x37, 0x20, 0x72, 0x6f, 0x6f, 0x74, 0x3a, 0x20, 
0x2f, 0x64, 0x65, 0x76, 0x2f, 0x61,
           0x64, 0x30, 0x73, 0x32, 0x67, 0x3a, 0x20, 0x55, 0x4e, 0x52, 
0x45, 0x46, 0x20, 0x46, 0x49, 0x4c,
           0x45, 0x20, 0x49, 0x3d, 0x31, 0x36, 0x35, 0x35, 0x34, 0x36, 
0x20, 0x20, 0x4f, 0x57, 0x4e, 0x45,
           0x52, 0x3d, 0x64, 0x63, 0x73, 0x20, 0x4d, 0x4f, 0x44, 0x45, 
0x3d, 0x31, 0x30, 0x30, 0x36, 0x30,
           0x30, 0xa, 0x0, 0x0}}}, M_databuf = {0x0, 0x0, 0x0, 0x0, 
0x34, 0x0 <repeats 11 times>, 0x10, 0x0,
       0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0xbb, 0xa5, 
0xef, 0xbb, 0x0, 0xc0, 0xe5, 0xc2, 0x80,
       0x5, 0x41, 0xc3, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0, 0x38, 0xc1, 0x0, 
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
       0x8, 0x0, 0x0, 0x45, 0x10, 0x0, 0x34,obol.
	Please modify your programs accordingly.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E5C9E6D.5040309>